From 025f2dff7c93917484ed7b37ca49d4d958bfe450 Mon Sep 17 00:00:00 2001 From: jcardus Date: Sat, 29 Jun 2024 02:33:39 +0100 Subject: Implemented power and battery for aovx v series --- src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java index d010a8fe0..e99caad5e 100644 --- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java @@ -710,6 +710,8 @@ 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); case 0xF3: while (buf.readerIndex() < endIndex) { int extendedType = buf.readUnsignedShort(); @@ -772,6 +774,11 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { } } break; + case 0xF7: + position.set(Position.KEY_BATTERY, buf.readUnsignedInt() * 0.001); + position.set(Position.KEY_CHARGE, buf.readUnsignedByte() >= 2); + position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte()); + break; case 0xFE: if (length == 1) { position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte()); -- cgit v1.2.3