ruuvi-sensor-protocols icon indicating copy to clipboard operation
ruuvi-sensor-protocols copied to clipboard

Clarify MSB / LSB for RAWv2

Open tomgidden opened this issue 5 years ago • 3 comments

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.

tomgidden avatar Nov 09 '19 19:11 tomgidden

Thanks for the feedback, I'll clarify these points

ojousima avatar Nov 12 '19 08:11 ojousima

Reopening as a reminder to add links to decoder

ojousima avatar Dec 29 '19 09:12 ojousima

@ojousima maybe time to recluse this?

DG12 avatar Oct 23 '21 17:10 DG12