diff options
author | Christian Gagneraud <chgans@gna.org> | 2012-04-21 10:34:18 +0100 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2012-04-21 09:30:34 -0400 |
commit | 608546ca51443587a72c86224549d7b12078d07a (patch) | |
tree | c9f59d818b04457ebb5a757246a761ee3e4b2697 | |
parent | 9976cc4a356a759a1625e490161f107dcc560ade (diff) | |
download | gpsd-608546ca51443587a72c86224549d7b12078d07a.tar.gz |
Add new NMEA talker ID (WI, HC and TI)
WI: Weather instrument
HC: Heading, magnetic compass
TI: Turn rate indicator
Asssociated NMEA sentences:
WIMDA, WIMWD, WIMWV, WIVWR, WIVWT, TIROT, HCHDG, HCHDT
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
-rw-r--r-- | packet.c | 27 | ||||
-rw-r--r-- | packet_states.h | 3 |
2 files changed, 30 insertions, 0 deletions
@@ -95,6 +95,9 @@ PERMISSIONS * GN -- Mixed GPS and GLONASS data, according to IEIC 61162-1 * II -- Integrated Instrumentation (Raytheon's SeaTalk system). * IN -- Integrated Navigation (Garmin uses this). + * WI -- Weather instrument (Airmar PB200, Radio Ocean ROWIND, Vaisala WXT520). + * HC -- Heading/compass (Airmar PB200). + * TI -- Turn indicator (Airmar PB200). * EC -- Electronic Chart Display & Information System (ECDIS) * SD -- Depth Sounder * P -- Vendor-specific sentence @@ -324,6 +327,12 @@ static void nextstate(struct gps_packet_t *lexer, unsigned char c) lexer->state = NMEA_VENDOR_LEAD; else if (c == 'I') /* Seatalk */ lexer->state = SEATALK_LEAD_1; + else if (c == 'W') /* Weather instrument */ + lexer->state = WEATHER_LEAD_1; + else if (c == 'H') /* Heading/compass */ + lexer->state = HEADCOMP_LEAD_1; + else if (c == 'T') /* Turn indicator */ + lexer->state = TURN_LEAD_1; else if (c == 'A') /* SiRF Ack */ lexer->state = SIRF_ACK_LEAD_1; else if (c == 'E') /* ECDIS */ @@ -500,6 +509,24 @@ static void nextstate(struct gps_packet_t *lexer, unsigned char c) else lexer->state = GROUND_STATE; break; + case WEATHER_LEAD_1: + if (c == 'I') /* Weather instrument leader accepted */ + lexer->state = NMEA_LEADER_END; + else + lexer->state = GROUND_STATE; + break; + case HEADCOMP_LEAD_1: + if (c == 'C') /* Heading/compass leader accepted */ + lexer->state = NMEA_LEADER_END; + else + lexer->state = GROUND_STATE; + break; + case TURN_LEAD_1: + if (c == 'I') /* Turn indicator leader accepted */ + lexer->state = NMEA_LEADER_END; + else + lexer->state = GROUND_STATE; + break; case ECDIS_LEAD_1: if (c == 'C') /* ECDIS leader accepted */ lexer->state = NMEA_LEADER_END; diff --git a/packet_states.h b/packet_states.h index 79a134e8..454f815f 100644 --- a/packet_states.h +++ b/packet_states.h @@ -25,6 +25,9 @@ AIS_LEAD_2, /* seen I of possible marine AIS message */ SEATALK_LEAD_1, /* SeaTalk/Garmin packet leader 'I' */ + WEATHER_LEAD_1, /* Weather instrument packet leader 'W' */ + HEADCOMP_LEAD_1, /* Heading/compass packet leader 'H' */ + TURN_LEAD_1, /* Turn indicator packet leader 'T' */ ECDIS_LEAD_1, /* ECDIS packet leader 'E' */ SOUNDER_LEAD_1, /* Depth sounder packet leader 'S' */ #endif /* NMEA_ENABLE */ |