From 7ff14665cb215410e258c2f8c88ae5ca2dbf0ddf Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 21 Dec 2016 03:06:10 +1300 Subject: Decode GL200 battery percentage --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index ff500f8f1..769964f33 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -326,7 +326,9 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_BATTERY, parser.nextDouble()); position.set(Position.KEY_CHARGE, parser.nextInt() == 1); - parser.next(); // battery percentage + if (parser.hasNext()) { + position.set(Position.KEY_BATTERY, parser.next() + "%"); + } position.set(Position.PREFIX_TEMP + 1, parser.next()); -- cgit v1.2.3