diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-23 22:01:22 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-23 22:01:22 +1300 |
commit | 160e0c32eccdce5bfab5f449e291a7b45703b823 (patch) | |
tree | 80ddea9b1b0269aa4d9bb18cd5a5598fcec0141e | |
parent | a2709e3e9c2615e95139f03aec1c5e734f33f191 (diff) | |
download | traccar-server-160e0c32eccdce5bfab5f449e291a7b45703b823.tar.gz traccar-server-160e0c32eccdce5bfab5f449e291a7b45703b823.tar.bz2 traccar-server-160e0c32eccdce5bfab5f449e291a7b45703b823.zip |
Fix Wondex protocol
-rw-r--r-- | src/org/traccar/protocol/WondexProtocolDecoder.java | 2 | ||||
-rw-r--r-- | test/org/traccar/protocol/WondexProtocolDecoderTest.java | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/WondexProtocolDecoder.java b/src/org/traccar/protocol/WondexProtocolDecoder.java index 5e3f3f390..964ecf5ff 100644 --- a/src/org/traccar/protocol/WondexProtocolDecoder.java +++ b/src/org/traccar/protocol/WondexProtocolDecoder.java @@ -36,7 +36,7 @@ public class WondexProtocolDecoder extends BaseProtocolDecoder { * Regular expressions pattern */ static private Pattern pattern = Pattern.compile( - ".*" + // Header + "[^\\d]*" + // Header "(\\d+)," + // Device Identifier "(\\d{4})(\\d{2})(\\d{2})" + // Date (YYYYMMDD) "(\\d{2})(\\d{2})(\\d{2})," + // Time (HHMMSS) diff --git a/test/org/traccar/protocol/WondexProtocolDecoderTest.java b/test/org/traccar/protocol/WondexProtocolDecoderTest.java index e8e52c149..249c8f2ef 100644 --- a/test/org/traccar/protocol/WondexProtocolDecoderTest.java +++ b/test/org/traccar/protocol/WondexProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class WondexProtocolDecoderTest { WondexProtocolDecoder decoder = new WondexProtocolDecoder(null); decoder.setDataManager(new TestDataManager()); + + assertNotNull(decoder.decode(null, null, + "1044989601,20130323074605,0.000000,90.000000,0,000,0,0,2")); assertNotNull(decoder.decode(null, null, "210000001,20070313170040,121.123456,12.654321,0,233,0,9,2,0.0,0,0.00,0.00,0")); |