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

signed bytes in signal pdu #46

Open
HalRules opened this issue Mar 31, 2023 · 1 comment
Open

signed bytes in signal pdu #46

HalRules opened this issue Mar 31, 2023 · 1 comment

Comments

@HalRules
Copy link

I had issues properly reading data from a signal pdu, and tracked it down to code in the SignalPDu and VariableDatum classes.
Specifically, the write_byte method defaults to a signed byte. I was able to successfully use the library after changing instances of "write_byte" to "write_unsigned_byte" and "read_byte" to "read_byte_unsinged".

Specifically on lines:
3605,3609,3618,3623,7144,7160

I also modified line 7141 to "write_unsigned_short" and line 7157 to "read_unsigned_short"
The unsigned shorts were specifically required to get the proper value for larger data lengths.

I suspect all bytes should be unsigned, but have only tested those required for the signal pud.

@leif81
Copy link
Member

leif81 commented Apr 29, 2023

Thank-you @HalRules
Would you like to submit a pull request for the change?

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

No branches or pull requests

2 participants