aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-29 20:30:58 +1200
committerGitHub <noreply@github.com>2017-08-29 20:30:58 +1200
commit2ff8f21543727590a0f66adc9fc72b0dd6b5e2c9 (patch)
tree1350de42db8122ba3095468e313439dc8520dca5 /src/org
parent6285adfbc85ada862b4d2d3f8a0621a2f32cb29f (diff)
parentac2d2723086b086d8c27a533b6f7c4888d04e63b (diff)
downloadtraccar-server-2ff8f21543727590a0f66adc9fc72b0dd6b5e2c9.tar.gz
traccar-server-2ff8f21543727590a0f66adc9fc72b0dd6b5e2c9.tar.bz2
traccar-server-2ff8f21543727590a0f66adc9fc72b0dd6b5e2c9.zip
Merge pull request #3481 from AnshulJain1985/GT06_Alarm
GT06 alarm packet issue
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index d8da7e6de..5c83f9348 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -182,6 +182,9 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
}
if (length > 0) {
+ if (length > 12) {
+ length = 12;
+ }
buf.skipBytes(length - 12); // skip reserved
}
@@ -202,7 +205,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedShort(), buf.readUnsignedByte(), buf.readUnsignedShort(), buf.readUnsignedMedium())));
if (length > 0) {
- buf.skipBytes(length - 8);
+ buf.skipBytes(length - (hasLength ? 9 : 8));
}
return true;
@@ -462,6 +465,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
if (hasLbs(type)) {
decodeLbs(position, buf, hasStatus(type));
+ buf.skipBytes(-1);
}
if (hasStatus(type)) {
@@ -573,7 +577,9 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, position.getDeviceTime());
}
- decodeLbs(position, buf, true);
+ if (decodeLbs(position, buf, true)) {
+ buf.skipBytes(1); //Extended data
+ }
buf.skipBytes(buf.readUnsignedByte()); // additional cell towers
buf.skipBytes(buf.readUnsignedByte()); // wifi access point