libais
libais copied to clipboard
Handle Type 24 short messages
Per Eric Raymond's AIVDM guide, Type 24 Part A messages in the wild often omit the trailing spare bits. This results in an AIS_ERR_BAD_BIT_COUNT thrown from Ais24. It would be nice if the library could handle the (admittedly non-spec) short Type 24 messages.
Sample captured message:
!AIVDM,1,1,,A,H5NbKPQ8Dh5@UHUAW8000000000,0*0A
Sample output:
>>> ais.decode('H5NbKPQ8Dh5@UHUAW8000000000',0)
Traceback (most recent call last):
File "", line 1, in
_ais.DecodeError: Ais24: AIS_ERR_BAD_BIT_COUNT
>>> ais.decode('H5NbKPQ8Dh5@UHUAW80000000000',0)
{u'mmsi': 367696770L, u'repeat_indicator': 0L, u'id': 24L, u'name': u'RELATIVITY2@@@@@@@@@', u'part_num': 0L}
I would also like to see these messages handled, as they comprise almost all type 24 messages I receive.