diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-07 16:48:41 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-07 16:48:41 +1200 |
commit | 7e324a9dfb2bcde08d1524a9f3dc5114c0d49bdc (patch) | |
tree | 0e5cba2fe3cc600478fb5f536e9abf485ef976d7 /src/org/traccar/protocol/H02ProtocolDecoder.java | |
parent | a9be10be1cf3709a6f6eb5d612c2f5485f12749e (diff) | |
download | trackermap-server-7e324a9dfb2bcde08d1524a9f3dc5114c0d49bdc.tar.gz trackermap-server-7e324a9dfb2bcde08d1524a9f3dc5114c0d49bdc.tar.bz2 trackermap-server-7e324a9dfb2bcde08d1524a9f3dc5114c0d49bdc.zip |
Migrate H, I, J, K protocols
Diffstat (limited to 'src/org/traccar/protocol/H02ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/H02ProtocolDecoder.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index 54671bdbf..e6fd86897 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -15,9 +15,9 @@ */ package org.traccar.protocol; -import org.jboss.netty.buffer.ChannelBuffer; -import org.jboss.netty.buffer.ChannelBuffers; -import org.jboss.netty.channel.Channel; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufUtil; +import io.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; import org.traccar.helper.BcdUtil; @@ -40,7 +40,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { super(protocol); } - private static double readCoordinate(ChannelBuffer buf, boolean lon) { + private static double readCoordinate(ByteBuf buf, boolean lon) { int degrees = BcdUtil.readInteger(buf, 2); if (lon) { @@ -99,14 +99,14 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { } } - private Position decodeBinary(ChannelBuffer buf, Channel channel, SocketAddress remoteAddress) { + private Position decodeBinary(ByteBuf buf, Channel channel, SocketAddress remoteAddress) { Position position = new Position(getProtocolName()); buf.readByte(); // marker DeviceSession deviceSession = getDeviceSession( - channel, remoteAddress, ChannelBuffers.hexDump(buf.readBytes(5))); + channel, remoteAddress, ByteBufUtil.hexDump(buf.readBytes(5))); if (deviceSession == null) { return null; } @@ -451,7 +451,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { - ChannelBuffer buf = (ChannelBuffer) msg; + ByteBuf buf = (ByteBuf) msg; String marker = buf.toString(0, 1, StandardCharsets.US_ASCII); switch (marker) { |