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

fix: increase sub message hour field length #135

Merged
merged 1 commit into from
May 9, 2024

Conversation

prefixFelix
Copy link
Contributor

The length of the UTC hour and minute field of the sub message must be increased from 4 bits to 5 bits, otherwise an incorrect time will be output. This is always the case if the hour of a message is greater than 15. An example:

decoded = pyais.decode('!AIVDM,1,1,,B,133ga6PP0lPPE>4M3G@DpOwTR61p,0*33')
com = decoded.get_communication_state()
print(f"Time: {com['utc_hour']}:{com['utc_minute']}")
# Outputs: Time: 0:30

The actual output should be 16:30. This can also be cross-checked with online AIS decoders such as the Maritec one.

@M0r13n M0r13n merged commit b338dc3 into M0r13n:master May 9, 2024
@M0r13n
Copy link
Owner

M0r13n commented May 9, 2024

@prefixFelix That looks correct. Good catch!

@prefixFelix
Copy link
Contributor Author

No problem. Thanks for the great project! It saved me a lot of time and hassle on my own project.

@M0r13n
Copy link
Owner

M0r13n commented May 9, 2024

@prefixFelix That is nice to hear. Thank you!

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

Successfully merging this pull request may close these issues.

2 participants