From 879a25f09033068eb8cb174c1cb3150df594f2e4 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 28 Aug 2017 07:56:40 +1200 Subject: Make T55 response optional --- src/org/traccar/protocol/T55ProtocolDecoder.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java index dee7210b1..43e1a57f7 100644 --- a/src/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/org/traccar/protocol/T55ProtocolDecoder.java @@ -18,6 +18,7 @@ package org.traccar.protocol; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.socket.DatagramChannel; import org.traccar.BaseProtocolDecoder; +import org.traccar.Context; import org.traccar.DeviceSession; import org.traccar.helper.DateBuilder; import org.traccar.helper.Parser; @@ -30,8 +31,11 @@ import java.util.regex.Pattern; public class T55ProtocolDecoder extends BaseProtocolDecoder { + private final boolean ack; + public T55ProtocolDecoder(T55Protocol protocol) { super(protocol); + ack = Context.getConfig().getBoolean(getProtocolName() + ".ack"); } private static final Pattern PATTERN_GPRMC = new PatternBuilder() @@ -98,7 +102,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { private Position decodeGprmc( DeviceSession deviceSession, String sentence, SocketAddress remoteAddress, Channel channel) { - if (channel != null && !(channel instanceof DatagramChannel)) { + if (ack && channel != null && !(channel instanceof DatagramChannel)) { channel.write("OK1\r\n"); } -- cgit v1.2.3