aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-10-14 06:29:45 -0700
committerAnton Tananaev <anton@traccar.org>2022-10-14 06:29:45 -0700
commit85cef19d557b3aa0e306c3efe0bdcf8020042775 (patch)
tree1a9ce823a28dab97a06ffad69ee2399dbedec115 /src/main/java
parent47579ba635ad87af13f9626923e0168ff53e5178 (diff)
downloadtrackermap-server-85cef19d557b3aa0e306c3efe0bdcf8020042775.tar.gz
trackermap-server-85cef19d557b3aa0e306c3efe0bdcf8020042775.tar.bz2
trackermap-server-85cef19d557b3aa0e306c3efe0bdcf8020042775.zip
MiniFinder Rex bark alarm
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
index 228578571..bec05ffc2 100644
--- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
@@ -50,7 +50,7 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder {
public static final int MSG_SERVICES = 0x03;
public static final int MSG_RESPONSE = 0x7F;
- private String decodeAlarm(int code) {
+ private String decodeAlarm(long code) {
if (BitUtil.check(code, 0)) {
return Position.ALARM_LOW_BATTERY;
}
@@ -181,7 +181,11 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder {
position.setDeviceId(deviceSession.getDeviceId());
break;
case 0x02:
- position.set(Position.KEY_ALARM, decodeAlarm(buf.readIntLE()));
+ long alarm = buf.readUnsignedIntLE();
+ position.set(Position.KEY_ALARM, decodeAlarm(alarm));
+ if (BitUtil.check(alarm, 31)) {
+ position.set("bark", true);
+ }
break;
case 0x14:
position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte());