aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-06-20 08:35:49 -0700
committerAnton Tananaev <anton@traccar.org>2023-06-20 08:35:49 -0700
commita2c35b1c98a56d07924f955bb6d4172f27623816 (patch)
tree510cc6f5b0434569fb649f263304b4265885e275
parentba8191373d55d6115427ef7187b8f2d0650a5ec5 (diff)
downloadtrackermap-server-a2c35b1c98a56d07924f955bb6d4172f27623816.tar.gz
trackermap-server-a2c35b1c98a56d07924f955bb6d4172f27623816.tar.bz2
trackermap-server-a2c35b1c98a56d07924f955bb6d4172f27623816.zip
Decode Eview status bits
-rw-r--r--src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
index f660f2e92..f8b0c34e9 100644
--- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
@@ -239,6 +239,14 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder {
case 0x24:
position.setTime(new Date(buf.readUnsignedIntLE() * 1000));
long status = buf.readUnsignedIntLE();
+ if (BitUtil.check(status, 4)) {
+ position.set(Position.KEY_CHARGE, true);
+ }
+ if (BitUtil.check(status, 7)) {
+ position.set(Position.KEY_ARCHIVE, true);
+ }
+ position.set(Position.KEY_MOTION, BitUtil.check(status, 9));
+ position.set(Position.KEY_RSSI, BitUtil.between(status, 19, 24));
position.set(Position.KEY_BATTERY_LEVEL, BitUtil.from(status, 24));
position.set(Position.KEY_STATUS, status);
break;