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

Wrong Value in turn field (AIS1-3) ? #39

Closed
yves84 opened this issue Nov 11, 2021 · 1 comment
Closed

Wrong Value in turn field (AIS1-3) ? #39

yves84 opened this issue Nov 11, 2021 · 1 comment

Comments

@yves84
Copy link

yves84 commented Nov 11, 2021

Hi,

Here an output from an ais msg:

{'type': 1, 'repeat': 0, 'mmsi': 'XXXXXX', 'status': <NavigationStatus.Undefined: 15>, 'turn': -128, 'speed': 0.1, 'accuracy': 1, 'lon': 4.303693333333333, 'lat': 51.270986666666666, 'course': 360.0, 'heading': 511, 'second': 55, 'maneuver': <ManeuverIndicator.NotAvailable: 0>, 'raim': 1, 'radio': 82243}

The "turn"-Field with -128 is not correct i think. A value of 128 (positiv) is the value for "no information" and it is not possible to save -128 with 8 bits (singed int -127 - 128).

Ty & Gz!

@yves84
Copy link
Author

yves84 commented Nov 11, 2021

I'm sorry. Was my mistake. The range is -128:127.

In https://gpsd.gitlab.io/gpsd/AIVDM.html#_types_1_2_and_3_position_report_class_a

128 (80 hex) indicates no turn information available (default)

there compare the "raw" value 0x80 -> -128 (But write only 128). I was confusing...

@yves84 yves84 closed this as completed Nov 11, 2021
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

1 participant