aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-10-26 10:25:47 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-10-26 10:25:54 -0700
commit1f6f8631c6d0a76e7333e59c2f8dc1497f1f5e7b (patch)
treeafb56d33c34c5896fa7e1f82fa85658091705095 /src/main
parent8b65c5d87c25e572a31e65df0fac49926381da6c (diff)
downloadtraccar-server-1f6f8631c6d0a76e7333e59c2f8dc1497f1f5e7b.tar.gz
traccar-server-1f6f8631c6d0a76e7333e59c2f8dc1497f1f5e7b.tar.bz2
traccar-server-1f6f8631c6d0a76e7333e59c2f8dc1497f1f5e7b.zip
Extract battery from status field
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java4
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