aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-07-11 14:56:32 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-07-11 14:56:32 -0700
commitfe45c5bbe8816db9b1ecc8f03267fe388dcec8ab (patch)
treef2ec457567002884b1a61e537e5a9e8e7bd5f4c3
parent1d3cd09b327535388d78297c0f6a249a66331cea (diff)
downloadtrackermap-server-fe45c5bbe8816db9b1ecc8f03267fe388dcec8ab.tar.gz
trackermap-server-fe45c5bbe8816db9b1ecc8f03267fe388dcec8ab.tar.bz2
trackermap-server-fe45c5bbe8816db9b1ecc8f03267fe388dcec8ab.zip
Add missing alarm
-rw-r--r--src/main/java/org/traccar/protocol/WatchProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/WatchProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java b/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
index 5ff0bbb6c..564acd7b4 100644
--- a/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
@@ -101,7 +101,7 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder {
return Position.ALARM_GEOFENCE_ENTER;
} else if (BitUtil.check(status, 20)) {
return Position.ALARM_REMOVING;
- } else if (BitUtil.check(status, 21)) {
+ } else if (BitUtil.check(status, 21) || BitUtil.check(status, 22)) {
return Position.ALARM_FALL_DOWN;
}
return null;
diff --git a/src/test/java/org/traccar/protocol/WatchProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/WatchProtocolDecoderTest.java
index ddfc8e619..73b97d1b4 100644
--- a/src/test/java/org/traccar/protocol/WatchProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/WatchProtocolDecoderTest.java
@@ -16,6 +16,9 @@ public class WatchProtocolDecoderTest extends ProtocolTest {
var decoder = new WatchProtocolDecoder(null);
verifyPosition(decoder, buffer(
+ "[3G*2104326058*00E9*UD_LTE,300621,135101,A,32.162652,N,34.888748,E,30.84,265.158,65.621,18,100,83,0,0,00000000,1,1,425,01,10223,8012811,100,3,ES4104,22:74:1d:39:64:ff,-46,metropoline-wifi,a8:3f:a1:e0:66:ba,-89,Egged.co.il,00:0c:42:51:cf:cd,-81,1.7055488]"));
+
+ verifyPosition(decoder, buffer(
"[3G*358839237678820*0122*ALCUSTOMER1,251120,081821,V,0.0,N,0.0,E,2.58,317.462,35.147,14,100,2,11089,0,00100008,1,1,460,01,42308,101992452,100,5,shizhou1,44:56:e2:03:ea:2a,-69,FART3,30:0d:9e:bb:fa:4d,-70,ZKY-A209,88:c3:97:c1:f4:7f,-73,ChinaNet-HNeD,e8:84:c6:21:7c:dc,-77,,30:45:96:10:14:5d,-79,1.2035439]"));
verifyPosition(decoder, buffer(