gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] gpsd rolls back to 1999


From: Eric S. Raymond
Subject: Re: [gpsd-dev] gpsd rolls back to 1999
Date: Fri, 28 Jun 2019 08:15:17 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

Sanjeev Gupta <address@hidden>:
> Eric, on the gpsd TODO:
> 
> https://www.febo.com/pipermail/time-nuts/2013-August/079271.html

Reproducing the patch here so it's part of the record of our discussion:

--- refclock_nmea.c.orig        2010-11-10 03:38:22.000000000 +0000
+++ refclock_nmea.c     2013-08-13 20:05:44.000000000 +0100
@@ -979,6 +1076,8 @@
        date.yearday = 0; /* make sure it's not used */
        DTOLFP(pp->nsec * 1.0e-9, &reftime);
        reftime.l_ui += caltontp(&date);
+       while (reftime.l_i + 512*7*86400 < rd_timestamp.l_i)
+               reftime.l_i += 1024*7*86400;
 
        /* $GPZDG postprocessing first... */
        if (NMEA_GPZDG == sentence) {

It does this: Look a half-era ahead.  If that's still less than a
reference date, shift the time stamp forward N cycles for the minimum
N that will take it past the reference date.

I'm not certain what the reference date is, because the context doesn't
exactly match anything in our code.  If it were me writing the code it
would be the build date of the instance.

That might work, but it makes me nervous. Perly is not a dimwit; if 
compensating for wraparound is that easy, why the magic calendar hack?

This whole area is full of traps.  We need to proceed very carefully.
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]