aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-01-26 22:35:23 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2021-01-26 22:35:23 -0800
commit0d33868866b1d4dee89b6dff756bbbacfd58508f (patch)
tree129e311d2ad2fdbb085cd48ce9c5c0cfecd61579 /src
parent25bdd38bb7fb6afa1eb32a9108ed37f13d6079b6 (diff)
downloadtrackermap-server-0d33868866b1d4dee89b6dff756bbbacfd58508f.tar.gz
trackermap-server-0d33868866b1d4dee89b6dff756bbbacfd58508f.tar.bz2
trackermap-server-0d33868866b1d4dee89b6dff756bbbacfd58508f.zip
Support another TK103 format
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/Tk103ProtocolDecoder.java4
-rw-r--r--src/test/java/org/traccar/protocol/Tk103ProtocolDecoderTest.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Tk103ProtocolDecoder.java
index 69fff5310..5dad1458d 100644
--- a/src/main/java/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2020 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2021 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
.expression("([NS]),?")
.number(" *(d+)(dd.d+)") // longitude
.expression("([EW]),?")
- .number(" *(d+.d)(?:d*,)?") // speed
+ .number("([ d.]{1,5})(?:d*,)?") // speed
.number("(dd)(dd)(dd),?") // time (hhmmss)
.groupBegin()
.number("(?:([ d.]{6})|(dd)),?") // course
diff --git a/src/test/java/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Tk103ProtocolDecoderTest.java
index 422f99a73..106a24375 100644
--- a/src/test/java/org/traccar/protocol/Tk103ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Tk103ProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class Tk103ProtocolDecoderTest extends ProtocolTest {
Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(null);
+ verifyPosition(decoder, text(
+ "(086375304593BR00210119A2220.0160N11335.4073E0000014000309.84001000293L0000015FP23BS27F)"));
+
verifyAttribute(decoder, text(
"(027023361470BV005J6RW2H53HL066029)"),
Position.KEY_VIN, "5J6RW2H53HL066029");