From 4713a115fbe4a37ddf24e96edeab800843607f90 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 4 May 2018 00:53:41 +1200 Subject: Revert Atrack ack messages change --- src/org/traccar/protocol/AtrackProtocolDecoder.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java index b0f094103..ac208c0f2 100644 --- a/src/org/traccar/protocol/AtrackProtocolDecoder.java +++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java @@ -21,7 +21,6 @@ import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.Context; import org.traccar.DeviceSession; -import org.traccar.helper.DataConverter; import org.traccar.helper.DateBuilder; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; @@ -411,21 +410,16 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder { return positions; } - private void sendResponse(Channel channel, SocketAddress remoteAddress) { - if (channel != null) { - channel.write(ChannelBuffers.wrappedBuffer(DataConverter.parseHex("fe02")), remoteAddress); - } - } - @Override protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { ChannelBuffer buf = (ChannelBuffer) msg; - sendResponse(channel, remoteAddress); - if (buf.getUnsignedShort(buf.readerIndex()) == 0xfe02) { + if (channel != null) { + channel.write(buf, remoteAddress); // keep-alive message + } return null; } else if (buf.getByte(buf.readerIndex()) == '$') { return decodeInfo(channel, remoteAddress, buf.toString(StandardCharsets.US_ASCII).trim()); -- cgit v1.2.3