From f122c85a71603fddad2c92e48370a8dfafbddaf1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 1 Sep 2020 18:59:11 -0700 Subject: Fix battery decoding --- .../java/org/traccar/protocol/Gl200TextProtocolDecoder.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java index cd5b41c39..c42b2716b 100644 --- a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java @@ -45,7 +45,7 @@ import java.util.regex.Pattern; public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { - private boolean ignoreFixTime; + private final boolean ignoreFixTime; public Gl200TextProtocolDecoder(Protocol protocol) { super(protocol); @@ -193,7 +193,7 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { .number("d{1,2},,") .number("(d{1,3}),") // battery .number("[01],") // mode - .number("[01],") // motion + .number("(?:[01])?,") // motion .number("(?:-?d{1,2}.d)?,") // temperature .or() .number("(d{1,7}.d)?,") // odometer @@ -220,15 +220,6 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { .text("$").optional() .compile(); - /* - CSQ BER <=2 0 - 7|99 -Reserved 0 -Battery Percentage <=3 0 - 100 -Mode Selection 1 0|1 -Movement Status 1 0|1 -Temperature <=5 (-)XX.X - */ - private static final Pattern PATTERN_ERI = new PatternBuilder() .text("+").expression("(?:RESP|BUFF):GTERI,") .number("(?:[0-9A-Z]{2}xxxx)?,") // protocol version -- cgit v1.2.3