From 282691da60ec526772f713a63fa0b8f43aea7acb Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 22 Sep 2014 14:50:03 -0400 Subject: 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. --- driver_nmea2000.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'driver_nmea2000.c') 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;l2gpsdata.used[l2] = 0; - } + memset(session->gpsdata.skyview, '\0', sizeof(session->gpsdata.skyview)); l2 = 0; for (l1=0;l1gpsdata.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; } } -- cgit v1.2.1