diff options
Diffstat (limited to 'src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java index d010a8fe0..8afe04d0f 100644 --- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java @@ -710,6 +710,9 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001); position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); break; + case 0xF1: + position.set(Position.KEY_POWER, buf.readUnsignedInt() * 0.001); + break; case 0xF3: while (buf.readerIndex() < endIndex) { int extendedType = buf.readUnsignedShort(); @@ -772,6 +775,21 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { } } break; + case 0xF7: + position.set(Position.KEY_BATTERY, buf.readUnsignedInt() * 0.001); + if (length >= 5) { + short batteryStatus = buf.readUnsignedByte(); + switch (batteryStatus) { + case 2: + case 3: + position.set(Position.KEY_CHARGE, true); + default: + } + } + if (length >= 6) { + position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte()); + } + break; case 0xFE: if (length == 1) { position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte()); |