aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-09-25 20:55:21 -0700
committerAnton Tananaev <anton@traccar.org>2023-09-25 20:55:27 -0700
commit8638bc8ab98fa5ee6199ecaa28754972dee15e5e (patch)
treefe3cb7d7e46b82bff2fab547891c2da76952fe4a /src/main
parent6f59f756a7d3e86924e762919dbbe13940a6511f (diff)
downloadtrackermap-server-8638bc8ab98fa5ee6199ecaa28754972dee15e5e.tar.gz
trackermap-server-8638bc8ab98fa5ee6199ecaa28754972dee15e5e.tar.bz2
trackermap-server-8638bc8ab98fa5ee6199ecaa28754972dee15e5e.zip
Support HHD LoRa padlock
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
index beb1ec41a..6e8373373 100644
--- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
@@ -489,8 +489,22 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // reserved
break;
case 0x60:
- position.set(Position.KEY_EVENT, buf.readUnsignedShort());
- buf.skipBytes(length - 2);
+ int event = buf.readUnsignedShort();
+ position.set(Position.KEY_EVENT, event);
+ if (event >= 0x0061 && event <= 0x0066) {
+ buf.skipBytes(6); // lock id
+ stringValue = buf.readCharSequence(8, StandardCharsets.US_ASCII).toString();
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, stringValue);
+ }
+ break;
+ case 0x63:
+ for (int i = 1; i <= length / 11; i++) {
+ position.set("lock" + i + "Id", ByteBufUtil.hexDump(buf.readSlice(6)));
+ position.set("lock" + i + "Battery", buf.readUnsignedShort() * 0.001);
+ position.set("lock" + i + "Seal", buf.readUnsignedByte() == 0x31);
+ buf.readUnsignedByte(); // physical state
+ buf.readUnsignedByte(); // rssi
+ }
break;
case 0x69:
position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.01);