diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2007-12-05 21:33:54 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2007-12-05 21:33:54 +0000 |
commit | 495463eb5bb7c2461752405c94782d2e0ea4e124 (patch) | |
tree | 5685b04967564edc7bd831dd06c8e8aae964b5c1 | |
parent | f2643ad182d6dea3835a842b6140b0102cc8f14a (diff) | |
download | gpsd-495463eb5bb7c2461752405c94782d2e0ea4e124.tar.gz |
Address a bug in the incrementing of fixcnt spotted by Mick Durkin.
-rw-r--r-- | libgpsd_core.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index cfd89dda..b088900b 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -743,8 +743,15 @@ gps_mask_t gpsd_poll(struct gps_device_t *session) } session->gpsdata.set = ONLINE_SET | dopmask | received; - /* count good fixes */ - if (session->gpsdata.status > STATUS_NO_FIX) + /* + * Count good fixes. We used to check + * session->gpsdata.status > STATUS_NO_FIX + * here, but that wasn't quite right. That tells us whether + * we think we have a valid fix for the current cycle, but remains + * true while following non-fix packets are received. What we + * really want to know is whether the last packet received held a fix. + */ + if ((session->gpsdata.set & LATLON_SET)!=0) session->context->fixcnt++; session->gpsdata.d_decode_time = timestamp(); |