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:
parent
afeeff5293
commit
fed5866f19
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user