diff options
author | Anton Tananaev <anton@traccar.org> | 2023-03-09 09:26:32 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-03-09 09:26:32 -0800 |
commit | 2749e520c9ea1ba778c120739e2b67a9fe5e119c (patch) | |
tree | 6a3b468c57777836fdabc07a2a85a1733b457949 /src/main/java/org/traccar | |
parent | 785933bc74b2530ed36b4d5fae364284e28cf5d9 (diff) | |
download | trackermap-server-2749e520c9ea1ba778c120739e2b67a9fe5e119c.tar.gz trackermap-server-2749e520c9ea1ba778c120739e2b67a9fe5e119c.tar.bz2 trackermap-server-2749e520c9ea1ba778c120739e2b67a9fe5e119c.zip |
Add JT705A gyro axis
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java index d6deafe17..d3336b60c 100644 --- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java @@ -753,6 +753,22 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_STATUS, status); + while (buf.readableBytes() > 2) { + int id = buf.readUnsignedByte(); + int length = buf.readUnsignedByte(); + switch (id) { + case 0x02: + position.setAltitude(buf.readShort()); + break; + case 0x0C: + position.set("gyro", ByteBufUtil.hexDump(buf.readSlice(6))); + break; + default: + buf.skipBytes(length); + break; + } + } + return position; } |