aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
index 0d574203c..bbafbd748 100644
--- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
@@ -174,6 +174,8 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
} else if (type == MSG_LOCATION_REPORT) {
+ sendGeneralResponse(channel, remoteAddress, id, type, index);
+
return decodeLocation(deviceSession, buf);
} else if (type == MSG_LOCATION_REPORT_2 || type == MSG_LOCATION_REPORT_BLIND) {
@@ -300,6 +302,17 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
case 0xD3:
position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.1);
break;
+ case 0xD4:
+ position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte());
+ break;
+ case 0xD5:
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.01);
+ break;
+ case 0xDA:
+ buf.readUnsignedShort();
+ int deviceStatus = buf.readUnsignedByte();
+ position.set("cover", BitUtil.check(deviceStatus, 3));
+ break;
case 0xEB:
while (buf.readerIndex() < endIndex) {
int extendedLength = buf.readUnsignedShort();