aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-11-23 10:44:04 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-11-23 10:44:04 +1300
commit7a857c727ac11f0c48c7213c81b37aa0d8ef5675 (patch)
tree70ae4ce0ac40f9269784a2a1fb852291cfac3d9f
parent65d0cdf1a38861ac4a53b9c7fa6489c20c179df6 (diff)
downloadtraccar-server-7a857c727ac11f0c48c7213c81b37aa0d8ef5675.tar.gz
traccar-server-7a857c727ac11f0c48c7213c81b37aa0d8ef5675.tar.bz2
traccar-server-7a857c727ac11f0c48c7213c81b37aa0d8ef5675.zip
Update H002 protocol
-rw-r--r--src/org/traccar/protocol/Pt60ProtocolDecoder.java1
-rw-r--r--test/org/traccar/protocol/Pt60ProtocolDecoderTest.java3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Pt60ProtocolDecoder.java b/src/org/traccar/protocol/Pt60ProtocolDecoder.java
index 51a916475..636d9e27e 100644
--- a/src/org/traccar/protocol/Pt60ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Pt60ProtocolDecoder.java
@@ -48,6 +48,7 @@ public class Pt60ProtocolDecoder extends BaseProtocolDecoder {
.number("(d+)[,|]") // imei
.number("d+[,|]") // imsi
.groupBegin()
+ .expression("[^,|]+[,|]").optional() // firmware version
.number("[01][,|]") // state
.number("d+[,|]") // battery
.groupEnd("?")
diff --git a/test/org/traccar/protocol/Pt60ProtocolDecoderTest.java b/test/org/traccar/protocol/Pt60ProtocolDecoderTest.java
index d2e06b193..4bd9ec27d 100644
--- a/test/org/traccar/protocol/Pt60ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Pt60ProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class Pt60ProtocolDecoderTest extends ProtocolTest {
Pt60ProtocolDecoder decoder = new Pt60ProtocolDecoder(null);
verifyNull(decoder, text(
+ "@B#@|01|003|864891030184954|9425010450971470|S6_EN_A_V1.3.7|0|66|20181122113251|40412,10461,1,425,18|49382,10461,1,425,9|40411,10461,1,425,7|2|"));
+
+ verifyNull(decoder, text(
"@B#@|01|033|864891030184954|9425010450971470|0|4|20181120151744|"));
verifyPosition(decoder, text(