diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2014-05-20 05:17:09 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2014-05-20 05:17:09 -0400 |
commit | 5b511d159c61adea1245b61704f751a3e6aa3006 (patch) | |
tree | 0b55bde4119b0fe191983222f893ef3a416e2d34 | |
parent | 4f35e720288bb67e918c065cebcb177b088e0e4f (diff) | |
download | gpsd-5b511d159c61adea1245b61704f751a3e6aa3006.tar.gz |
Support for some unusual NMEA 4.0 AIS talker IDs.
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | packet.c | 27 | ||||
-rw-r--r-- | packet_states.h | 10 | ||||
-rw-r--r-- | www/AIVDM.txt | 15 |
4 files changed, 40 insertions, 13 deletions
@@ -4,6 +4,7 @@ Repository head: A bug that prevented track interpolation has been fixed. We now get vertical error position and speed estimates from the u-blox driver rather than having to interpolate them. + Some unusual AIS talker IDs (NMEA 4.0 station classes) are supported. chrpath is no longer a dependency for building and testing, and now defaults to 'no'. @@ -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) { diff --git a/packet_states.h b/packet_states.h index 8077cbf1..28b8272f 100644 --- a/packet_states.h +++ b/packet_states.h @@ -21,10 +21,12 @@ SIRF_ACK_LEAD_1, /* seen A of possible SiRF Ack */ SIRF_ACK_LEAD_2, /* seen c of possible SiRF Ack */ - AIS_LEAD_1, /* seen A of possible marine AIS message */ - AIS_LEAD_2, /* seen I of possible marine AIS message */ - AIS_LEAD_ALT1, /* seen B of possible marine AIS message */ - AIS_LEAD_ALT2, /* seen S of possible marine AIS message */ + AIS_LEAD_1, /* seen initial A of possible AIS message */ + AIS_LEAD_2, /* seen second I/B/N/X of possible AIS message */ + AIS_LEAD_ALT1, /* seen initial B of possible AIS message */ + AIS_LEAD_ALT2, /* seen second S of possible AIS message */ + AIS_LEAD_ALT3, /* seen initial S of possible AIS message */ + AIS_LEAD_ALT4, /* seen second A of possible AIS message */ SEATALK_LEAD_1, /* SeaTalk/Garmin packet leader 'I' */ WEATHER_LEAD_1, /* Weather instrument packet leader 'W' */ diff --git a/www/AIVDM.txt b/www/AIVDM.txt index 7fa33e25..350f174e 100644 --- a/www/AIVDM.txt +++ b/www/AIVDM.txt @@ -237,16 +237,21 @@ nonempty message ID field: == Talker IDS == The AI prefix commonly found on these sentences is an NMEA talker ID -for a mobile AIS station. Other +for a mobile AIS station. Other possible values are as listed: .AIS talker IDs [width="25%",frame="topbot",options="header"] |================================================ -| !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 +| !AS | NMEA 4.0 Limited Base Station +| !AT | NMEA 4.0 AIS Transmitting Station | !AX | NMEA 4.0 Repeater AIS station +| !BS | Base AIS station (deprecated in NMEA 4.0) +| !SA | NMEA 4.0 Physical Shore AIS Station |================================================ == AIVDM/AIVDO Payload Armoring == @@ -5303,4 +5308,4 @@ waterways. Also Inland AIS standard messages are now covered. Version 1.44 adds substantial new information on MMSIs and updates the <<MMSI link>>, which was stale. -Version 1.45 adds a description of AIS talker IDs. +Version 1.45 adds a description of variant AIS talker IDs. |