summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-05-20 05:17:09 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-05-20 05:17:09 -0400
commit5b511d159c61adea1245b61704f751a3e6aa3006 (patch)
tree0b55bde4119b0fe191983222f893ef3a416e2d34 /packet.c
parent4f35e720288bb67e918c065cebcb177b088e0e4f (diff)
downloadgpsd-5b511d159c61adea1245b61704f751a3e6aa3006.tar.gz
Support for some unusual NMEA 4.0 AIS talker IDs.
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/packet.c b/packet.c
index 1c1ffa3b..d32cba21 100644
--- a/packet.c
+++ b/packet.c
@@ -102,11 +102,16 @@ PERMISSIONS
* $SD -- Depth Sounder
* $P -- Vendor-specific sentence
*
- * !AI -- Mobile AIS station
- * !BS -- Base AIS station (deprecated in NMEA 4.0)
* !AB -- NMEA 4.0 Base AIS station
- * !AN -- NMEA 4.0 Buoy AIS station
+ * !AD -- MMEA 4.0 Dependent AIS Base Station
+ * !AI -- Mobile AIS station
+ * !AN -- NMEA 4.0 Aid to Navigation AIS station
+ * !AR -- NMEA 4.0 AIS Receiving Station
* !AX -- NMEA 4.0 Repeater AIS station
+ * !AS -- NMEA 4.0 Limited Base Station
+ * !AT -- NMEA 4.0 AIS Transmitting Station
+ * !BS -- Base AIS station (deprecated in NMEA 4.0)
+ * !SA -- NMEA 4.0 Physical Shore AIS Station
*/
enum
@@ -420,11 +425,13 @@ static void nextstate(struct gps_packet_t *lexer, unsigned char c)
lexer->state = AIS_LEAD_1;
else if (c == 'B')
lexer->state = AIS_LEAD_ALT1;
+ else if (c == 'S')
+ lexer->state = AIS_LEAD_ALT3;
else
lexer->state = GROUND_STATE;
break;
case AIS_LEAD_1:
- if (c == 'I' || c == 'B' || c == 'N' || c == 'X')
+ if (strchr("BDINRSTX", c) != NULL)
lexer->state = AIS_LEAD_2;
else
lexer->state = GROUND_STATE;
@@ -447,6 +454,18 @@ static void nextstate(struct gps_packet_t *lexer, unsigned char c)
else
lexer->state = GROUND_STATE;
break;
+ case AIS_LEAD_ALT3:
+ if (c == 'A')
+ lexer->state = AIS_LEAD_ALT4;
+ else
+ lexer->state = GROUND_STATE;
+ break;
+ case AIS_LEAD_ALT4:
+ if (isalpha(c))
+ lexer->state = NMEA_LEADER_END;
+ else
+ lexer->state = GROUND_STATE;
+ break;
#if defined(TNT_ENABLE) || defined(GARMINTXT_ENABLE) || defined(ONCORE_ENABLE)
case AT1_LEADER:
switch (c) {