tbsalling / aismessages

AISmessages is a Java-based light-weight, zero-dependency, and ultra-efficient message decoder for maritime navigation and safety messages compliant with ITU 1371 (NMEA armoured AIS messages). A live demo of AISmessages is available on http://ais.tbsalling.dk.
https://github.com/tbsalling/aismessages/wiki
Other
156 stars 66 forks source link

Decoding of pseudo-valid AIS messages in the wild / AIS type 24 with 158 bits #11

Closed yipeng closed 9 years ago

yipeng commented 9 years ago

Hi Thomas,

I've observed many instances of class B static messages that are made up for only 158 bits. I want to decode these messages because they are transmitting their ship names but just not according to ?spec?. My changes affect the getBits method in AISMessage which may too general but will only affect the decoding of pseudo-valid length messages anyway. Another solution is to override it in ClassBCSStaticDataReport. If you are interested, I would be happy to do that.

Cheers,

Yipeng

tbsalling commented 9 years ago

Hi Yipeng - thank you for the contribution! - I'll have a closer look and then get back to you. Do you have any samples of the 158-bit messages that I can see?

yipeng commented 9 years ago

I'll drop you a mail.

yipeng commented 9 years ago

Hi Thomas,

The same handling can be used to handle type 5 messages more robustly. Unlike the type 24, short variants of type 5 are more common and known, i.e. from ESR, "note that it is fairly common in the wild for this message to have a wrong bit length (420 or 422)." -- http://catb.org/gpsd/AIVDM.html#_type_5_static_and_voyage_related_data

Cheers,

Yipeng