summaryrefslogtreecommitdiff
path: root/driver_sirf.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2010-04-13 11:53:03 -0700
committerGary E. Miller <gem@rellim.com>2010-04-13 11:53:03 -0700
commit34af37c45704beec968e1be85a878150eef825f4 (patch)
tree987d6f1429d985c5ee2afd941def479d6d008e3e /driver_sirf.c
parentddc34f3c17cab4fe29e1adffad81f006fbf0d632 (diff)
downloadgpsd-34af37c45704beec968e1be85a878150eef825f4.tar.gz
In driver_sirf set the TIME_IS flag when appropriate.
Diffstat (limited to 'driver_sirf.c')
-rw-r--r--driver_sirf.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/driver_sirf.c b/driver_sirf.c
index 7bf29267..8a0ee308 100644
--- a/driver_sirf.c
+++ b/driver_sirf.c
@@ -487,6 +487,7 @@ static gps_mask_t sirf_msg_navdata(struct gps_device_t *session, unsigned char *
static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session, unsigned char *buf, size_t len)
{
int st, i, j, cn;
+ gps_mask_t mask = 0;
if (len != 188)
return 0;
@@ -529,6 +530,7 @@ static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session, unsigned char *b
gpsd_report(LOG_PROG,
"SiRF: NTPD not enough satellites seen: %d\n", st);
} else {
+ /* SiRF says if 3 sats in view the time is good */
if ( 0 == (session->driver.sirf.time_seen & TIME_SEEN_GPS_1)) {
gpsd_report(LOG_RAW, "SiRF: NTPD just seen GPS_1\n");
}
@@ -538,16 +540,17 @@ static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session, unsigned char *b
session->gpsdata.skyview_time,
session->context->leap_seconds);
session->driver.sirf.time_seen |= TIME_SEEN_GPS_1;
+ mask |= TIME_IS;
/*
- * Don't be tempted to set TIME_IS here. This time stamp, at
- * 4800bps, is so close to 1 sec old as to be confusing to
- * ntpd, so ignore it.
+ * This time stamp, at 4800bps, is so close to 1 sec old as to
+ * be confusing to ntpd, but ntpshm_put() will ignore it if a better
+ * time already seen
*/
}
#endif /* NTPSHM_ENABLE */
gpsd_report(LOG_DATA, "SiRF: MTD 0x04: visible=%d mask={SATELLITE}\n",
session->gpsdata.satellites_visible);
- return SATELLITE_IS;
+ return SATELLITE_IS | mask;
}
#ifdef NTPSHM_ENABLE