You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…va#L130 is incorrect as it only copies some of the fields. The temperature, battery, light, events and number of samples are left as the default 0 value".
Thanks for the bug report -- the battery conversion has now been fixed. The Java code has not been used very heavily before, so this issue had gone unnoticed.
The battery level is stored as an unsigned byte in index 23 in the data packet. However, in the Java code, this is read as a signed byte before upcasting to a short (https://github.com/digitalinteraction/openmovement/blob/master/Software/AX3/cwa-convert/java/src/newcastle/cwa/CwaBlock.java#L203). Therefore for battery levels about 127 they wrap-round to -128 giving a negative battery voltage.
The text was updated successfully, but these errors were encountered: