summaryrefslogtreecommitdiff
path: root/driver_aivdm.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-12-01 19:18:22 -0500
committerEric S. Raymond <esr@thyrsus.com>2010-12-01 19:18:22 -0500
commit63896d0cf3c375beda03f8c7ad91e6ea7d0d6ec5 (patch)
tree11ee533fe440e1ef7293f2c71220e3bdfebd60a4 /driver_aivdm.c
parent25845cfe248878c2d4ca3f530f3514fd751bd496 (diff)
downloadgpsd-63896d0cf3c375beda03f8c7ad91e6ea7d0d6ec5.tar.gz
Document a minor problem with AIVDO sentences and rebuild its regression test.
Diffstat (limited to 'driver_aivdm.c')
-rw-r--r--driver_aivdm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/driver_aivdm.c b/driver_aivdm.c
index 44cb0ad3..fb6f6417 100644
--- a/driver_aivdm.c
+++ b/driver_aivdm.c
@@ -124,6 +124,16 @@ bool aivdm_decode(const char *buf, size_t buflen,
switch (field[4][0]) {
/* FIXME: if fields[4] == "12", it doesn't detect the error */
case '\0':
+ /*
+ * Apparently an empty channel is normal for AIVDO sentences,
+ * which makes sense as they don't come in over radio. This
+ * is going to break if there's ever an AIVDO type 24, though.
+ */
+ if (strncmp(field[0], "!AIVDO", 6) != 0)
+ gpsd_report(LOG_ERROR, "invalid empty AIS channel. Assuming 'A'\n",
+ field[4][0], (field[4][0] != '\0' ? field[4][0]:' '));
+ ais_context = &ais_contexts[0];
+ break;
case '1':
gpsd_report(LOG_ERROR, "invalid AIS channel 0x%0x '%c'. Assuming 'A'\n",
field[4][0], (field[4][0] != '\0' ? field[4][0]:' '));