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:09:02 -0700
committerGitHub <noreply@github.com>2022-09-18 10:09:02 -0700
commitd702c9caf113ca761c57f811b128f8188c9dec0c (patch)
tree8891e32d889f68ccbb294585bc0ff89875583567 /src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
parentd4513fa86539577e24ede46d40748d8d034b025c (diff)
parent4de8efe1ef0810af492c161bfc1d3200958d75d8 (diff)
downloadtrackermap-server-d702c9caf113ca761c57f811b128f8188c9dec0c.tar.gz
trackermap-server-d702c9caf113ca761c57f811b128f8188c9dec0c.tar.bz2
trackermap-server-d702c9caf113ca761c57f811b128f8188c9dec0c.zip
Merge branch 'master' into ndtpv6-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));