aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-04-18 12:09:44 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-04-18 12:09:44 -0700
commit3ecba816b23e278cac690a9ceb366b9637bba775 (patch)
tree7969a327fa4db8f4956bf0c1ebf075bc074d6436 /src
parent289df0dde0ecd7b1ab46e21467ced5010d8967df (diff)
downloadtrackermap-server-3ecba816b23e278cac690a9ceb366b9637bba775.tar.gz
trackermap-server-3ecba816b23e278cac690a9ceb366b9637bba775.tar.bz2
trackermap-server-3ecba816b23e278cac690a9ceb366b9637bba775.zip
Fix coordinates decoding
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 5dad1458d..ff33cb103 100644
--- a/src/main/java/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -60,9 +60,9 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
.groupEnd()
.number("(dd)(dd)(dd),?") // date (mmddyy if comma-delimited, otherwise yyddmm)
.expression("([AV]),?") // validity
- .number(" *(d+)(dd.d+)") // latitude
+ .number(" *(d*)(dd.d+)") // latitude
.expression("([NS]),?")
- .number(" *(d+)(dd.d+)") // longitude
+ .number(" *(d*)(dd.d+)") // longitude
.expression("([EW]),?")
.number("([ d.]{1,5})(?:d*,)?") // speed
.number("(dd)(dd)(dd),?") // time (hhmmss)
diff --git a/src/test/java/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Tk103ProtocolDecoderTest.java
index e0dd1165b..321d0cb50 100644
--- a/src/test/java/org/traccar/protocol/Tk103ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Tk103ProtocolDecoderTest.java
@@ -12,6 +12,9 @@ public class Tk103ProtocolDecoderTest extends ProtocolTest {
var decoder = new Tk103ProtocolDecoder(null);
verifyPosition(decoder, text(
+ "(868822040452227,DW3B,150421,A,4154.51607N,45.78950E,0.050,103142,0.000,595.200,7,0)"));
+
+ verifyPosition(decoder, text(
"(086375304593BR00210119A2220.0160N11335.4073E0000014000309.84001000293L0000015FP23BS27F)"));
verifyAttribute(decoder, text(