aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-02-19 11:24:29 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-02-19 11:24:29 +1300
commitdac5c6923044572b0714e29dfae650888332c920 (patch)
tree581afd86abc81810262b20824cb1e1bac5eaf1ca /src/org/traccar/protocol
parentb178acdc21483cc7bd9588453a4d8afc476ca294 (diff)
downloadtrackermap-server-dac5c6923044572b0714e29dfae650888332c920.tar.gz
trackermap-server-dac5c6923044572b0714e29dfae650888332c920.tar.bz2
trackermap-server-dac5c6923044572b0714e29dfae650888332c920.zip
Workaround for GT06 length issue (fix #1727)
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/Gt06FrameDecoder.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Gt06FrameDecoder.java b/src/org/traccar/protocol/Gt06FrameDecoder.java
index ed0d8d548..21f5c8b52 100644
--- a/src/org/traccar/protocol/Gt06FrameDecoder.java
+++ b/src/org/traccar/protocol/Gt06FrameDecoder.java
@@ -37,6 +37,12 @@ public class Gt06FrameDecoder extends FrameDecoder {
if (buf.getByte(buf.readerIndex()) == 0x78) {
length += 1 + buf.getUnsignedByte(buf.readerIndex() + 2);
+
+ int type = buf.getUnsignedByte(buf.readerIndex() + 3);
+ if (type == Gt06ProtocolDecoder.MSG_STATUS && length == 13) {
+ length += 2; // workaround for #1727
+ }
+
} else {
length += 2 + buf.getUnsignedShort(buf.readerIndex() + 2);
}