aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/Tk103ProtocolDecoderTest.java3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
index 92febe756..a42f8703b 100644
--- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -33,6 +33,8 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
super(serverManager);
}
+ //(008600410203 BP05 000008600410203 130721 A4152.5790N01239.2770E000.0 145238 173.8 70100000A L 000000D8
+
static private Pattern pattern = Pattern.compile(
"(\\d{12})" + // Device ID
".{4}" + // Command
@@ -46,7 +48,7 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
"(\\d+\\.\\d)" + // Speed
"(\\d{2})(\\d{2})(\\d{2})" + // Time (HHMMSS)
"(\\d+\\.\\d+)" + // Course
- "(\\d{8})" + // State
+ "([0-9a-fA-F]{8})" + // State
"L([0-9a-fA-F]+)"); // Milage
@Override
diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
index 50ce21e6b..544091fd5 100644
--- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
@@ -28,6 +28,9 @@ public class Tk103ProtocolDecoderTest {
assertNotNull(decoder.decode(null, null,
"\n\n\n(088045133878BR00130228A5124.5526N00117.7152W000.0233614352.2200000000L01B0CF1C"));
+
+ assertNotNull(decoder.decode(null, null,
+ "(008600410203BP05000008600410203130721A4152.5790N01239.2770E000.0145238173.870100000AL0000000"));
}