diff options
-rw-r--r-- | src/org/traccar/protocol/H02ProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/H02ProtocolDecoderTest.java | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index e4b18e277..dd5d4abd7 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -154,12 +154,10 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { .text("VP1,") .or() .groupBegin() - .text("V1,") - .or() .text("V4,") .expression("(.*),") // response .or() - .text("V19,") + .expression("V[^,]*,") .groupEnd() .number("(?:(dd)(dd)(dd))?,") // time (hhmmss) .groupEnd() diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index 59882a91f..e0130aa5d 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -12,6 +12,9 @@ public class H02ProtocolDecoderTest extends ProtocolTest { H02ProtocolDecoder decoder = new H02ProtocolDecoder(new H02Protocol()); verifyNull(decoder, buffer( + "*HQ,353505221264507,VI1,075146,0,5238.25900,N,00507.33429,E,0.54,0,250917,FFFFFFFF,cc,28, db,d75b#")); + + verifyNull(decoder, buffer( "*HQ,353505510948929,V1,,V,,N,,E,0.00,0,,FFFFF7FF,f0,a,11a0,c0c6#")); verifyPosition(decoder, buffer( |