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/CityeasyProtocolDecoder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/protocol/CityeasyProtocolDecoder.java') diff --git a/src/org/traccar/protocol/CityeasyProtocolDecoder.java b/src/org/traccar/protocol/CityeasyProtocolDecoder.java index d4235c191..93ef9a842 100644 --- a/src/org/traccar/protocol/CityeasyProtocolDecoder.java +++ b/src/org/traccar/protocol/CityeasyProtocolDecoder.java @@ -22,6 +22,7 @@ import java.util.TimeZone; import java.util.regex.Matcher; 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.ChannelBufferTools; @@ -70,7 +71,7 @@ public class CityeasyProtocolDecoder extends BaseProtocolDecoder { buf.skipBytes(2); // header buf.readUnsignedShort(); // length - String imei = ChannelBufferTools.readHexString(buf, 14); + String imei = ChannelBuffers.hexDump(buf.readBytes(7)); if (!identify(imei, channel, null, false) && !identify(imei + Checksum.luhn(Long.parseLong(imei)), channel)) { return null; } -- cgit v1.2.3