summaryrefslogtreecommitdiff
path: root/driver_evermore.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-04-20 22:32:55 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-04-20 22:32:55 -0400
commitccdf4e5641f8847cd49ead381e21b3d28cd0bcc2 (patch)
tree9fac7198fa75a341fa7833222dc327c6852c3372 /driver_evermore.c
parentd766ad888f1c7de697cbd4294c38aa3b06dddd85 (diff)
downloadgpsd-ccdf4e5641f8847cd49ead381e21b3d28cd0bcc2.tar.gz
Clear DOPs only when we get a skyview report.
This solves the disappearing epx/epy bug on SiRFs, but it was actually a systemic problem that affected several drivers. Navigation solution messages were clearing DOPs, making it impossible for the error modeller to compute estimates. New logic: Clear DOPs only when we get a skyview report. They'll be regenerated by our visibility-matrix calculation when the skyview sentence is analyzed. If a sentence from the device supplies a DOP between the time the visibility calculation is done and when the next fix is reported, it will override our computed value. This might change later! This change required a regression-test rebuild.
Diffstat (limited to 'driver_evermore.c')
-rw-r--r--driver_evermore.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/driver_evermore.c b/driver_evermore.c
index 407ac6b6..4a637e8b 100644
--- a/driver_evermore.c
+++ b/driver_evermore.c
@@ -231,7 +231,12 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
session->context->gps_tow) -
session->context->leap_seconds;
/*@ end @*/
- clear_dop(&session->gpsdata.dop);
+ /*
+ * We make a deliberate choice not to clear DOPs from the
+ * last skyview here, but rather to treat this as a supplement
+ * to our calculations from the visiniolity matrix, trusting
+ * the firmware algorithms over ours.
+ */
session->gpsdata.dop.gdop = (double)getub(buf2, 8) * 0.1;
session->gpsdata.dop.pdop = (double)getub(buf2, 9) * 0.1;
session->gpsdata.dop.hdop = (double)getub(buf2, 10) * 0.1;
@@ -276,7 +281,7 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf,
session->context->leap_seconds;
/*@ end @*/
session->gpsdata.satellites_visible = (int)getub(buf2, 8);
- session->gpsdata.satellites_used = 0;
+ gpsd_zero_satellites(&session->gpsdata);
memset(session->gpsdata.used, 0, sizeof(session->gpsdata.used));
if (session->gpsdata.satellites_visible > 12) {
gpsd_report(LOG_WARN,