fairecasoimeme / ZiGate

Zigate is an Universal Zigbee Gateway
http://zigate.fr
171 stars 59 forks source link

Fix 24 bits types handling #290

Closed badzz closed 4 years ago

badzz commented 4 years ago

It is stored in a 32 bits C type but we copy into a 32 bits array for sending which is wrong. Code is changed to copy into 24bits structure Further fixing would include sending back a shorter length as the function sends back 4 bytes length instead of 3 bytes. I suspect the other structure like 40bits and 56bits have the same issue Orignal issue was that when sending 0x123456 was ending up as 0x345600 on the zigbee sniffer

fairecasoimeme commented 4 years ago

ok great ! 👍 Fred