From 42cc50d51a5eda8f8de787a3230b8591b62d62b8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 2 Aug 2018 01:26:23 +1200 Subject: Fix TK103 course regex pattern --- src/org/traccar/protocol/Tk103ProtocolDecoder.java | 2 +- test/org/traccar/protocol/Tk103ProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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 @@ -10,6 +10,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)")); -- cgit v1.2.3