From 9c44e3140ed8ae00c9459347ae6f2819affe149c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 31 Jan 2015 12:30:22 +1300 Subject: Handle login message (fix #1035) --- src/org/traccar/protocol/Xt013ProtocolDecoder.java | 1 + test/org/traccar/protocol/Xt013ProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/org/traccar/protocol/Xt013ProtocolDecoder.java b/src/org/traccar/protocol/Xt013ProtocolDecoder.java index 493955195..85048a93f 100644 --- a/src/org/traccar/protocol/Xt013ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xt013ProtocolDecoder.java @@ -37,6 +37,7 @@ public class Xt013ProtocolDecoder extends BaseProtocolDecoder { } private static final Pattern pattern = Pattern.compile( + "(?:HI,\\d+)?" + "TK," + "(\\d+)," + // IMEI "(\\d{2})(\\d{2})(\\d{2})" + // Date (YYMMDD) diff --git a/test/org/traccar/protocol/Xt013ProtocolDecoderTest.java b/test/org/traccar/protocol/Xt013ProtocolDecoderTest.java index db375ad19..32d0c55c2 100644 --- a/test/org/traccar/protocol/Xt013ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Xt013ProtocolDecoderTest.java @@ -14,6 +14,9 @@ public class Xt013ProtocolDecoderTest { verify(decoder.decode(null, null, "TK,862950021650364,150118113832,+53.267722,+5.767143,0,86,12,0,F,204,08,C94,336C,22,,4.21,1,,,,,,,,")); + + verify(decoder.decode(null, null, + "HI,862950021650364TK,862950021650364,150118113832,+53.267722,+5.767143,0,86,12,0,F,204,08,C94,336C,22,,4.21,1,,,,,,,,")); } -- cgit v1.2.3