summaryrefslogtreecommitdiff
path: root/driver_garmin.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-09-22 14:50:03 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-09-22 14:50:03 -0400
commit282691da60ec526772f713a63fa0b8f43aea7acb (patch)
tree622f4d55c882f63475b84691d41108dd17326cca /driver_garmin.c
parentf63bdafc18991624b872e9efa858c024834a540e (diff)
downloadgpsd-282691da60ec526772f713a63fa0b8f43aea7acb.tar.gz
Refactor representation of satellite data into an array of structs...
...from a set of parallel arrays. This change flushed out a longstanding bug in the computation of DOPs for estimated error bars. Some test-load rebuilds were required: geostar-geos1m-binary.log.chk: With this change error estimates are computed and reported. trimble-lassen_iq-3dfix.log, trimble-lassen_iq-3dfix.log: the change revealed a bug in the computation of satellite-seen bits. Error estimates did not change. navcom.log: Error estimates changed. With these rebuilds, all regression tests pass.
Diffstat (limited to 'driver_garmin.c')
-rw-r--r--driver_garmin.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/driver_garmin.c b/driver_garmin.c
index 662c9b40..e9b15554 100644
--- a/driver_garmin.c
+++ b/driver_garmin.c
@@ -549,7 +549,6 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
session->gpsdata.satellites_visible = 0;
session->gpsdata.satellites_used = 0;
- memset(session->gpsdata.used, 0, sizeof(session->gpsdata.used));
gpsd_zero_satellites(&session->gpsdata);
for (i = 0, j = 0; i < GARMIN_CHANNELS; i++, sats++) {
gpsd_report(&session->context->errout, LOG_INF,
@@ -565,15 +564,15 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
}
if ((int)sats->svid <= 32)
- session->gpsdata.PRN[j] = (int)sats->svid; /* GPS */
+ session->gpsdata.skyview[j].PRN = (int)sats->svid; /* GPS */
else
- session->gpsdata.PRN[j] = (int)sats->svid + 87; /* SBAS */
- session->gpsdata.azimuth[j] = (int)GPSD_LE16TOH(sats->azmth);
- session->gpsdata.elevation[j] = (int)sats->elev;
+ session->gpsdata.skyview[j].PRN = (int)sats->svid + 87; /* SBAS */
+ session->gpsdata.skyview[j].azimuth = (int)GPSD_LE16TOH(sats->azmth);
+ session->gpsdata.skyview[j].elevation = (int)sats->elev;
// Garmin does not document this. snr is in dB*100
// Known, but not seen satellites have a dB value of -1*100
- session->gpsdata.ss[j] = (float)(GPSD_LE16TOH(sats->snr) / 100.0);
- if (session->gpsdata.ss[j] == -1) {
+ session->gpsdata.skyview[j].ss = (float)(GPSD_LE16TOH(sats->snr) / 100.0);
+ if (session->gpsdata.skyview[j].ss == -1) {
continue;
}
// FIX-ME: Garmin documents this, but Daniel Dorau
@@ -581,8 +580,8 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
// doesn't match it.
if ((uint8_t) 0 != (sats->status & 4)) {
// used in solution?
- session->gpsdata.used[session->gpsdata.satellites_used++]
- = session->gpsdata.PRN[j];
+ session->gpsdata.skyview[j].used = true;
+ session->gpsdata.satellites_used++;
}
session->gpsdata.satellites_visible++;
j++;