diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-07-31 20:29:21 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-07-31 20:29:21 +1200 |
commit | 016561b2060242e4d4cac25f352cec3dbe4c41a4 (patch) | |
tree | 4005acb8d5ac207b8c4da39cb5f5d3c678bef46c | |
parent | b3eb72bfae2972e39fb19faba24c1a8eb88e761e (diff) | |
download | traccar-server-016561b2060242e4d4cac25f352cec3dbe4c41a4.tar.gz traccar-server-016561b2060242e4d4cac25f352cec3dbe4c41a4.tar.bz2 traccar-server-016561b2060242e4d4cac25f352cec3dbe4c41a4.zip |
Fix tk103 decoder (fix #258)
-rw-r--r-- | src/org/traccar/protocol/Tk103ProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/Tk103ProtocolDecoderTest.java | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java index a42f8703b..9fbf32556 100644 --- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java @@ -33,8 +33,6 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } - //(008600410203 BP05 000008600410203 130721 A4152.5790N01239.2770E000.0 145238 173.8 70100000A L 000000D8 - static private Pattern pattern = Pattern.compile( "(\\d{12})" + // Device ID ".{4}" + // Command @@ -47,7 +45,7 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder { "([EW])" + "(\\d+\\.\\d)" + // Speed "(\\d{2})(\\d{2})(\\d{2})" + // Time (HHMMSS) - "(\\d+\\.\\d+)" + // Course + "(\\d+\\.?\\d+)" + // Course "([0-9a-fA-F]{8})" + // State "L([0-9a-fA-F]+)"); // Milage diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java index 544091fd5..90d49b69a 100644 --- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java @@ -31,6 +31,9 @@ public class Tk103ProtocolDecoderTest { assertNotNull(decoder.decode(null, null, "(008600410203BP05000008600410203130721A4152.5790N01239.2770E000.0145238173.870100000AL0000000")); + + assertNotNull(decoder.decode(null, null, + "(013012345678BR00130515A4843.9703N01907.6211E000.019232800000000000000L00009239")); } |