aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol/T55ProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/T55ProtocolDecoder.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java b/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java
index 3d892c021..409c7e768 100644
--- a/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java
@@ -17,6 +17,8 @@ package org.traccar.protocol;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
+import org.traccar.config.Keys;
+import org.traccar.helper.model.AttributeUtil;
import org.traccar.session.DeviceSession;
import org.traccar.NetworkMessage;
import org.traccar.Protocol;
@@ -128,10 +130,12 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder {
private Position decodeGprmc(
DeviceSession deviceSession, String sentence, SocketAddress remoteAddress, Channel channel) {
- if (deviceSession != null && channel != null && !(channel instanceof DatagramChannel)
- && getIdentityManager().lookupAttributeBoolean(
- deviceSession.getDeviceId(), getProtocolName() + ".ack", false, false, true)) {
- channel.writeAndFlush(new NetworkMessage("OK1\r\n", remoteAddress));
+ if (deviceSession != null && channel != null && !(channel instanceof DatagramChannel)) {
+ boolean ack = AttributeUtil.lookup(
+ getCacheManager(), Keys.PROTOCOL_ACK.withPrefix(getProtocolName()), deviceSession.getDeviceId());
+ if (ack) {
+ channel.writeAndFlush(new NetworkMessage("OK1\r\n", remoteAddress));
+ }
}
Parser parser = new Parser(PATTERN_GPRMC, sentence);