From 0fcb2da0c5ae748c64c3c6f09f0dd8f7998f74f2 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 10 Jan 2015 13:14:12 -0500 Subject: Almost entirely eliminate use of sats_used array. Instead, set the used member in the satellites array directly where possible. The NMEA0183 and TSIP drivers still need a local equivalent. This changes pseudo-NMEA GSA output in several binary-protocol tests. --- driver_nmea2000.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'driver_nmea2000.c') diff --git a/driver_nmea2000.c b/driver_nmea2000.c index 7f2474c5..d9b6e557 100644 --- a/driver_nmea2000.c +++ b/driver_nmea2000.c @@ -367,7 +367,7 @@ static gps_mask_t hnd_129539(unsigned char *bu, int len, PGN *pgn, struct gps_de */ static gps_mask_t hnd_129540(unsigned char *bu, int len, PGN *pgn, struct gps_device_t *session) { - int l1, l2; + int l1; print_data(session->context, bu, len, pgn); gpsd_report(&session->context->errout, LOG_DATA, @@ -377,8 +377,6 @@ static gps_mask_t hnd_129540(unsigned char *bu, int len, PGN *pgn, struct gps_de session->gpsdata.satellites_visible = (int)bu[2]; memset(session->gpsdata.skyview, '\0', sizeof(session->gpsdata.skyview)); - memset(session->sats_used, 0, sizeof(session->sats_used)); - l2 = 0; for (l1=0;l1gpsdata.satellites_visible;l1++) { int svt; double azi, elev, snr; @@ -398,8 +396,6 @@ static gps_mask_t hnd_129540(unsigned char *bu, int len, PGN *pgn, struct gps_de session->gpsdata.skyview[l1].used = false; if ((svt == 2) || (svt == 5)) { session->gpsdata.skyview[l1].used = true; - session->sats_used[l2] = (unsigned short) session->gpsdata.skyview[l1].PRN; - l2 += 1; } } session->driver.nmea2000.mode_valid |= 2; -- cgit v1.2.1