diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-03-05 07:06:12 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-03-05 07:06:12 +0000 |
commit | 5abb1dc1572a2c02ea002db0d24d06005f1ee499 (patch) | |
tree | 656c484fb7033c026be3e07807b21a1b1b250950 /gpsdecode.c | |
parent | ae0b8eb0a3bd9bbaad56b8bd6d3e38784ae09787 (diff) | |
download | gpsd-5abb1dc1572a2c02ea002db0d24d06005f1ee499.tar.gz |
Support for JSON dumping and parsing of AIS message types 25 and 26.
These are not yet observed in the wild on AISHub.
Diffstat (limited to 'gpsdecode.c')
-rw-r--r-- | gpsdecode.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gpsdecode.c b/gpsdecode.c index 37cf6db2..7ac3bca5 100644 --- a/gpsdecode.c +++ b/gpsdecode.c @@ -341,6 +341,29 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) ais->type24.dim.to_starboard); } break; + case 25: /* Binary Message, Single Slot */ + (void)snprintf(buf+strlen(buf), buflen-strlen(buf), + "%u,%u,%u,%u,%zd:%s\r\n", + (uint)ais->type25.addressed, + (uint)ais->type25.structured, + ais->type25.dest_mmsi, + ais->type25.app_id, + ais->type25.bitcount, + gpsd_hexdump(ais->type25.bitdata, + (ais->type25.bitcount+7)/8)); + break; + case 26: /* Binary Message, Multiple Slot */ + (void)snprintf(buf+strlen(buf), buflen-strlen(buf), + "%u,%u,%u,%u,%zd:%s:%u\r\n", + (uint)ais->type26.addressed, + (uint)ais->type26.structured, + ais->type26.dest_mmsi, + ais->type26.app_id, + ais->type26.bitcount, + gpsd_hexdump(ais->type26.bitdata, + (ais->type26.bitcount+7)/8), + ais->type26.radio); + break; default: (void)snprintf(buf+strlen(buf), buflen-strlen(buf), "unknown AIVDM message content."); |