aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-01-10 13:40:37 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-01-10 13:40:37 +1300
commitda7852b28d48f0c3a3a2e5d272fa89ea28817abf (patch)
treee48d35f9fd8f20ba8f59be124a2eb24b70d0446e /src/org/traccar
parentef1567a5eea6937d6d7e1bf6f9855c474ca57866 (diff)
downloadtrackermap-server-da7852b28d48f0c3a3a2e5d272fa89ea28817abf.tar.gz
trackermap-server-da7852b28d48f0c3a3a2e5d272fa89ea28817abf.tar.bz2
trackermap-server-da7852b28d48f0c3a3a2e5d272fa89ea28817abf.zip
Fix Tramigo frame decoder
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/TramigoFrameDecoder.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/TramigoFrameDecoder.java b/src/org/traccar/protocol/TramigoFrameDecoder.java
index 5b3f41078..f6dde4298 100644
--- a/src/org/traccar/protocol/TramigoFrameDecoder.java
+++ b/src/org/traccar/protocol/TramigoFrameDecoder.java
@@ -44,10 +44,16 @@ public class TramigoFrameDecoder extends LengthFieldBasedFrameDecoder {
int length = buf.readableBytes();
byte bytes[] = new byte[length];
buf.getBytes(buf.readerIndex(), bytes);
- buf = ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, bytes);
+
+ ChannelBuffer result = (ChannelBuffer) super.decode(
+ ctx, channel, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, bytes));
+ if (result != null) {
+ buf.skipBytes(result.readableBytes());
+ }
+ return result;
}
- return decode(ctx, channel, buf);
+ return super.decode(ctx, channel, buf);
}
}