aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-08-09 16:57:18 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-08-09 16:57:18 +1200
commit75d033f9eca3d6dae808fa5bc9a1c18266e3284a (patch)
tree60e67758bb57d5acd169c28555929f5ec45a4e51
parent8688f8f609c5bb2c42058a4e73047165bba78097 (diff)
downloadtrackermap-server-75d033f9eca3d6dae808fa5bc9a1c18266e3284a.tar.gz
trackermap-server-75d033f9eca3d6dae808fa5bc9a1c18266e3284a.tar.bz2
trackermap-server-75d033f9eca3d6dae808fa5bc9a1c18266e3284a.zip
Update TK103 protocol decoder
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/Tk103ProtocolDecoderTest.java6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
index e884f4be2..5cbde4b7e 100644
--- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -47,7 +47,7 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
"(\\d{2})(\\d{2})(\\d{2}),?" + // Time (HHMMSS)
"(\\d+\\.?\\d+),?" + // Course
"([0-9a-fA-F]{8})?,?" + // State
- "(?:L([0-9a-fA-F]+))?\\)?"); // Odometer
+ "(?:L([0-9a-fA-F]+))?.*\\)?"); // Odometer
@Override
protected Object decode(
diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
index 3921ad6b0..ca5c550c7 100644
--- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
@@ -1,9 +1,8 @@
package org.traccar.protocol;
-import org.traccar.helper.TestIdentityManager;
-import static org.traccar.helper.DecoderVerifier.verify;
import static org.junit.Assert.assertNull;
import org.junit.Test;
+import static org.traccar.helper.DecoderVerifier.verify;
public class Tk103ProtocolDecoderTest extends ProtocolDecoderTest {
@@ -77,6 +76,9 @@ public class Tk103ProtocolDecoderTest extends ProtocolDecoderTest {
assertNull(decoder.decode(null, null,
"(013632651491,ZC20,040613,040137,6,42,112,0)"));
+ verify(decoder.decode(null, null,
+ "(094050000111BP05000094050000111150808A3804.2418N04616.7468E000.0201447133.3501000011L0028019DT000)"));
+
}
}