aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/GatorProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/GatorProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/GatorProtocolDecoder.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/GatorProtocolDecoder.java b/src/org/traccar/protocol/GatorProtocolDecoder.java
index b38214457..5841f6fad 100644
--- a/src/org/traccar/protocol/GatorProtocolDecoder.java
+++ b/src/org/traccar/protocol/GatorProtocolDecoder.java
@@ -15,11 +15,12 @@
*/
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.Unpooled;
+import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
+import org.traccar.NetworkMessage;
import org.traccar.helper.BcdUtil;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.UnitsConverter;
@@ -58,7 +59,7 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder {
private void sendResponse(Channel channel, SocketAddress remoteAddress, byte calibration) {
if (channel != null) {
- ChannelBuffer response = ChannelBuffers.dynamicBuffer();
+ ByteBuf response = Unpooled.buffer();
response.writeByte(0x24); response.writeByte(0x24); // header
response.writeByte(MSG_HEARTBEAT); // size
response.writeShort(5);
@@ -67,7 +68,7 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder {
response.writeByte(0); // slave order
response.writeByte(1); // calibration
response.writeByte(0x0D);
- channel.write(response, remoteAddress);
+ channel.write(new NetworkMessage(response, remoteAddress));
}
}
@@ -75,7 +76,7 @@ public class GatorProtocolDecoder 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
int type = buf.readUnsignedByte();