From 09b4183fd7ba546209d422d53ea07e273bec26f3 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 26 Oct 2015 13:29:37 +1300 Subject: Use hexDump instead of readHexString --- src/org/traccar/protocol/H02ProtocolDecoder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/protocol/H02ProtocolDecoder.java') diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index 29b4eadb7..4cb197c3d 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -19,6 +19,7 @@ import java.net.SocketAddress; import java.nio.charset.Charset; import java.util.regex.Pattern; import org.jboss.netty.buffer.ChannelBuffer; +import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.helper.BitUtil; @@ -76,7 +77,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { buf.readByte(); // marker - if (!identify(ChannelBufferTools.readHexString(buf, 10), channel)) { + if (!identify(ChannelBuffers.hexDump(buf.readBytes(5)), channel)) { return null; } position.setDeviceId(getDeviceId()); -- cgit v1.2.3