aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-03-29 13:31:39 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2014-03-29 13:31:39 +1300
commitdfb124c2fd1ecebcdc474e26e01fa7949be69b8c (patch)
treec08ebf6ec2bea1c19cb7846be113a1eaba5150bb
parent0728eec78c7c2826d78879481852688b6859fff6 (diff)
downloadtraccar-server-dfb124c2fd1ecebcdc474e26e01fa7949be69b8c.tar.gz
traccar-server-dfb124c2fd1ecebcdc474e26e01fa7949be69b8c.tar.bz2
traccar-server-dfb124c2fd1ecebcdc474e26e01fa7949be69b8c.zip
Improve Wondex decoder
-rw-r--r--src/org/traccar/protocol/WondexProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/WondexProtocolDecoderTest.java3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/WondexProtocolDecoder.java b/src/org/traccar/protocol/WondexProtocolDecoder.java
index 90f2e62e9..766bbdbcc 100644
--- a/src/org/traccar/protocol/WondexProtocolDecoder.java
+++ b/src/org/traccar/protocol/WondexProtocolDecoder.java
@@ -45,6 +45,7 @@ public class WondexProtocolDecoder extends BaseProtocolDecoder {
"(-?\\d+)," + // Altitude
"(\\d+)," + // Satellites
"(\\d+),?" + // Event
+ "(?:(\\d+\\.\\d+)V,)?" + // Battery
"(\\d+\\.\\d+)?,?" + // Milage
"(\\d+)?,?" + // Input
"(\\d+\\.\\d+)?,?" + // ADC1
@@ -102,6 +103,9 @@ public class WondexProtocolDecoder extends BaseProtocolDecoder {
// Event
extendedInfo.set("event", parser.group(index++));
+ // Battery
+ extendedInfo.set("battery", parser.group(index++));
+
// Milage
extendedInfo.set("milage", parser.group(index++));
diff --git a/test/org/traccar/protocol/WondexProtocolDecoderTest.java b/test/org/traccar/protocol/WondexProtocolDecoderTest.java
index bf51be534..88e1572fd 100644
--- a/test/org/traccar/protocol/WondexProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/WondexProtocolDecoderTest.java
@@ -26,6 +26,9 @@ public class WondexProtocolDecoderTest {
verify(decoder.decode(null, null,
"1044989601,20130322172647,13.572583,52.401070,22,204,-49,0,2"));
+
+ verify(decoder.decode(null, null,
+ "3997324533,20140326074908,28.797603,47.041635,0,48,0,6,2,3.90V,0"));
}