From: Harlan Stenn Date: Mon, 28 May 2001 00:31:21 +0000 (-0000) Subject: ChangeLog, refclock_true.c: X-Git-Tag: NTP_4_0_99_M~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2d71d88fdf0b62635c775af762d87aa0e9f6387;p=thirdparty%2Fntp.git ChangeLog, refclock_true.c: * ntpd/refclock_true.c: a. Don't cream pp->a_lastcode when we get a pair b. Fix up pp->leap handling to work correctly c. clear CEVNT_BADTIME etc warnings when we get good clock CEVNT_NOMINAL. From: John Woolner bk: 3b119c59ZwNWwNNwSX75KwHmuoIiNA --- diff --git a/ChangeLog b/ChangeLog index 344560f9a..cee7d4e4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ 2001-05-27 Harlan Stenn * ntpd/refclock_true.c: + a. Don't cream pp->a_lastcode when we get a pair + b. Fix up pp->leap handling to work correctly + c. clear CEVNT_BADTIME etc warnings when we get good clock + CEVNT_NOMINAL. + From: John Woolner + * kernel/sys/pcl720.h: Add support for the XL clock to refclock_true.c From: Paul A Vixie diff --git a/ntpd/refclock_true.c b/ntpd/refclock_true.c index a5fe70269..199450286 100644 --- a/ntpd/refclock_true.c +++ b/ntpd/refclock_true.c @@ -61,11 +61,12 @@ * * Quality codes indicate possible error of * 468-DC GOES Receiver: - * GPS-TM/TMD Receiver: - * ? +/- 500 milliseconds # +/- 50 milliseconds - * * +/- 5 milliseconds . +/- 1 millisecond - * space less than 1 millisecond - * OM-DC OMEGA Receiver: + * GPS-TM/TMD Receiver: (default quality codes for XL-DC) + * ? +/- 1 milliseconds # +/- 100 microseconds + * * +/- 10 microseconds . +/- 1 microsecond + * space less than 1 microsecond + * OM-DC OMEGA Receiver: (default quality codes for OMEGA) + * WARNING OMEGA navigation system is no longer existent * > >+- 5 seconds * ? >+/- 500 milliseconds # >+/- 50 milliseconds * * >+/- 5 milliseconds . >+/- 1 millisecond @@ -108,6 +109,7 @@ * flag4 - use the PCL-720 (BSD/OS only) */ + /* * Definitions */ @@ -324,6 +326,10 @@ true_receive( char synced; int i; int lat, lon, off; /* GOES Satellite position */ + /* Use these variable to hold data until we decide its worth keeping */ + char rd_lastcode[BMAX]; + l_fp rd_tmp; + u_short rd_lencode; /* * Get the clock this applies to and pointers to the data. @@ -335,14 +341,17 @@ true_receive( /* * Read clock output. Automatically handles STREAMS, CLKLDISC. */ - pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &pp->lastrec); + rd_lencode = refclock_gtlin(rbufp, rd_lastcode, BMAX, &rd_tmp); + rd_lastcode[rd_lencode] = '\0'; /* * There is a case where generates 2 timestamps. */ - if (pp->lencode == 0) - return; - pp->a_lastcode[pp->lencode] = '\0'; + if (rd_lencode == 0) + return; + pp->lencode = rd_lencode; + strcpy(pp->a_lastcode, rd_lastcode); + pp->lastrec = rd_tmp; true_debug(peer, "receive(%s) [%d]\n", pp->a_lastcode, pp->lencode); up->pollcnt = 2; @@ -468,9 +477,12 @@ true_receive( /* * Adjust the synchronize indicator according to timecode + * say were OK, and then say not if we really are not OK */ - if (synced != ' ' && synced != '.' && synced != '*') + if (synced == '>' || synced == '#' || synced == '?') pp->leap = LEAP_NOTINSYNC; + else + pp->leap = LEAP_NOWARNING; true_doevent(peer, e_TS); @@ -528,6 +540,11 @@ true_receive( refclock_report(peer, CEVNT_BADTIME); return; } + /* + * If clock is good we send a NOMINAL message so that + * any previous BAD messages are nullified + */ + refclock_report(peer, CEVNT_NOMINAL); refclock_receive(peer); /*