From 8d2df830d61243333d6785e179caa80592f1e970 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 27 Nov 2020 21:54:59 -0800 Subject: Support KS01 4G protocol --- 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 c5431be8d..d060826cf 100644 --- a/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java @@ -249,7 +249,7 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { } } - } else if (type.startsWith("UD") || type.equals("AL") || type.equals("WT")) { + } else if (type.startsWith("UD") || type.startsWith("AL") || type.startsWith("WT")) { Position position = decodePosition(deviceSession, buf.toString(StandardCharsets.US_ASCII)); diff --git a/src/test/java/org/traccar/protocol/WatchProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/WatchProtocolDecoderTest.java index 4625e0eb4..260a1ff8d 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 { WatchProtocolDecoder decoder = new WatchProtocolDecoder(null); + 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( "[3G*0304187088*0100*UD_WCDMA,100720,094202,V,0.0,N,0.0,E,22.0,0,-1,21,75,92,0,0,00000000,1,1,425,01,10192,1282125,75,5,Inet,04:f0:21:46:1f:57,-54,iNetSecurity,00:1e:42:25:2f:3e,-71,Gilad,58:d5:6e:9d:1b:af,-80,weekend,14:ae:db:cb:99:25,-82,advancemed1,04:f0:21:4c:c8:3e,-89,0.0]")); -- cgit v1.2.3