aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-05-04 00:53:41 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-05-04 09:54:16 +1200
commit4713a115fbe4a37ddf24e96edeab800843607f90 (patch)
tree81bd42dd543e5d21e4c1b9fd9a05fc715b1edbaa /src/org/traccar
parent2c8f3ec81886f8d512088db307b7a4c5f5aee7a0 (diff)
downloadtrackermap-server-4713a115fbe4a37ddf24e96edeab800843607f90.tar.gz
trackermap-server-4713a115fbe4a37ddf24e96edeab800843607f90.tar.bz2
trackermap-server-4713a115fbe4a37ddf24e96edeab800843607f90.zip
Revert Atrack ack messages change
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/AtrackProtocolDecoder.java12
1 files changed, 3 insertions, 9 deletions
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());