From 1fe468bf5b004845e8904b66198597d28d37a029 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 12 Jun 2018 13:57:19 +1200 Subject: Migrate new protocols --- src/org/traccar/protocol/RetranslatorFrameDecoder.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/org/traccar/protocol/RetranslatorFrameDecoder.java') diff --git a/src/org/traccar/protocol/RetranslatorFrameDecoder.java b/src/org/traccar/protocol/RetranslatorFrameDecoder.java index 1836fb26e..1ad07b8da 100644 --- a/src/org/traccar/protocol/RetranslatorFrameDecoder.java +++ b/src/org/traccar/protocol/RetranslatorFrameDecoder.java @@ -15,19 +15,18 @@ */ package org.traccar.protocol; -import org.jboss.netty.buffer.ChannelBuffer; -import org.jboss.netty.buffer.ChannelBuffers; -import org.jboss.netty.channel.Channel; -import org.jboss.netty.channel.ChannelHandlerContext; -import org.jboss.netty.handler.codec.frame.FrameDecoder; +import io.netty.buffer.ByteBuf; +import io.netty.channel.Channel; +import io.netty.channel.ChannelHandlerContext; +import org.traccar.BaseFrameDecoder; -public class RetranslatorFrameDecoder extends FrameDecoder { +public class RetranslatorFrameDecoder extends BaseFrameDecoder { @Override protected Object decode( - ChannelHandlerContext ctx, Channel channel, ChannelBuffer buf) throws Exception { + ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception { - int length = 4 + ChannelBuffers.swapInt(buf.getInt(buf.readerIndex())); + int length = 4 + buf.getIntLE(buf.readerIndex()); if (buf.readableBytes() >= length) { return buf.readBytes(length); } else { -- cgit v1.2.3