From fe45c5bbe8816db9b1ecc8f03267fe388dcec8ab Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 11 Jul 2021 14:56:32 -0700 Subject: Add missing alarm --- src/main/java/org/traccar/protocol/WatchProtocolDecoder.java | 2 +- src/test/java/org/traccar/protocol/WatchProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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 @@ -15,6 +15,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]")); -- cgit v1.2.3