summaryrefslogtreecommitdiff
path: root/driver_tsip.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-05-03 22:37:45 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-05-03 22:37:45 -0400
commit8e2d223d06d0787bdd9930256d99f2d2d67a9885 (patch)
tree47b8d6433414bacdc14514f0ce20521292b647d9 /driver_tsip.c
parented53d63860c7b1e4cb589f42deaf989e51002798 (diff)
downloadgpsd-8e2d223d06d0787bdd9930256d99f2d2d67a9885.tar.gz
Improved decoding for Supplemental Timing Packet.
>From a suggestion by Joe Davidson. All regression tests pass.
Diffstat (limited to 'driver_tsip.c')
-rw-r--r--driver_tsip.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/driver_tsip.c b/driver_tsip.c
index 15a10132..0c6245a3 100644
--- a/driver_tsip.c
+++ b/driver_tsip.c
@@ -808,6 +808,31 @@ static gps_mask_t tsip_analyze(struct gps_device_t *session)
/* Decode Fix modes */
switch (u2 & 7) {
+ case 0: /* Auto */
+ switch (u1) {
+ /*
+ * According to the Thunderbolt Manual, the
+ * first byte of the supplemental timing packet
+ * simply indicates the configuration of the
+ * device, not the actual lock, so we need to
+ * look at the decode status.
+ */
+ case 0: /* "Doing Fixes" */
+ session->newdata.mode = MODE_3D;
+ break;
+ case 0x0B: /* "Only 3 usable sats" */
+ session->newdata.mode = MODE_2D;
+ break;
+ case 0x1: /* "Don't have GPS time" */
+ case 0x3: /* "PDOP is too high" */
+ case 0x8: /* "No usable sats" */
+ case 0x9: /* "Only 1 usable sat" */
+ case 0x0A: /* "Only 2 usable sats */
+ case 0x0C: /* "The chosen sat is unusable" */
+ case 0x10: /* TRAIM rejected the fix */
+ default:
+ session->newdata.mode = MODE_NO_FIX;
+ }
case 6: /* Clock Hold 2D */
case 3: /* 2D Position Fix */
//session->gpsdata.status = STATUS_FIX;