diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-10-13 22:15:32 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-10-13 22:49:54 -0700 |
commit | ba5456b466d73ca6360fdef2b90dc84de7210ef1 (patch) | |
tree | 22ee709691506a5a214d445765507da6fdc3b0b5 /src/main/java/org | |
parent | 7d48ebdcf44346d75715fb146aaa9e26501ea3b6 (diff) | |
download | traccar-server-ba5456b466d73ca6360fdef2b90dc84de7210ef1.tar.gz traccar-server-ba5456b466d73ca6360fdef2b90dc84de7210ef1.tar.bz2 traccar-server-ba5456b466d73ca6360fdef2b90dc84de7210ef1.zip |
Update Huabao decoder
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | 13 |
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(); |