aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2022-09-18 10:49:28 -0700
committerGitHub <noreply@github.com>2022-09-18 10:49:28 -0700
commitb118bd4cc8a64e768370ef19061e0f968136cf18 (patch)
tree0f88d08b2e51d5285dde5ed7acdace5293be8373 /src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
parentd55ae464806430ee57bbd56737f024ead95748a2 (diff)
parent8532bffcec8e239c6699845e09e63da927f51d9a (diff)
downloadtrackermap-server-b118bd4cc8a64e768370ef19061e0f968136cf18.tar.gz
trackermap-server-b118bd4cc8a64e768370ef19061e0f968136cf18.tar.bz2
trackermap-server-b118bd4cc8a64e768370ef19061e0f968136cf18.zip
Merge branch 'master' into g1rus-dev
Diffstat (limited to 'src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index b65e4a4b8..7eeee5efb 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -411,9 +411,12 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
case 0x11:
return Position.ALARM_POWER_OFF;
case 0x13:
+ case 0x25:
return Position.ALARM_TAMPERING;
case 0x14:
return Position.ALARM_DOOR;
+ case 0x23:
+ return Position.ALARM_FALL_DOWN;
case 0x29:
return Position.ALARM_ACCELERATION;
case 0x30:
@@ -423,8 +426,6 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
return Position.ALARM_CORNERING;
case 0x2C:
return Position.ALARM_ACCIDENT;
- case 0x23:
- return Position.ALARM_FALL_DOWN;
default:
return null;
}
@@ -986,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));