From bb599edbd964dd036f3433625034ce985cfc4eef Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 17 Sep 2017 10:23:39 +1200 Subject: Handle all Telic formats --- src/org/traccar/protocol/TelicProtocolDecoder.java | 2 +- test/org/traccar/protocol/TelicProtocolDecoderTest.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/org/traccar/protocol/TelicProtocolDecoder.java b/src/org/traccar/protocol/TelicProtocolDecoder.java index a875009a1..2c0d714c6 100644 --- a/src/org/traccar/protocol/TelicProtocolDecoder.java +++ b/src/org/traccar/protocol/TelicProtocolDecoder.java @@ -35,7 +35,7 @@ public class TelicProtocolDecoder extends BaseProtocolDecoder { private static final Pattern PATTERN = new PatternBuilder() .number("dddd") .number("(d{6}|d{15})") // device id - .number("(dd),") // type + .number("(d{1,2}),") // type .number("d{12},") // event time .number("d+,") .number("(dd)(dd)(dd)") // date (ddmmyy) diff --git a/test/org/traccar/protocol/TelicProtocolDecoderTest.java b/test/org/traccar/protocol/TelicProtocolDecoderTest.java index 84b6a797b..ed8245e1f 100644 --- a/test/org/traccar/protocol/TelicProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TelicProtocolDecoderTest.java @@ -13,6 +13,12 @@ public class TelicProtocolDecoderTest extends ProtocolTest { verifyNull(decoder, text( "0026355565071347499|206|01|001002008")); + verifyPosition(decoder, text( + "052028495198,160917073641,0,160917073642,43879,511958,3,24,223,17,,,-3,142379,,0010,00,64,205,0,0499")); + + verifyPosition(decoder, text( + "01302849516,160917073503,0,160917073504,43907,512006,3,11,160,14,,,-7,141811,,0010,00,64,206,0,0499")); + verifyPosition(decoder, text( "002135556507134749999,010817171138,0,010817171138,004560973,50667173,3,0,0,11,1,1,100,958071,20601,000000,00,4142,0000,0000,0208,10395,0")); -- cgit v1.2.3