aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/T55ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/T55ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/T55ProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
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");
}