From b7429d1e8110f8a5baf58edad652ad50c4c9d38e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 17 Nov 2013 12:10:37 +1300 Subject: Fix totem frame decoder --- src/org/traccar/protocol/TotemFrameDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/TotemFrameDecoder.java b/src/org/traccar/protocol/TotemFrameDecoder.java index 4889fbe0f..5ac3064e6 100644 --- a/src/org/traccar/protocol/TotemFrameDecoder.java +++ b/src/org/traccar/protocol/TotemFrameDecoder.java @@ -40,7 +40,7 @@ public class TotemFrameDecoder extends FrameDecoder { } // Read message - int length = Integer.parseInt(buf.toString(2, 2, Charset.defaultCharset()), 16); + int length = Integer.parseInt(buf.toString(buf.readerIndex() + 2, 2, Charset.defaultCharset()), 16); if (length <= buf.readableBytes()) { return buf.readBytes(length); } -- cgit v1.2.3