summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2016-01-05 04:47:53 -0500
committerEric S. Raymond <esr@thyrsus.com>2016-01-05 04:47:53 -0500
commit074499e16ab780c1bcad8e693875582620baf7b9 (patch)
tree2bfc20890cb700b7db0c0b6d57e3eeef8077c1aa
parentc5467d4c91d906c2d49f03bc7dc309c7b6584754 (diff)
downloadgpsd-074499e16ab780c1bcad8e693875582620baf7b9.tar.gz
Disable SV-field-count sanity checking if it can't be done right.
-rw-r--r--driver_nmea0183.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/driver_nmea0183.c b/driver_nmea0183.c
index 148afd37..8d63eb5d 100644
--- a/driver_nmea0183.c
+++ b/driver_nmea0183.c
@@ -694,11 +694,20 @@ static gps_mask_t processGSV(int count, char *field[],
if (sp->PRN != 0)
session->gpsdata.satellites_visible++;
}
- if (session->nmea.part == session->nmea.await
- && atoi(field[3]) != session->gpsdata.satellites_visible)
- gpsd_log(&session->context->errout, LOG_WARN,
- "GPGSV field 3 value of %d != actual count %d\n",
- atoi(field[3]), session->gpsdata.satellites_visible);
+
+ /*
+ * Alas, we can't sanity check field counts when there are multiple sat
+ * pictures, because the visible member counts *all* satellites - you
+ * get a bad result on the second and later SV spans. Note, this code
+ * assumes that if any of the special sat pics occur they come right
+ * after a stock GPGSV one.
+ */
+ if (session->nmea.seen_glgsv || session->nmea.seen_bdgsv || session->nmea.seen_qzss)
+ if (session->nmea.part == session->nmea.await
+ && atoi(field[3]) != session->gpsdata.satellites_visible)
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "GPGSV field 3 value of %d != actual count %d\n",
+ atoi(field[3]), session->gpsdata.satellites_visible);
/* not valid data until we've seen a complete set of parts */
if (session->nmea.part < session->nmea.await) {