aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-28 07:56:40 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-08-28 07:56:40 +1200
commit879a25f09033068eb8cb174c1cb3150df594f2e4 (patch)
treecaaffd94dfe5ee63b120de38e14fe5f211949c2d /src/org
parent1756cad4ad66f1b5e932c51a8c0891e27d705ec6 (diff)
downloadtraccar-server-879a25f09033068eb8cb174c1cb3150df594f2e4.tar.gz
traccar-server-879a25f09033068eb8cb174c1cb3150df594f2e4.tar.bz2
traccar-server-879a25f09033068eb8cb174c1cb3150df594f2e4.zip
Make T55 response optional
Diffstat (limited to 'src/org')
-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");
}