From ddcc52b5541ed662ecb8399a364a3eb5b6234a32 Mon Sep 17 00:00:00 2001 From: Jon Schlueter Date: Wed, 7 Oct 2015 21:29:30 -0400 Subject: AIS: Add better handling of non byte aligned data blobs I ran into a problem with the type 8 unstructured data. When the number of bits available is not dividable by 8, the last byte may contain random bits. I would expect the bits beyond the valid range to be 0. An example of this can be found in the following message: !AIVDM,3,1,4,A,85PH6TAKfDOkp95`nCRt5w<:qFUiaihFhBc7s4AHGsQ,0*40 !AIVDM,3,2,4,A,DcMJM18k6<=m7rwVm3b5RRWEskwJWej8uP<0:W5K6PA,0*61 !AIVDM,3,3,4,A,gPs Added new sample entry to sample.aivdm that exercises this case Had to regenerate large ais test data log --- test/sample.aivdm.chk | 1 + 1 file changed, 1 insertion(+) (limited to 'test/sample.aivdm.chk') diff --git a/test/sample.aivdm.chk b/test/sample.aivdm.chk index 0b514723..bee2d762 100644 --- a/test/sample.aivdm.chk +++ b/test/sample.aivdm.chk @@ -85,3 +85,4 @@ 8|1|002300059|1|11|1325788|3622678|20T18:28Z|12|14|92|84|586|90|1023|228|2|255|511|3|255|511|255|511|31|255|511|31|255|63|511|255|63|511|15|1023|7|511|3 8|0|002766080|1|11|1382800|3532000|20T18:30Z|0|0|0|0|0|0|0|0|0|0|0|0|255|0|0|0|0|0|0|0|0|3|0|0|0|0|0|1|0|0|0 6|0|002053507|2|244670500|0|200|3|16:3200 +8|0|366999607|366|57|510:7ffdef068fbded3c0a1943dfb997b4a10fadec21e6e0a6608f0f44b686a8747ff71e595dcb5ec5b4e05221d886233d2e4916f6eb6fe8ecd38d69792816f3a2d0 -- cgit v1.2.1