[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] Draft Time Service HOWTO is beginning to approach final f
From: |
Eric S. Raymond |
Subject: |
Re: [gpsd-dev] Draft Time Service HOWTO is beginning to approach final form |
Date: |
Fri, 25 Oct 2013 14:21:29 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Andy Walls <address@hidden>:
> In gpsd's ntpshm.c, setting
>
> shmTime->leap = LEAP_NOTINSYNC;
>
> tells ntpd that the shared memory clock is in alarm. ntpd essentially
> ignores clocks that are in alarm.
>
> I am hoping that while a clock is in alarm status, ntpd won't declare it
> a falseticker, so that when it comes out of alarm, it will be
> immediately useful to ntpd.
That is interesting. Comment added:
static int ntpshm_alloc(struct gps_context_t *context)
/* allocate NTP SHM segment. return its segment number, or -1 */
{
int i;
for (i = 0; i < NTPSHMSEGS; i++)
if (context->shmTime[i] != NULL && !context->shmTimeInuse[i]) {
context->shmTimeInuse[i] = true;
/*
* In case this segment gets sent to ntpd before an
* ephemeris is available, the LEAP_NOTINSYNC value will
* tell ntpd that this source is in a "clock alarm" state
* and should be ignored. The goal is to prevent ntpd
* from declaring the GPS a falseticker before it gets
* all its marbles together.
*/
memset((void *)context->shmTime[i], 0, sizeof(struct shmTime));
context->shmTime[i]->mode = 1;
context->shmTime[i]->leap = LEAP_NOTINSYNC;
context->shmTime[i]->precision = -1; /* initially 0.5 sec */
context->shmTime[i]->nsamples = 3; /* stages of median filter */
return i;
}
return -1;
}
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>