From 88fd0903f101cca7d86e2bd78fe02bbacbd7b6fb Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 7 Feb 2019 18:33:33 -0800 Subject: Avoid decoding location twice --- src/org/traccar/protocol/Gl200TextProtocolDecoder.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java index 31ff4a670..b258c97bf 100644 --- a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java @@ -497,6 +497,10 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { return position; } + private void skipLocation(Parser parser) { + parser.skip(19); + } + private void decodeLocation(Position position, Parser parser) { Integer hdop = parser.nextInt(); position.setValid(hdop == null || hdop > 0); @@ -806,7 +810,7 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { Position position = positions.getLast(); - decodeLocation(position, parser); + skipLocation(parser); if (power != null && power > 10) { position.set(Position.KEY_POWER, power * 0.001); // only on some devices @@ -871,7 +875,7 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { Position position = positions.getLast(); - decodeLocation(position, parser); + skipLocation(parser); if (power != null) { position.set(Position.KEY_POWER, power * 0.001); -- cgit v1.2.3