ruuvi-sensor-protocols
ruuvi-sensor-protocols copied to clipboard
Clarify MSB / LSB for RAWv2
Implementing RAWv2 is made a bit more complicated by not specifying whether the 16-bit values are most-significant-bit or least-significant-bit.
For that matter, it'd help if the data field descriptions referred to the bytes in the input data rather than just 0x01c3
being +2.255ºC, for example.
So, maybe some code such as ( buf[1] << 8 | buf[2] ) * 0.005 * ( buf[1] > 0x7f ? -1 : 1 )
For the split battery data, the clarification of "13th byte and three most-significant bits of 14th byte", and/or some code as above would be useful.
The values can be deduced by working through the Test Vectors later on in the document, but it's not as simple as it could be.
Thanks for the feedback, I'll clarify these points
Reopening as a reminder to add links to decoder
@ojousima maybe time to recluse this?