summaryrefslogtreecommitdiff
path: root/driver_proto.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_proto.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_proto.c')
-rw-r--r--driver_proto.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/driver_proto.c b/driver_proto.c
index 79fa4b7b..367158ab 100644
--- a/driver_proto.c
+++ b/driver_proto.c
@@ -51,10 +51,6 @@
#include "bits.h"
-/*
- * These routines are specific to this driver
- */
-
static gps_mask_t _proto__parse_input(struct gps_device_t *);
static gps_mask_t _proto__dispatch(struct gps_device_t *, unsigned char *, size_t );
static gps_mask_t _proto__msg_navsol(struct gps_device_t *, unsigned char *, size_t );
@@ -102,7 +98,15 @@ _proto__msg_navsol(struct gps_device_t *session, unsigned char *buf, size_t data
session->newdata.epy = GET_LATITUDE_ERROR();
session->newdata.eps = GET_SPEED_ERROR();
session->gpsdata.satellites_used = GET_SATELLITES_USED();
- dop_clear(&session->gpsdata.dop);
+ /*
+ * Do *not* clear DOPs in a navigation solution message;
+ * instead, opportunistically pick up whatever it gives
+ * us and replace whatever values we computed from the
+ * visibility matrix for he last skyview. The reason to trust
+ * the chip returns over what we compute is that some
+ * chips have internal deweighting albums to throw out sats
+ * that increase DOP.
+ */
session->gpsdata.dop.hdop = GET_HDOP();
session->gpsdata.dop.vdop = GET_VDOP();
/* other DOP if available */