diff options
author | Anton Tananaev <anton@traccar.org> | 2022-09-10 16:37:53 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-09-10 16:37:53 -0700 |
commit | 18807d840ce04f8052f4b1fc842f4ad2da958326 (patch) | |
tree | 9959a31c7a2a54493937ddaa87c0be4bb7d3060c /src/main | |
parent | 725195a271f4313255b80c99278b3a91cff799e1 (diff) | |
download | trackermap-server-18807d840ce04f8052f4b1fc842f4ad2da958326.tar.gz trackermap-server-18807d840ce04f8052f4b1fc842f4ad2da958326.tar.bz2 trackermap-server-18807d840ce04f8052f4b1fc842f4ad2da958326.zip |
Fix GT800 door decoding
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java index 885ea4bab..7eeee5efb 100644 --- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -987,6 +987,13 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { } else if (subType == 0x05) { + if (buf.readableBytes() >= 6 + 1 + 6) { + DateBuilder dateBuilder = new DateBuilder((TimeZone) deviceSession.get(DeviceSession.KEY_TIMEZONE)) + .setDate(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte()) + .setTime(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte()); + position.setDeviceTime(dateBuilder.getDate()); + } + int flags = buf.readUnsignedByte(); position.set(Position.KEY_DOOR, BitUtil.check(flags, 0)); position.set(Position.PREFIX_IO + 1, BitUtil.check(flags, 2)); |