From 390045cb48f28668942328f587e176166cb831a2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 12 Jan 2016 20:39:41 +1300 Subject: Fix Navis protocol frame decoder --- src/org/traccar/protocol/NvsFrameDecoder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/protocol/NvsFrameDecoder.java b/src/org/traccar/protocol/NvsFrameDecoder.java index ce62ea867..3991a1865 100644 --- a/src/org/traccar/protocol/NvsFrameDecoder.java +++ b/src/org/traccar/protocol/NvsFrameDecoder.java @@ -34,9 +34,9 @@ public class NvsFrameDecoder extends FrameDecoder { int length; if (buf.getUnsignedByte(buf.readerIndex()) == 0) { - length = buf.getUnsignedShort(buf.readerIndex()); + length = 2 + buf.getUnsignedShort(buf.readerIndex()); } else { - length = 4 + buf.getUnsignedShort(buf.readerIndex() + 4) + 2; + length = 4 + 2 + buf.getUnsignedShort(buf.readerIndex() + 4) + 2; } if (buf.readableBytes() >= length) { -- cgit v1.2.3