diff options
author | Michael Tatarinov <kukabu@gmail.com> | 2012-06-26 13:45:58 +0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2012-06-26 06:48:07 -0400 |
commit | 5158d66b981a78213af3639084592c9233d857da (patch) | |
tree | 6001d782e375c1eaa25ebf69c8768ca65a6e505a /subframe.c | |
parent | fb207bd62f260c2ac061bc94861a22fa4c54b935 (diff) | |
download | gpsd-5158d66b981a78213af3639084592c9233d857da.tar.gz |
Fix the leap seconds notify.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'subframe.c')
-rw-r--r-- | subframe.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -722,8 +722,12 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session, subp->sub4_18.DN, subp->sub4_18.lsf); #ifdef NTPSHM_ENABLE + /* IS-GPS-200 Revision E, paragraph 20.3.3.5.2.4 */ if ((subp->sub4_18.WNt == subp->sub4_18.WNlsf) && - (subp->sub4_18.DN == 1 )) { + ((session->context->gps_week % 256) == (unsigned short)subp->sub4_18.WNlsf) && + /* notify the leap seconds correction in the end of current day */ + ((double)((subp->sub4_18.DN - 1) * SECS_PER_DAY) < session->context->gps_tow) && + ((double)(subp->sub4_18.DN * SECS_PER_DAY) > session->context->gps_tow)) { if ( subp->sub4_18.leap < subp->sub4_18.lsf ) session->context->leap_notify = LEAP_ADDSECOND; else if ( subp->sub4_18.leap > subp->sub4_18.lsf ) |