aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-12-02 21:28:15 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2014-12-02 21:28:15 +1300
commit2039c90485caaa03ab4833797daaca3250174203 (patch)
tree3949fb81bc6bbadf7162ba8493a1b404ebd202d8
parent6ea412740d1573f237582d67542124ae9bd6509e (diff)
downloadtraccar-server-2039c90485caaa03ab4833797daaca3250174203.tar.gz
traccar-server-2039c90485caaa03ab4833797daaca3250174203.tar.bz2
traccar-server-2039c90485caaa03ab4833797daaca3250174203.zip
Improve TK103 regex pattern
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/Tk103ProtocolDecoderTest.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
index f5ce44c60..f8955b1df 100644
--- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -42,9 +42,9 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
"\\d*" + // IMEI (?)
"(\\d{2})(\\d{2})(\\d{2}),?" + // Date (YYMMDD)
"([AV]),?" + // Validity
- "(\\d{2})(\\d{2}\\.\\d{4})" + // Latitude (DDMM.MMMM)
+ "(\\d{2})(\\d{2}\\.\\d+)" + // Latitude (DDMM.MMMM)
"([NS]),?" +
- "(\\d{3})(\\d{2}\\.\\d{4})" + // Longitude (DDDMM.MMMM)
+ "(\\d{3})(\\d{2}\\.\\d+)" + // Longitude (DDDMM.MMMM)
"([EW]),?" +
"(\\d+\\.\\d)(?:\\d*,)?" + // Speed
"(\\d{2})(\\d{2})(\\d{2}),?" + // Time (HHMMSS)
diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
index a23f5d061..f4962fac0 100644
--- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
@@ -49,6 +49,9 @@ public class Tk103ProtocolDecoderTest {
verify(decoder.decode(null, null,
"(013632782450,BP05,101201,A,2234.0297N,11405.9101E,000.0,040137,178.48,00000000,L00000000"));
+
+ verify(decoder.decode(null, null,
+ "(864768010009188,BP05,271114,V,4012.19376N,00824.05638E,000.0,154436,000.0"));
}