aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-11-21 22:58:25 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-11-21 22:58:25 -0800
commit3392dc3ee2cfb08542d7c2bf00e01305bcefc28c (patch)
tree43a54cf3c4b1840cf8dfe0ee98560bc934b5a2cb
parenta87b9f3d9ba75b12d70a1d62640edcf64bd59072 (diff)
downloadtrackermap-server-3392dc3ee2cfb08542d7c2bf00e01305bcefc28c.tar.gz
trackermap-server-3392dc3ee2cfb08542d7c2bf00e01305bcefc28c.tar.bz2
trackermap-server-3392dc3ee2cfb08542d7c2bf00e01305bcefc28c.zip
Handle spaces before speed
-rw-r--r--src/main/java/org/traccar/protocol/H02ProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/H02ProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java
index 137689a67..47e5aede0 100644
--- a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java
@@ -185,7 +185,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder {
.number("(d+)(dd.d+),") // longitude
.groupEnd()
.expression("([EW]),")
- .number("(d+.?d*),") // speed
+ .number(" *(d+.?d*),") // speed
.number("(d+.?d*)?,") // course
.number("(?:d+,)?") // battery
.number("(?:(dd)(dd)(dd))?") // date (ddmmyy)
diff --git a/src/test/java/org/traccar/protocol/H02ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/H02ProtocolDecoderTest.java
index 31e4f2dee..687a2a68c 100644
--- a/src/test/java/org/traccar/protocol/H02ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/H02ProtocolDecoderTest.java
@@ -14,6 +14,9 @@ public class H02ProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, buffer(
"*HQ,135790246811220,HTBT#"));
+ verifyPosition(decoder, buffer(
+ "*HQ,865205035331981,V1,132926,A,1935.3933,N,07920.4134,E, 3.34,342,280519,FFFFFFFF#"));
+
verifyPosition(decoder, binary(
"24702802061601234020031910125482600612695044000000ffffbbff000000000000000001760d04e2c9934d"));