aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-12-21 03:06:10 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-12-21 02:06:10 +1300
commit7ff14665cb215410e258c2f8c88ae5ca2dbf0ddf (patch)
treea1d2e27f26da70bc8f5832518a79e479f9ae7404 /src/org
parent22fdf5388719120b84ce981807d17d68e87a0c07 (diff)
downloadtrackermap-server-7ff14665cb215410e258c2f8c88ae5ca2dbf0ddf.tar.gz
trackermap-server-7ff14665cb215410e258c2f8c88ae5ca2dbf0ddf.tar.bz2
trackermap-server-7ff14665cb215410e258c2f8c88ae5ca2dbf0ddf.zip
Decode GL200 battery percentage
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java4
1 files changed, 3 insertions, 1 deletions
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());