diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-01-17 10:56:32 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-01-17 10:56:32 -0500 |
commit | f12d1b2a532f5540ab43309a8c5e658329f5df71 (patch) | |
tree | 2d433bf85f16f538b409183a3e6ea2f25289609b /driver_ubx.c | |
parent | 3307f9c53771f39873aad7ceec1ff09bd100b108 (diff) | |
download | gpsd-f12d1b2a532f5540ab43309a8c5e658329f5df71.tar.gz |
Introduce GPS_TIME_VALID flag for GPS time validation.
Diffstat (limited to 'driver_ubx.c')
-rw-r--r-- | driver_ubx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/driver_ubx.c b/driver_ubx.c index c9ad0359..9ac96046 100644 --- a/driver_ubx.c +++ b/driver_ubx.c @@ -71,6 +71,7 @@ ubx_msg_nav_sol(struct gps_device_t *session, unsigned char *buf, gw = (unsigned short)getles16(buf, 8); session->context->gps_week = gw; session->context->gps_tow = tow / 1000.0; + session->context->valid |= GPS_TIME_VALID; t = gpstime_to_unix((int)session->context->gps_week, session->context->gps_tow) @@ -179,12 +180,13 @@ ubx_msg_nav_timegps(struct gps_device_t *session, unsigned char *buf, gw = (unsigned int)getles16(buf, 8); if (gw > session->context->gps_week) session->context->gps_week = (unsigned short)gw; + session->context->gps_tow = tow / 1000.0; + session->context->valid |= GPS_TIME_VALID; flags = (unsigned int)getub(buf, 11); if ((flags & 0x7) != 0) session->context->leap_seconds = (int)getub(buf, 10); - session->context->gps_tow = tow / 1000.0; t = gpstime_to_unix((int)session->context->gps_week, session->context->gps_tow) - session->context->leap_seconds; |