summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriain <iain@linux.intel.com>2011-08-16 12:21:33 +0100
committeriain <iain@linux.intel.com>2011-08-16 12:21:33 +0100
commitb18f1272d2e78da054c866d912fbc67e0d8b4dc4 (patch)
tree982d2159ad6656d2f642ae8b702d4453f307473c
parent6efcdd861898b7e4330e826579097588a1522ee8 (diff)
Allow GSV to have less than the required number of fields
A GSV sentence can have at maximum 19 fields, but depending on the number of satellites seen it can have less. The rule is that it should have 3 fields at the start and then 4 fields for each satellite in the message. To check, we check (nfields - 3) % 4 == 0.
-rw-r--r--src/nmea-parser.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nmea-parser.c b/src/nmea-parser.c
index b0687f2..53a540a 100644
--- a/src/nmea-parser.c
+++ b/src/nmea-parser.c
@@ -299,7 +299,11 @@ parse_gsv (NMEAParseContext *ctxt,
}
#endif
- if (field_count < GSV_FIELDS)
+#if 0
+ if (field_count < GSV_FIELDS && field_count != 11)
+ return FALSE;
+#endif
+ if ((field_count - 3) % 4 != 0)
return FALSE;
message_number = atoi (GSV_FIELD (1));