aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-08-02 01:26:23 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-08-02 01:26:23 +1200
commit42cc50d51a5eda8f8de787a3230b8591b62d62b8 (patch)
tree6c237cb731b0aed4216dccf2952911b8782002e3
parentba7ae0c0b49b61805d21df6b64df9d013c396176 (diff)
downloadtrackermap-server-42cc50d51a5eda8f8de787a3230b8591b62d62b8.tar.gz
trackermap-server-42cc50d51a5eda8f8de787a3230b8591b62d62b8.tar.bz2
trackermap-server-42cc50d51a5eda8f8de787a3230b8591b62d62b8.zip
Fix TK103 course regex pattern
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/Tk103ProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
index fd208d526..2bcd62407 100644
--- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -54,7 +54,7 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
.expression("([EW]),?")
.number("(d+.d)(?:d*,)?") // speed
.number("(dd)(dd)(dd),?") // time (hhmmss)
- .number("(d+.?d{1,2}),?") // course
+ .number("(d+.?d{1,4}),?") // course
.groupBegin()
.number("([01])") // charge
.number("([01])") // ignition
diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
index c02da7ac2..4b4097600 100644
--- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class Tk103ProtocolDecoderTest extends ProtocolTest {
Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new Tk103Protocol());
verifyPosition(decoder, text(
+ "(019358704260BR00180725A2300.0957N07235.2748E032.412092187.58001100166L000D9779)"));
+
+ verifyPosition(decoder, text(
"(358511020000026,DW5B,310,6,29876,30393,0,041217,102211)"));
verifyPosition(decoder, text(