1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-26 02:25:50 +01:00

Binary sensor: fixed byte overflow bug

This commit is contained in:
Daniel Dakhno 2022-12-27 19:45:44 +01:00
parent afeeff5293
commit fed5866f19

View File

@ -21,7 +21,7 @@ public class SensorState extends Parameter{
}
public static SensorState decode(byte[] data){
int dataInt = (data[1] << 8) | data[0];
int dataInt = ((data[1] & 0xFF) << 8) | (data[0] & 0xFF);
byte stateByte = (byte)((dataInt >> 11) & 0x01);
int count = dataInt & 0b11111111111;
return new SensorState(