From e7d203230ff48e849b0b50a858c73bab8c2dd2e5 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 28 Aug 2014 21:58:03 +1200 Subject: Fix GT06 frame decoder --- src/org/traccar/protocol/Gt06FrameDecoder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/Gt06FrameDecoder.java b/src/org/traccar/protocol/Gt06FrameDecoder.java index bf487dc85..e0bb3b373 100644 --- a/src/org/traccar/protocol/Gt06FrameDecoder.java +++ b/src/org/traccar/protocol/Gt06FrameDecoder.java @@ -36,9 +36,9 @@ public class Gt06FrameDecoder extends FrameDecoder { int length = 2 + 2; // head and tail if (buf.getByte(buf.readerIndex()) == 0x78) { - length += 1 + buf.getByte(buf.readerIndex() + 2); + length += 1 + buf.getUnsignedByte(buf.readerIndex() + 2); } else { - length += 2 + buf.getShort(buf.readerIndex() + 2); + length += 2 + buf.getUnsignedShort(buf.readerIndex() + 2); } // Check length and return buffer -- cgit v1.2.3