summaryrefslogtreecommitdiff
path: root/driver_nmea2000.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_nmea2000.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_nmea2000.c')
-rw-r--r--driver_nmea2000.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/driver_nmea2000.c b/driver_nmea2000.c
index e0cadf70..b1a0ed18 100644
--- a/driver_nmea2000.c
+++ b/driver_nmea2000.c
@@ -376,9 +376,7 @@ static gps_mask_t hnd_129540(unsigned char *bu, int len, PGN *pgn, struct gps_de
session->driver.nmea2000.sid[2] = bu[0];
session->gpsdata.satellites_visible = (int)bu[2];
- for (l2=0;l2<MAXCHANNELS;l2++) {
- session->gpsdata.used[l2] = 0;
- }
+ memset(session->gpsdata.skyview, '\0', sizeof(session->gpsdata.skyview));
l2 = 0;
for (l1=0;l1<session->gpsdata.satellites_visible;l1++) {
int svt;
@@ -392,12 +390,13 @@ static gps_mask_t hnd_129540(unsigned char *bu, int len, PGN *pgn, struct gps_de
svt = (int)(bu[3+12*l1+11] & 0x0f);
- session->gpsdata.elevation[l1] = (int) (round(elev));
- session->gpsdata.azimuth[l1] = (int) (round(azi));
- session->gpsdata.ss[l1] = snr;
- session->gpsdata.PRN[l1] = (int)bu[3+12*l1+0];
+ session->gpsdata.skyview[l1].elevation = (int) (round(elev));
+ session->gpsdata.skyview[l1].azimuth = (int) (round(azi));
+ session->gpsdata.skyview[l1].ss = snr;
+ session->gpsdata.skyview[l1].PRN = (int)bu[3+12*l1+0];
+ session->gpsdata.skyview[l1].used = false;
if ((svt == 2) || (svt == 5)) {
- session->gpsdata.used[l2] = session->gpsdata.PRN[l1];
+ session->gpsdata.skyview[l1].used = true;
l2 += 1;
}
}