aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <atananaev@lyft.com>2020-12-29 11:27:46 -0800
committerAnton Tananaev <atananaev@lyft.com>2020-12-29 11:27:46 -0800
commitd97c43c29e96503d1ba943ec780cd6f8d419a0dd (patch)
tree8cd2be61ecd202afda031822ec555e6e64ff45d2 /src/main/java/org/traccar/protocol
parentc0dee04079cb2edb855e6eeeab9cb6f1b43fa465 (diff)
downloadtrackermap-server-d97c43c29e96503d1ba943ec780cd6f8d419a0dd.tar.gz
trackermap-server-d97c43c29e96503d1ba943ec780cd6f8d419a0dd.tar.bz2
trackermap-server-d97c43c29e96503d1ba943ec780cd6f8d419a0dd.zip
Migrate remaining int keys
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/H02Protocol.java5
-rw-r--r--src/main/java/org/traccar/protocol/SkypatrolProtocolDecoder.java5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/H02Protocol.java b/src/main/java/org/traccar/protocol/H02Protocol.java
index b897d83ad..a5246abc6 100644
--- a/src/main/java/org/traccar/protocol/H02Protocol.java
+++ b/src/main/java/org/traccar/protocol/H02Protocol.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2019 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 2020 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import org.traccar.BaseProtocol;
import org.traccar.Context;
import org.traccar.PipelineBuilder;
import org.traccar.TrackerServer;
+import org.traccar.config.Keys;
import org.traccar.model.Command;
public class H02Protocol extends BaseProtocol {
@@ -35,7 +36,7 @@ public class H02Protocol extends BaseProtocol {
addServer(new TrackerServer(false, getName()) {
@Override
protected void addProtocolHandlers(PipelineBuilder pipeline) {
- int messageLength = Context.getConfig().getInteger(getName() + ".messageLength");
+ int messageLength = Context.getConfig().getInteger(Keys.PROTOCOL_MESSAGE_LENGTH.withPrefix(getName()));
pipeline.addLast(new H02FrameDecoder(messageLength));
pipeline.addLast(new StringEncoder());
pipeline.addLast(new H02ProtocolEncoder(H02Protocol.this));
diff --git a/src/main/java/org/traccar/protocol/SkypatrolProtocolDecoder.java b/src/main/java/org/traccar/protocol/SkypatrolProtocolDecoder.java
index 3c7ca6dc5..8aae310bb 100644
--- a/src/main/java/org/traccar/protocol/SkypatrolProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/SkypatrolProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2020 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ import org.traccar.BaseProtocolDecoder;
import org.traccar.Context;
import org.traccar.DeviceSession;
import org.traccar.Protocol;
+import org.traccar.config.Keys;
import org.traccar.helper.BitUtil;
import org.traccar.helper.DateBuilder;
import org.traccar.model.Position;
@@ -38,7 +39,7 @@ public class SkypatrolProtocolDecoder extends BaseProtocolDecoder {
public SkypatrolProtocolDecoder(Protocol protocol) {
super(protocol);
- defaultMask = Context.getConfig().getInteger(getProtocolName() + ".mask");
+ defaultMask = Context.getConfig().getInteger(Keys.PROTOCOL_MASK.withPrefix(getProtocolName()));
}
private static double convertCoordinate(long coordinate) {