aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-09-10 16:37:53 -0700
committerAnton Tananaev <anton@traccar.org>2022-09-10 16:37:53 -0700
commit18807d840ce04f8052f4b1fc842f4ad2da958326 (patch)
tree9959a31c7a2a54493937ddaa87c0be4bb7d3060c /src/main/java/org/traccar/protocol
parent725195a271f4313255b80c99278b3a91cff799e1 (diff)
downloadtrackermap-server-18807d840ce04f8052f4b1fc842f4ad2da958326.tar.gz
trackermap-server-18807d840ce04f8052f4b1fc842f4ad2da958326.tar.bz2
trackermap-server-18807d840ce04f8052f4b1fc842f4ad2da958326.zip
Fix GT800 door decoding
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java7
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));