diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-10-26 10:25:47 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-10-26 10:25:54 -0700 |
commit | 1f6f8631c6d0a76e7333e59c2f8dc1497f1f5e7b (patch) | |
tree | afb56d33c34c5896fa7e1f82fa85658091705095 /src/main/java/org | |
parent | 8b65c5d87c25e572a31e65df0fac49926381da6c (diff) | |
download | traccar-server-1f6f8631c6d0a76e7333e59c2f8dc1497f1f5e7b.tar.gz traccar-server-1f6f8631c6d0a76e7333e59c2f8dc1497f1f5e7b.tar.bz2 traccar-server-1f6f8631c6d0a76e7333e59c2f8dc1497f1f5e7b.zip |
Extract battery from status field
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java | 4 |
1 files changed, 3 insertions, 1 deletions
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 |