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

ZDA parse fails to parse sentence with the local hour and minutes not set #149

Open
minghia opened this issue Sep 1, 2024 · 2 comments
Open

Comments

@minghia
Copy link

minghia commented Sep 1, 2024

Our ZDA generator that we decode using marine-api, the getTime method fails with an exception and so any attempt to get the time represented by a sentence with the local hour and minute offset fields left empty fails.

@ktuukkan
Copy link
Owner

@minghia The parser indeed requires both time and offset to be present, based on the assumption that devices will report offset because otherwise it is rather unambiguous. But I guess marine-api could default to UTC-0 when not specified, although it might not be correct.

@minghia
Copy link
Author

minghia commented Sep 24, 2024

The NMEA 0183 document is vague in what fields are necessary. The general comment about leaving fields blank if they are not provided doesn't help either.

I don't know about commercial ships, but navy ships usually work in UTC time so I can see that the UTC offset fields could be empty. I'm of the opinion that if field is not present then the parsing shouldn't fail, but that is just my opinion.

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

2 participants