summaryrefslogtreecommitdiff
path: root/driver_ais.c
diff options
context:
space:
mode:
authorJon Schlueter <jschlueter@redhat.com>2016-01-05 00:05:34 -0500
committerJon Schlueter <jschlueter@redhat.com>2016-01-05 02:09:34 -0500
commitdb5a1d5c9d23ce0e3ff8eab219c91ff425def344 (patch)
treee7b3a27db8dc06d661592ba15d370377a586ed1e /driver_ais.c
parent39d128cc124bfe0f85b1d7752bbf3fcefce7c425 (diff)
downloadgpsd-db5a1d5c9d23ce0e3ff8eab219c91ff425def344.tar.gz
[aivdm] Expand driver type 16 to handle 168 bits
Found a live sample that was not handled right by the ais driver for type=16 max size had to be increased to 168 bits from 144 this looks sane as the samples of this type of message as follows shows that the increment1, mmsi2, offset2, and increment2 have a value. It also matches results from http://www.aggsoft.com/ais-decoder.htm test/sample.aivdm.js.chk 42:{"class":"AIS","device":"stdin","type":16,"repeat":0,"mmsi":2053501,"scaled":true,"mmsi1":224251000,"offset1":200,"increment1":0,"mmsi2":0,"offset2":0,"increment2":0} 92:{"class":"AIS","device":"stdin","type":16,"repeat":0,"mmsi":439952844,"scaled":true,"mmsi1":315920,"offset1":2049,"increment1":681,"mmsi2":230137673,"offset2":424,"increment2":419}
Diffstat (limited to 'driver_ais.c')
-rw-r--r--driver_ais.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver_ais.c b/driver_ais.c
index cbeb3700..80c0c888 100644
--- a/driver_ais.c
+++ b/driver_ais.c
@@ -809,7 +809,7 @@ bool ais_binary_decode(const struct gpsd_errout_t *errout,
}
break;
case 16: /* Assigned Mode Command */
- RANGE_CHECK(96, 144);
+ RANGE_CHECK(96, 168);
ais->type16.mmsi1 = UBITS(40, 30);
ais->type16.offset1 = UBITS(70, 12);
ais->type16.increment1 = UBITS(82, 10);