aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-01-12 20:39:41 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-01-12 20:39:41 +1300
commit390045cb48f28668942328f587e176166cb831a2 (patch)
treee060b2e21c3eda43f9668a287d82201618474fa6 /src/org/traccar/protocol
parent8d973ed63075acfcf4b1c4809de41cb9d4a2c9db (diff)
downloadtraccar-server-390045cb48f28668942328f587e176166cb831a2.tar.gz
traccar-server-390045cb48f28668942328f587e176166cb831a2.tar.bz2
traccar-server-390045cb48f28668942328f587e176166cb831a2.zip
Fix Navis protocol frame decoder
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/NvsFrameDecoder.java4
1 files changed, 2 insertions, 2 deletions
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) {