aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org
diff options
context:
space:
mode:
authorseym45 <seym45@gmail.com>2023-08-29 15:49:43 +0400
committerseym45 <seym45@gmail.com>2023-08-29 15:49:43 +0400
commit0f38debb59b40ea9eeb89b93cdd4aeced2567f6d (patch)
tree46e9cf2dfeb6be94894e1634e3ab1e4a86b1d54a /src/main/java/org
parent0b1b54428a6f3cc66dd1aed57de05545e4e7d30a (diff)
downloadtrackermap-server-0f38debb59b40ea9eeb89b93cdd4aeced2567f6d.tar.gz
trackermap-server-0f38debb59b40ea9eeb89b93cdd4aeced2567f6d.tar.bz2
trackermap-server-0f38debb59b40ea9eeb89b93cdd4aeced2567f6d.zip
Use already existing keys to get params
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/traccar/model/Command.java3
-rw-r--r--src/main/java/org/traccar/protocol/GatorProtocolEncoder.java7
2 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/model/Command.java b/src/main/java/org/traccar/model/Command.java
index 5b81fcfef..900436a01 100644
--- a/src/main/java/org/traccar/model/Command.java
+++ b/src/main/java/org/traccar/model/Command.java
@@ -72,9 +72,6 @@ public class Command extends BaseCommand {
public static final String KEY_UNIQUE_ID = "uniqueId";
public static final String KEY_FREQUENCY = "frequency";
- public static final String KEY_ENGINE_OFF_INTERVAL = "engine_off_interval";
- public static final String KEY_ENGINE_ON_INTERVAL = "engine_on_interval";
- public static final String KEY_HEARTBEAT_INTERVAL = "heartbeat_interval";
public static final String KEY_LANGUAGE = "language";
public static final String KEY_TIMEZONE = "timezone";
public static final String KEY_DEVICE_PASSWORD = "devicePassword";
diff --git a/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java b/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
index d613b30c2..4a3e21d85 100644
--- a/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
@@ -88,9 +88,10 @@ public class GatorProtocolEncoder extends BaseProtocolEncoder {
content.writeShort(command.getInteger(Command.KEY_DATA));
return encodeContent(command.getDeviceId(), GatorProtocolDecoder.MSG_SET_ODOMETER, content);
case Command.TYPE_POSITION_PERIODIC:
- content.writeShort(command.getInteger(Command.KEY_ENGINE_ON_INTERVAL));
- content.writeShort(command.getInteger(Command.KEY_ENGINE_OFF_INTERVAL));
- content.writeByte(command.getInteger(Command.KEY_HEARTBEAT_INTERVAL));
+ String[] data = command.getString(Command.KEY_FREQUENCY).split(";");
+ content.writeShort(Integer.valueOf(data[0]));
+ content.writeShort(Integer.valueOf(data[1]));
+ content.writeShort(Integer.valueOf(data[2]));
return encodeContent(command.getDeviceId(), GatorProtocolDecoder.MSG_POSITION_PERIODIC, content);
default:
return null;