-
Notifications
You must be signed in to change notification settings - Fork 99
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
Question, what is the SECOND argument in ais.decode() #208
Comments
IIRC it does represent the padding of the message. Type 1,2,3 Messages are 168 bit long. Because of the encoding, 6 bit are encoded into one char. You will get exactly 28 characters and have 0 bit padding. The description says: You have to handle multi-line messages and padding yourself. |
"The description says: You have to handle multi-line messages and padding yourself." Do you happen to have code that does this? I'm not super familiar with the concept of padding. I am currently working on code that can put together the encoded strings of a multiline message. Knowing NOTHING, I guessed the second argument there would be a 0 for single line messages and a 2 or 3 for multi line - depending on the number of lines. However, reading your response, I'm wrong. I have invested a ton of time in leveraging this library even though it isn't getting active work. I'm hoping not to have to rip and replace. Any ideas or suggestions on handing multi-line. Answer like I was 5 years old :p |
First of all, if you read from a NMEA-stream, you can try out the high-level iterator interface shown in the description. Normally, the first parts of the multiline-messages have 0 bit padding (to use all the available space) and the padding of the last part can be extracted from the NMEA message. Sorry, i have no working code right now, but here are some resources on the message structure: |
Thank you for answering, hoping that this can be mentioned explicitly as it is pretty vague that AIS messages contain information regarding the padding and that it is this padding the second argument in the function represents. Documenting all the input variables in function should be pretty standard. |
This ais library requires you to first check if the message is part of a two-part message, I've listed part of my implementation below:
|
I was able to use code that does concatenate the group tags. Further, I replaced this library with another as there were other issues with this specific library. I'm now able to decode the group messages |
Sorry if this is obvious for those well versed in ais . . . What do the 0 and 2 represent below?
ais.decode('402u=TiuaA000r5UJ
H4?7000S:', 0) ais.decode('55NBjP01mtGIL@CW;SM<D60P5Ld000000000000P0
<3557l0<50@kk@K5h@00000000000', 2)`The text was updated successfully, but these errors were encountered: