You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for Data looks like this is the correct format, and it's working when using SetUnsignedBitsLittleEndian (with byte order properly reversed).
However, the results I get passing the uint16 value come back with strange values in frame.Data.
Right now I can work around this by creating my own byte array, converting, then copying into frame.Data:
This works for some straight forward applications, but I saw all the error checking you've included in the Data type functions I'd to take advantage of. I looked for some more expanded examples, but didn't find anything to help me better understand the content of creating and sending frames from data in a big endian way.
The text was updated successfully, but these errors were encountered:
The issue you're facing is due to the fact that the library uses consistent bit numbering. That means when using big endian byte order, the most significant bit in a byte will be bit 0 (the leftmost bit), and when using little endian byte order, the most significant bit will be bit 7 (the rightmost bit).
I'm thinking about adding an option to set default bit numbering when using the library, because signals can be specified differently in different database formats.
Hi,
I'm looking to create a Frame with
uint16
values converted to big endian, e.g., the value of 256 represented in the CAN data as (hex):01 00
.I've looked at doing this via:
Incorrect Result:
vcan0 0D0 [2] 00 02
The documentation for Data looks like this is the correct format, and it's working when using
SetUnsignedBitsLittleEndian
(with byte order properly reversed).However, the results I get passing the uint16 value come back with strange values in
frame.Data
.Right now I can work around this by creating my own byte array, converting, then copying into
frame.Data
:Correct Result:
vcan0 0D0 [2] 01 00
This works for some straight forward applications, but I saw all the error checking you've included in the
Data
type functions I'd to take advantage of. I looked for some more expanded examples, but didn't find anything to help me better understand the content of creating and sending frames from data in a big endian way.The text was updated successfully, but these errors were encountered: