aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-11-13 07:12:24 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-11-13 07:12:24 +1300
commit0a8f30a572b1e64ff3e1d67281bf9fa3f40b9ccb (patch)
tree527a356bce2aa41c817e341f4752b063239f7619
parent395ed2c3845d20b0dbb25e39806dfdd37c2ec0d3 (diff)
downloadtrackermap-server-0a8f30a572b1e64ff3e1d67281bf9fa3f40b9ccb.tar.gz
trackermap-server-0a8f30a572b1e64ff3e1d67281bf9fa3f40b9ccb.tar.bz2
trackermap-server-0a8f30a572b1e64ff3e1d67281bf9fa3f40b9ccb.zip
Fix GV65+ ERI message decoding
-rw-r--r--src/org/traccar/protocol/Gl200TextProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/Gl200TextProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java
index 2f03cbb8f..46a530efa 100644
--- a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java
@@ -216,7 +216,7 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder {
.number("(d{1,7}.d)?,") // odometer
.number("(d{5}:dd:dd)?,") // hour meter
.number("(x+)?,") // adc 1
- .number("(x+)?,") // adc 2
+ .number("(x+)?,").optional() // adc 2
.number("(d{1,3})?,") // battery
.number("(?:(xx)(xx)(xx))?,") // device status
.expression("(.*)") // additional data
diff --git a/test/org/traccar/protocol/Gl200TextProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
index 2b0395e48..d18897354 100644
--- a/test/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
@@ -10,6 +10,9 @@ public class Gl200TextProtocolDecoderTest extends ProtocolTest {
Gl200TextProtocolDecoder decoder = new Gl200TextProtocolDecoder(new Gl200Protocol());
+ verifyPositions(decoder, buffer(
+ "+RESP:GTERI,380603,869606020025833,gv65,00000002,12003,10,1,1,0.0,172,24.6,-81.931875,26.577439,20171002045352,0310,0260,72BD,8E5B,00,1052.1,01383:52:12,0,100,210700,2,1,28FF4560A3150483,1,05B0,20171002045402,9548$"));
+
verifyAttributes(decoder, buffer(
"+RESP:GTINF,04040E,861074023747143,gv200,41,8959301000648637556f,24,0,1,0,1,4.4,0,1,0,0,20170912221854,0,00,01,-0500,1,20170912193448,1D5B$"));