]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ChangeLog, Makefile.in, refclock_nmea.c:
authorHarlan Stenn <stenn@ntp.org>
Sun, 22 Apr 2001 00:47:47 +0000 (00:47 -0000)
committerHarlan Stenn <stenn@ntp.org>
Sun, 22 Apr 2001 00:47:47 +0000 (00:47 -0000)
  * ntpd/refclock_nmea.c (nmea_receive): Fixes.
  From: John Woolner <vk1et@tpg.com.au>
refclock_nmea.c:
  * ntpd/refclock_nmea.c (nmea_receive): Typo.

bk: 3ae22a33MJU0ylQ8lsLVq1Hl9ubuaQ

ChangeLog
Makefile.in
ntpd/refclock_nmea.c

index e4ad540c474a26b644c61c70586bf5eaf581d192..b666598932dae8d4d5e5007a17674f33f6e539c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2001-04-21  Harlan Stenn  <stenn@whimsy.udel.edu>
 
+       * ntpd/refclock_nmea.c (nmea_receive): Fixes.
+       From: John Woolner <vk1et@tpg.com.au>
+
        * util/ntp-genkeys.c: Declare check_netinfo, don't define it.
        From: Jack Bryans <jbryans@csulb.edu>
 
index 7c35541e701f1132d1c3fe5258d996a26ce9e698..2a7f9389aaa9d5be21ea0819303e531d46687245 100644 (file)
@@ -94,6 +94,7 @@ MAKE_NTPTIME = @MAKE_NTPTIME@
 MAKE_NTP_GENKEYS = @MAKE_NTP_GENKEYS@
 MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
 MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
 OPENSSL = @OPENSSL@
 OPENSSL_INC = @OPENSSL_INC@
 OPENSSL_LIB = @OPENSSL_LIB@
@@ -105,6 +106,7 @@ RANLIB = @RANLIB@
 RSADIR = @RSADIR@
 RSAOBJS = @RSAOBJS@
 RSAREF = @RSAREF@
+RSASRCS = @RSASRCS@
 STRIP = @STRIP@
 TESTDCF = @TESTDCF@
 U = @U@
index 03ca8abc9d3aa6f65d64b9dfc0bd3fefe8d796be..ac907065eabab546e65bf374c0fd7817c95e4ef0 100644 (file)
@@ -434,12 +434,6 @@ nmea_receive(
        pp->lastrec = up->tstamp = rd_tmp;
        up->pollcnt = 2;
 
-#ifdef HAVE_PPSAPI
-      /* If the PPSAPI is working, rather use its timestamps. */
-      if (nmea_pps(up, &rd_tmp) == 1)
-              pp->lastrec = up->tstamp = rd_tmp;
-#endif /* HAVE_PPSAPI */
-
 #ifdef DEBUG
        if (debug)
            printf("nmea: timecode %d %s\n", pp->lencode,
@@ -527,29 +521,29 @@ nmea_receive(
           one, two or three digits
        */
        pp->msec = 0; 
-       if ( dp[6] == '.' )
-           if ( isdigit(dp[7]) )
-           {
-               pp->msec = (dp[7]-'0')*100;
-               if ( isdigit(dp[8]) )
-               {
-                   pp->msec = pp->msec + (dp[8]-'0')*10;
-                   if ( isdigit(dp[9]) )
-                       pp->msec = pp->msec + (dp[9]-'0');
+       if (dp[6] == '.') {
+               if (isdigit(dp[7])) {
+                       pp->msec = (dp[7] - '0') * 100;
+                       if (isdigit(dp[8])) {
+                               pp->msec += (dp[8] - '0') * 10;
+                               if (isdigit(dp[9])) {
+                                       pp->msec += (dp[9] - '0');
+                               }
+                       }
                }
-           }
+       }
 
-       if (pp->hour > 23 || pp->minute > 59 || pp->second > 59) {
+       if (pp->hour > 23 || pp->minute > 59 || pp->second > 59
+         || pp->msec > 1000) {
                refclock_report(peer, CEVNT_BADTIME);
                return;
        }
 
 
-       if (cmdtype==GPRMC)
-       {
        /*
         * Convert date and check values.
         */
+       if (cmdtype==GPRMC) {
            dp = field_parse(cp,9);
            day = dp[0] - '0';
            day = (day * 10) + dp[1] - '0';
@@ -593,6 +587,17 @@ nmea_receive(
        pp->day = day;
 
 
+#ifdef HAVE_PPSAPI
+       /*
+        * If the PPSAPI is working, rather use its timestamps.
+        * assume that the PPS occurs on the second so blow any msec
+        */
+       if (nmea_pps(up, &rd_tmp) == 1) {
+               pp->lastrec = up->tstamp = rd_tmp;
+               pp->msec = 0;
+       }
+#endif /* HAVE_PPSAPI */
+
        /*
         * Process the new sample in the median filter and determine the
         * reference clock offset and dispersion. We use lastrec as both