aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-30 14:04:24 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-30 14:04:24 -0700
commit014cf82a9e63a36e944e293932f9edf27e452919 (patch)
tree7ac5899f535fbf47e66dc1321738c951473a009b /src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
parentce661ec77a957b70c15509c6801e6f34b32ad11d (diff)
downloadtrackermap-server-014cf82a9e63a36e944e293932f9edf27e452919.tar.gz
trackermap-server-014cf82a9e63a36e944e293932f9edf27e452919.tar.bz2
trackermap-server-014cf82a9e63a36e944e293932f9edf27e452919.zip
No context dependency for decoder
Diffstat (limited to 'src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
index 280986165..72d3ef592 100644
--- a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
@@ -16,7 +16,6 @@
package org.traccar.protocol;
import org.traccar.BaseProtocolDecoder;
-import org.traccar.Context;
import org.traccar.DeviceSession;
import org.traccar.NetworkMessage;
import org.traccar.Protocol;
@@ -46,11 +45,15 @@ import java.util.regex.Pattern;
public class Gl200TextProtocolDecoder extends BaseProtocolDecoder {
- private final boolean ignoreFixTime;
+ private boolean ignoreFixTime;
public Gl200TextProtocolDecoder(Protocol protocol) {
super(protocol);
- ignoreFixTime = Context.getConfig().getBoolean(Keys.PROTOCOL_IGNORE_FIX_TIME.withPrefix(getProtocolName()));
+ }
+
+ @Override
+ protected void init() {
+ ignoreFixTime = getConfig().getBoolean(Keys.PROTOCOL_IGNORE_FIX_TIME.withPrefix(getProtocolName()));
}
private static final Pattern PATTERN_ACK = new PatternBuilder()
@@ -1333,7 +1336,7 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder {
}
}
- if (channel != null && Context.getConfig().getBoolean(Keys.PROTOCOL_ACK.withPrefix(getProtocolName()))) {
+ if (channel != null && getConfig().getBoolean(Keys.PROTOCOL_ACK.withPrefix(getProtocolName()))) {
String checksum;
if (sentence.endsWith("$")) {
checksum = sentence.substring(sentence.length() - 1 - 4, sentence.length() - 1);