aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-06-05 23:46:59 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-06-05 23:46:59 -0700
commit71f894ef66fe8ce84eaa32c2771efb53cfd47de4 (patch)
treecc5d105e3f8867f876848a86a665c7a9c7f7a466 /src/main/java
parent473e671a14bb826cdbf73f732fbd8b8eec6f3986 (diff)
downloadtrackermap-server-71f894ef66fe8ce84eaa32c2771efb53cfd47de4.tar.gz
trackermap-server-71f894ef66fe8ce84eaa32c2771efb53cfd47de4.tar.bz2
trackermap-server-71f894ef66fe8ce84eaa32c2771efb53cfd47de4.zip
Workaround for zeroed LBS data
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index 8d83638a0..b222cbf58 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -253,6 +253,16 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
if (hasLength) {
length = buf.readUnsignedByte();
if (length == 0) {
+ boolean zeroedData = true;
+ for (int i = buf.readerIndex() + 9; i < buf.readerIndex() + 45 && i < buf.writerIndex(); i++) {
+ if (buf.getByte(i) != 0) {
+ zeroedData = false;
+ break;
+ }
+ }
+ if (zeroedData) {
+ buf.skipBytes(Math.min(buf.readableBytes(), 45));
+ }
return false;
}
}