summaryrefslogtreecommitdiff
path: root/ais_json.c
diff options
context:
space:
mode:
authorJon Schlueter <jschlueter@redhat.com>2015-10-06 03:26:00 -0400
committerJon Schlueter <jschlueter@redhat.com>2015-10-07 22:37:53 -0400
commit780c8a9c6bcdd1f8c904eaf28c11ceb317a0a2f7 (patch)
tree62a42c2509f5de6780379707ae07da14b846e148 /ais_json.c
parent51916a197a0a4d88938e1bf7dfa6136b0cc29bce (diff)
downloadgpsd-780c8a9c6bcdd1f8c904eaf28c11ceb317a0a2f7.tar.gz
AIS:refine parsing of type 8 DAC 1 FID 16 messages
- Type 8, DAC = 1 FID = 16: This should only be decoded as "Persons on board" if the message length is either 72 or 136 bits long (if even then). - Type 8, DAC = 1 FID = 16: If decoded, the json output should use the ais->type8.dac1fid16.persons field and not the type6 field Was not able to locate entry that had persons actually populated in AISHub sample data file added sample data that should not be decoded to sample.aivdm had to regenerate large sample file as it had multiple entries for this Identified by: Stefan Roels <sroels-gpsd-dev@42solutions.nl> type 8 dac 1 fid 16 can have either data or persons had to add logic to detect structured vs not structured for type 8 FID 16 messages
Diffstat (limited to 'ais_json.c')
-rw-r--r--ais_json.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ais_json.c b/ais_json.c
index 59cf0afa..8481e473 100644
--- a/ais_json.c
+++ b/ais_json.c
@@ -316,7 +316,9 @@ int json_ais_read(const char *buf,
}
else if (strstr(buf, "\"fid\":16,") != NULL) {
status = json_read_object(buf, json_ais8_fid16, endptr);
- structured = true;
+ if (status == 0) {
+ structured = true;
+ }
}
else if (strstr(buf, "\"fid\":17,") != NULL) {
status = json_read_object(buf, json_ais8_fid17, endptr);