Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] Messages without channel code not supported #2

Open
glimmerveen opened this issue Aug 10, 2011 · 3 comments
Open

[Java] Messages without channel code not supported #2

glimmerveen opened this issue Aug 10, 2011 · 3 comments

Comments

@glimmerveen
Copy link

The current version of the Vdm.add(String) method does not allow messages with no channel code set. If such message is being parsed, it throws a StringIndexOutOfBoundsException.

Is this an issue in the Vdm class or should a valid message always contain a channel code?

@bcl
Copy link
Owner

bcl commented Mar 13, 2019

It should gracefully handle not having a channel code, as long as the checksum matches it should parse it.
Maybe use 'U' for unknown channel?

@eironside
Copy link

Given the following two sentences, it looks like sentence 1 and 2 of a 2 part message with sequential ID of 4. But should they be combined if the channel doesn't match?? Does the channel have to match if it is given?

!BSVDM,2,1,4,A,53@oJeH00001Q2oCC30pK7KV0`4ppF220000000N0P82240Ht520C4p8,0*5D
!BSVDM,2,2,4,B,00000000000,2*3A

@bcl
Copy link
Owner

bcl commented Mar 6, 2021

No, they should not be combined. AIS doesn't split messages between channels.

When feeding messages to the parser they need to be from the same channel and sequence, and in order. I just looked at the C and Java code (for the first time in a long while) and it looks like there is a bug in the Java code. It doesn't check the channel to make sure it matches the existing sequence. I've opened issue #37 for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants