-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Make command encoder/decoder work regardless of hardware endianness #1632
Comments
FYI - here are the changes I had made (rather rushed) to make the chip demo device run on a big-endian architecture:
|
|
@pan-apple ^^^ |
Yes, it's using I suspect the patch above is from an older code baseline, where we were still using an 8 byte IV. Now it's 12 bytes. |
copy. |
Problem
The code that #1609 adds to
src/app/chip-zcl-zpro/command-encoder/
copies non-single-byte ints to/from network buffers basically by usingmemcpy
. This will not work if the sender and recipient hardware have different endianness.Proposed Solution
Pick an endianness (little-endian, presumably, since that's what ZCL already does anyway as far as I can tell) and ensure that the wire format is that endianness, with byte-swapping during encode/decode as needed.
@bhaskar-apple @rwalker-apple
The text was updated successfully, but these errors were encountered: