marine-api icon indicating copy to clipboard operation
marine-api copied to clipboard

Make AIS length validation less restricted

Open qtran opened this issue 4 years ago • 3 comments

Hi, would it be possible to make the AIS length validation less restricted or configurable? Due to tests with different AIS sources we noticed that sometimes that it is required to increase the maximum length.

Best regards

qtran avatar Sep 04 '20 08:09 qtran

Hi @qtran, could you give some example cases?

ktuukkan avatar Nov 17 '20 07:11 ktuukkan

I faced this problem too.

Seems that it hardcoded: As example in AISPositionReportParser.java: if (content.length() != 168) throw new IllegalArgumentException("Wrong message length");

RiseOfDeath avatar Nov 21 '22 18:11 RiseOfDeath

Please provide more context and sample data - or preferrably a pull-request proposing a fix.

Regarding the hard-coded value, it is according the AIS specification where the length of both A and B reports is 168:

Screenshot from 2022-11-29 12-38-16

ktuukkan avatar Nov 29 '22 10:11 ktuukkan