aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortt <abc@yahoo.com>2013-02-25 21:30:23 -0500
committerhallmark9 <spamsink05@yahoo.com>2013-02-25 22:12:26 -0500
commit5fe033327cbb8ef12883934ac494e4857d6a9592 (patch)
tree83ef04d59930c210a4305736e92d285928f78232
parentfbba01063cf4f79d83d58700f1e19486c8b26f16 (diff)
downloadtrackermap-server-5fe033327cbb8ef12883934ac494e4857d6a9592.tar.gz
trackermap-server-5fe033327cbb8ef12883934ac494e4857d6a9592.tar.bz2
trackermap-server-5fe033327cbb8ef12883934ac494e4857d6a9592.zip
Fixed Meiligao VT300 protocol when ACC Mileage is disabled.
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index f40d64b26..9be8a8555 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -49,8 +49,8 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
"([EW])," +
"(\\d+.\\d+)," + // Speed
"(\\d+\\.?\\d*)?," + // Course
- "(\\d{2})(\\d{2})(\\d{2})," + // Date (DDMMYY)
- "[^\\|]+\\|(\\d+\\.\\d)\\|" + // Dilution of precision
+ "(\\d{2})(\\d{2})(\\d{2})" + // Date (DDMMYY)
+ "[^\\|]*\\|(\\d+\\.\\d)\\|" + // Dilution of precision
"(\\d+\\.?\\d*)\\|" + // Altitude
"([0-9a-fA-F]+)?" + // State
"(?:\\|([0-9a-fA-F]+),([0-9a-fA-F]+))?" + // ADC
diff --git a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java
index 94950fc9c..6c0a520f5 100644
--- a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java
@@ -35,6 +35,9 @@ public class MeiligaoProtocolDecoderTest {
byte[] buf7 = {0x12,0x34,0x56,0x78,(byte)0x9F,(byte)0xFF,(byte)0xFF,(byte)0x99,0x55,0x30,0x32,0x30,0x36,0x30,0x30,0x2E,0x39,0x33,0x30,0x2C,0x41,0x2C,0x32,0x33,0x30,0x39,0x2E,0x32,0x30,0x35,0x31,0x2C,0x4E,0x2C,0x31,0x31,0x33,0x31,0x38,0x2E,0x38,0x34,0x34,0x39,0x2C,0x45,0x2C,0x30,0x2E,0x30,0x30,0x2C,0x30,0x2E,0x30,0x30,0x2C,0x30,0x39,0x30,0x37,0x31,0x30,0x2C,0x2C,0x2C,0x41,0x2A,0x36,0x41,0x7C,0x32,0x2E,0x36,0x7C,0x39,0x36,0x2E,0x37,0x7C,0x30,0x30,0x30,0x30,0x7C,0x30,0x30,0x30,0x30,0x2C,0x33,0x46,0x46,0x46,0x7C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,(byte)0xC4,0x52,0x0D,0x0A};
assertNotNull(decoder.decode(null, null, factory.getBuffer(buf7, 0, buf7.length)));
+
+ byte[] buf8 = {0x59,0x77,0x20,0x37,0x44,0x05,(byte)0x84,(byte)0x99,0x55,0x30,0x32,0x30,0x31,0x31,0x37,0x2E,0x30,0x30,0x30,0x2C,0x41,0x2C,0x34,0x31,0x31,0x37,0x2E,0x39,0x32,0x31,0x32,0x2C,0x4E,0x2C,0x30,0x38,0x31,0x33,0x30,0x2E,0x32,0x30,0x39,0x36,0x2C,0x57,0x2C,0x30,0x2E,0x30,0x30,0x2C,0x33,0x30,0x33,0x2E,0x38,0x35,0x2C,0x32,0x36,0x30,0x32,0x31,0x33,0x7C,0x31,0x2E,0x36,0x7C,0x30,0x30,0x7C,0x30,0x30,0x30,0x30,0x7C,0x30,0x30,0x30,0x30,0x2C,0x30,0x30,0x30,0x30,0x71,(byte)0xCD,0x0D,0x0A};
+ decoder.decode(null, null, factory.getBuffer(buf8, 0, buf8.length));
}