aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-09-15 02:46:40 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-09-15 02:46:40 +1200
commitc82fd979ad17ecfb7dd8f3e366c067b66f4cdabc (patch)
tree59bc771b48b91b3fa1328b216d507b937722c9d1
parent1e7d036f1f076f380dca358432bb4ab2b7be255f (diff)
downloadtraccar-server-c82fd979ad17ecfb7dd8f3e366c067b66f4cdabc.tar.gz
traccar-server-c82fd979ad17ecfb7dd8f3e366c067b66f4cdabc.tar.bz2
traccar-server-c82fd979ad17ecfb7dd8f3e366c067b66f4cdabc.zip
Handle MVT380 no power value
-rw-r--r--src/org/traccar/protocol/MeitrackProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/MeitrackProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java
index 469ef3f76..2d0590f5e 100644
--- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java
@@ -69,7 +69,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
.number("(x+)?|") // adc2
.number("(x+)?|") // adc3
.number("(x+)|") // battery
- .number("(x+),") // power
+ .number("(x+)?,") // power
.groupBegin()
.expression("([^,]+)?,") // event specific
.expression("[^,]*,") // reserved
diff --git a/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java b/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java
index d50cae8bc..cbbbd17f6 100644
--- a/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class MeitrackProtocolDecoderTest extends ProtocolTest {
MeitrackProtocolDecoder decoder = new MeitrackProtocolDecoder(new MeitrackProtocol());
+ verifyPosition(decoder, buffer(
+ "$$B136,011691002364761,AAA,29,47.055220,28.893193,170914144240,V,0,7,0,0,0,132,129754946,129793197,259|2|02F8|413F,0000,000D|000C||028C|,*9E"));
+
verifyNotNull(decoder, buffer(
"$$F153,863835026880190,AAA,29,25.313160,55.422473,170628150902,V,0,0,0,0,0.0,0,6553,6697,0|0|0000|00000000,0000,0002|0000|0000|018B|0000,,,3,0000,,110,386*22"));