aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-10-17 21:02:34 -0700
committerAnton Tananaev <anton@traccar.org>2023-10-17 21:02:34 -0700
commit37ed394724c0bdcc6f98f421e71d76916206ed30 (patch)
tree8d73c34dad60ff05f22d24e37bcec1da2ca9a7b4 /src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
parentd3631eb7286338a0ea046a511aa5cbfce470c7b7 (diff)
downloadtrackermap-server-37ed394724c0bdcc6f98f421e71d76916206ed30.tar.gz
trackermap-server-37ed394724c0bdcc6f98f421e71d76916206ed30.tar.bz2
trackermap-server-37ed394724c0bdcc6f98f421e71d76916206ed30.zip
Seeworld battery level decoding
Diffstat (limited to 'src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index f676e7363..cf7cd12d3 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -841,7 +841,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // working mode
position.set(Position.KEY_POWER, buf.readUnsignedShort() / 100.0);
} else {
- position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte() * 100 / 6);
+ int battery = buf.readUnsignedByte();
+ position.set(Position.KEY_BATTERY_LEVEL, battery <= 6 ? battery * 100 / 6 : battery);
position.set(Position.KEY_RSSI, buf.readUnsignedByte());
short alarmExtension = buf.readUnsignedByte();
if (variant != Variant.VXT01) {