From: Harlan Stenn Date: Sun, 22 Apr 2001 00:47:47 +0000 (-0000) Subject: ChangeLog, Makefile.in, refclock_nmea.c: X-Git-Tag: NTP_4_0_99_M~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bd205d2ef19679bf59524d246709cb65a721648;p=thirdparty%2Fntp.git ChangeLog, Makefile.in, refclock_nmea.c: * ntpd/refclock_nmea.c (nmea_receive): Fixes. From: John Woolner refclock_nmea.c: * ntpd/refclock_nmea.c (nmea_receive): Typo. bk: 3ae22a33MJU0ylQ8lsLVq1Hl9ubuaQ --- diff --git a/ChangeLog b/ChangeLog index e4ad540c47..b666598932 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2001-04-21 Harlan Stenn + * ntpd/refclock_nmea.c (nmea_receive): Fixes. + From: John Woolner + * util/ntp-genkeys.c: Declare check_netinfo, don't define it. From: Jack Bryans diff --git a/Makefile.in b/Makefile.in index 7c35541e70..2a7f9389aa 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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@ diff --git a/ntpd/refclock_nmea.c b/ntpd/refclock_nmea.c index 03ca8abc9d..ac907065ea 100644 --- a/ntpd/refclock_nmea.c +++ b/ntpd/refclock_nmea.c @@ -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