diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-09 00:11:14 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-09 00:11:14 +1200 |
commit | 46274ffddf31d0f09a7c370b2e374f53f6ecc2b6 (patch) | |
tree | 8d0869a71665898524fc67bfb5940a21a73c07e5 /src/org/traccar/protocol/TzoneProtocolDecoder.java | |
parent | fb543fb413652f4cb0408a6caafbdd7f4a4ca369 (diff) | |
parent | c176b7b4bf4eef6f71767f92ada2591ef27c1cfa (diff) | |
download | traccar-server-46274ffddf31d0f09a7c370b2e374f53f6ecc2b6.tar.gz traccar-server-46274ffddf31d0f09a7c370b2e374f53f6ecc2b6.tar.bz2 traccar-server-46274ffddf31d0f09a7c370b2e374f53f6ecc2b6.zip |
Merge pull request #3921 from Abyss777/netty4_tz-tl
Migrate part of T protocols
Diffstat (limited to 'src/org/traccar/protocol/TzoneProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/TzoneProtocolDecoder.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/org/traccar/protocol/TzoneProtocolDecoder.java b/src/org/traccar/protocol/TzoneProtocolDecoder.java index 984891bb6..4983410a5 100644 --- a/src/org/traccar/protocol/TzoneProtocolDecoder.java +++ b/src/org/traccar/protocol/TzoneProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -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.BitUtil; @@ -57,7 +57,7 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder { } } - private void decodeCards(Position position, ChannelBuffer buf) { + private void decodeCards(Position position, ByteBuf buf) { int index = 1; for (int i = 0; i < 4; i++) { @@ -77,7 +77,7 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder { length += 1; } - String num = ChannelBuffers.hexDump(buf.readBytes(length / 2)); + String num = ByteBufUtil.hexDump(buf.readBytes(length / 2)); if (odd) { num = num.substring(1); @@ -92,7 +92,7 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder { } - private void decodePassengers(Position position, ChannelBuffer buf) { + private void decodePassengers(Position position, ByteBuf buf) { int blockLength = buf.readUnsignedShort(); int blockEnd = buf.readerIndex() + blockLength; @@ -112,7 +112,7 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder { protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { - ChannelBuffer buf = (ChannelBuffer) msg; + ByteBuf buf = (ByteBuf) msg; buf.skipBytes(2); // header buf.readUnsignedShort(); // length @@ -122,7 +122,7 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder { int hardware = buf.readUnsignedShort(); long firmware = buf.readUnsignedInt(); - String imei = ChannelBuffers.hexDump(buf.readBytes(8)).substring(1); + String imei = ByteBufUtil.hexDump(buf.readBytes(8)).substring(1); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, imei); if (deviceSession == null) { return null; |