]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ChangeLog, refclock_true.c:
authorHarlan Stenn <stenn@ntp.org>
Mon, 28 May 2001 00:31:21 +0000 (00:31 -0000)
committerHarlan Stenn <stenn@ntp.org>
Mon, 28 May 2001 00:31:21 +0000 (00:31 -0000)
  * ntpd/refclock_true.c:
     a. Don't cream pp->a_lastcode when we get a <cr><lf> 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 <vk1et@tpg.com.au>

bk: 3b119c59ZwNWwNNwSX75KwHmuoIiNA

ChangeLog
ntpd/refclock_true.c

index 344560f9a68e4279f91e164f5bcf7a7294504c70..cee7d4e4c844fb1b9ace7d7583c4c0004438dffb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 2001-05-27  Harlan Stenn  <stenn@whimsy.udel.edu>
 
        * ntpd/refclock_true.c:
+          a. Don't cream pp->a_lastcode when we get a <cr><lf> 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 <vk1et@tpg.com.au>
+
        * kernel/sys/pcl720.h:
        Add support for the XL clock to refclock_true.c 
        From: Paul A Vixie <vixie@mfnx.net> 
index a5fe7026909cc678109d698f62becdd7f434bac4..19945028634a0a1454ab827e4ac7f8978d7a1904 100644 (file)
  *
  * 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
  * 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 <cr><lf> 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);
 
                /*