-
Notifications
You must be signed in to change notification settings - Fork 129
Problem with Thermometer #89
Comments
Here's what I'm doing: Lines 237 to 262 in 785012e
|
Upon further investigation, it seems like your logic is correct. This works out to be:
On the reading end, if we look at the raw bytes (byte 3,4), we get: It appears that maybe 'setValue(mantissa, exponent" is not working correctly. |
Some more info:
bytesToFloat(mValue[offset], mValue[offset + 1], mValue[offset + 2], mValue[offset + 3]); Maybe this is old code. |
I know this is an old issue, just commenting for future reference. It seems that BLE uses IEEE 11073 encoded floating numbers, which are based on base-10. So there are 8bits assigned to the exponent and 24bits assigned to the mantissa. No sign bit, as usual; the mantissa is instead signed. |
It appears the logic for the Temperature may be off.
I think the bits for the Centigrade values may need to be shifted by one more:
C Value: Byte 3,4 actual, Byte 3,4 expect
1: Actual 0, 7f, Expect 80, 3f
2: Actual 0, 80, Expect 00, 40
3: Actual 40, 80 , Expect 40, 40
The text was updated successfully, but these errors were encountered: