diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2024-06-30 07:02:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-30 07:02:30 -0700 |
commit | 890d896eed89f33b9d71e894639cc8ec46ec0d68 (patch) | |
tree | bf63b405b600142652efce4b19f0fed87689aa38 /src/main/java/org/traccar/protocol | |
parent | 9c2c1566ab292ecc351c273c2ab0f3faf75a7daf (diff) | |
parent | be3180dce3889e201340d1542df46288191ee8f5 (diff) | |
download | trackermap-server-890d896eed89f33b9d71e894639cc8ec46ec0d68.tar.gz trackermap-server-890d896eed89f33b9d71e894639cc8ec46ec0d68.tar.bz2 trackermap-server-890d896eed89f33b9d71e894639cc8ec46ec0d68.zip |
Merge pull request #5358 from jcardus/huabao
Implemented power and battery for aovx v series
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-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()); |