From 1f6f8631c6d0a76e7333e59c2f8dc1497f1f5e7b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 26 Oct 2019 10:25:47 -0700 Subject: Extract battery from status field --- src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/traccar') diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java index 3f8b2d4fe..b6f257d2c 100644 --- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java @@ -156,7 +156,9 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder { break; case 0x24: position.setTime(new Date(buf.readUnsignedIntLE() * 1000)); - position.set(Position.KEY_STATUS, buf.readUnsignedIntLE()); + long status = buf.readUnsignedIntLE(); + position.set(Position.KEY_BATTERY_LEVEL, BitUtil.from(status, 24)); + position.set(Position.KEY_STATUS, status); break; case 0x40: buf.readUnsignedIntLE(); // timestamp -- cgit v1.2.3