diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-02-07 18:33:33 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-02-07 18:33:33 -0800 |
commit | 88fd0903f101cca7d86e2bd78fe02bbacbd7b6fb (patch) | |
tree | 097a0ecbe4967008fd6e3ad941142ac4cdf6772c /src/org/traccar | |
parent | 0526d86a86c1c2be22be9ed129cdc807c6d93b4b (diff) | |
download | traccar-server-88fd0903f101cca7d86e2bd78fe02bbacbd7b6fb.tar.gz traccar-server-88fd0903f101cca7d86e2bd78fe02bbacbd7b6fb.tar.bz2 traccar-server-88fd0903f101cca7d86e2bd78fe02bbacbd7b6fb.zip |
Avoid decoding location twice
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/Gl200TextProtocolDecoder.java | 8 |
1 files 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); |