diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-03-09 18:37:19 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-03-09 18:37:19 +0000 |
commit | 4996fc1cfdf2510d6d9063a30516bcf5ef4f9a8b (patch) | |
tree | 8152e2d59e9eb526f4575da2599f582f24530847 /packet.c | |
parent | f309aecdd914e578a0e64ffc700c9cd20cb726f0 (diff) | |
download | gpsd-4996fc1cfdf2510d6d9063a30516bcf5ef4f9a8b.tar.gz |
The shell of an AIVDM driver.
This gets packets and delivers them to a stub analyzer, fields parsed
out and checksum verified.
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -961,9 +961,14 @@ void packet_parse(struct gps_packet_t *lexer) checksum_ok = (csum[0]==toupper(trailer[1]) && csum[1]==toupper(trailer[2])); } - if (checksum_ok) - packet_accept(lexer, NMEA_PACKET); - else + if (checksum_ok) { +#ifdef AIVDM_ENABLE + if (strncmp((char *)lexer->inbuffer, "!AIVDM", 6) == 0) + packet_accept(lexer, AIVDM_PACKET); + else +#endif /* AIVDM_ENABLE */ + packet_accept(lexer, NMEA_PACKET); + } else lexer->state = GROUND_STATE; packet_discard(lexer); break; |