aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java4
-rw-r--r--src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java4
2 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index c5e8809e3..b7d6d2595 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -838,7 +838,9 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedShort(); // satellites
buf.readUnsignedByte(); // alarm
buf.readUnsignedByte(); // language
- buf.readUnsignedByte(); // battery
+
+ position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte());
+
buf.readUnsignedByte(); // working mode
buf.readUnsignedShort(); // working voltage
buf.readUnsignedByte(); // reserved
diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index eeafbbdc4..1f92f5a26 100644
--- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -18,6 +18,10 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
"78780D01086471700328358100093F040D0A"));
verifyAttribute(decoder, binary(
+ "7878151330802b00000642014f0008720000802b5ee4d4c90d0a"),
+ Position.KEY_BATTERY_LEVEL, 6);
+
+ verifyAttribute(decoder, binary(
"7878281520000000003c49434349443a38393838323339303030303039373330323635303e00020d446f260d0a"),
Position.KEY_ICCID, "89882390000097302650");