diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-05-01 20:25:41 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-05-01 20:25:41 +1200 |
commit | 5de1dbcff3268949463c3f811c77ff51bbe80ede (patch) | |
tree | d6a9dff549f66618fd09b2f7e9d682fbae292fb2 | |
parent | 403d8293e03a549fb479f08db9c83d9fe1232c9b (diff) | |
download | trackermap-server-5de1dbcff3268949463c3f811c77ff51bbe80ede.tar.gz trackermap-server-5de1dbcff3268949463c3f811c77ff51bbe80ede.tar.bz2 trackermap-server-5de1dbcff3268949463c3f811c77ff51bbe80ede.zip |
Support messages without device id
-rw-r--r-- | src/org/traccar/protocol/H02ProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/H02ProtocolDecoderTest.java | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index 9764adf04..54671bdbf 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2012 - 2018 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -148,7 +148,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { private static final Pattern PATTERN = new PatternBuilder() .text("*") .expression("..,") // manufacturer - .number("(d+),") // imei + .number("(d+)?,") // imei .groupBegin() .text("VP1,") .or() diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index adbdc0a07..3a758069c 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -15,6 +15,9 @@ public class H02ProtocolDecoderTest extends ProtocolTest { "*HQ,353505221264507,V2,100220,0,5238.26259,N,00507.33983,E,0.25,0,280917,FFFFFFFF,cc,28, db,d75b#")); verifyPosition(decoder, buffer( + "*HQ,,V1,173212,A,2225.78879,S,02829.19021,E,0.00,0,290418,FFFFFBFF#")); + + verifyPosition(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( |