aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/H02ProtocolDecoder.java3
-rw-r--r--test/org/traccar/protocol/H02ProtocolDecoderTest.java3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java
index fc6c9f17c..a0c646900 100644
--- a/src/org/traccar/protocol/H02ProtocolDecoder.java
+++ b/src/org/traccar/protocol/H02ProtocolDecoder.java
@@ -129,7 +129,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder {
.text("*")
.expression("..,") // manufacturer
.number("(d+),") // imei
- .number("Vd,") // version?
+ .expression("[^,]+,")
.any()
.number("(?:(dd)(dd)(dd))?,") // time
.expression("([AV])?,") // validity
@@ -148,6 +148,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder {
.number("(d+.?d*),") // speed
.number("(d+.?d*)?,") // course
.number("(?:(dd)(dd)(dd))?,") // date (ddmmyy)
+ .any()
.number("(x{8})") // status
.any()
.compile();
diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java
index d147cdec2..e4db2f56f 100644
--- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class H02ProtocolDecoderTest extends ProtocolTest {
H02ProtocolDecoder decoder = new H02ProtocolDecoder(new H02Protocol());
verifyPosition(decoder, buffer(
+ "*HQ,4209917484,V19,093043,V,5052.9749,N,00426.4322,E,000.00,000,130916,,0032475874141,8944538530000543700F,FFFFFBFF#"));
+
+ verifyPosition(decoder, buffer(
"*HQ,353505220873067,V1,,V,4605.75732,N,01430.73863,E,0.00,0,,FFFFFFEF,125,194, 64,d3#"));
verifyPosition(decoder, buffer(