aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorseym45 <seym45@gmail.com>2023-07-25 10:56:55 +0400
committerseym45 <seym45@gmail.com>2023-07-25 10:56:55 +0400
commit8c227973608eee7ba5519f22c5781f912dd4e9b5 (patch)
tree10efd69eb73350505a1070e8f0df599aba8dcef3 /src
parent103fbde721753b8be65c39e0e9118943c6bebc68 (diff)
downloadtrackermap-server-8c227973608eee7ba5519f22c5781f912dd4e9b5.tar.gz
trackermap-server-8c227973608eee7ba5519f22c5781f912dd4e9b5.tar.bz2
trackermap-server-8c227973608eee7ba5519f22c5781f912dd4e9b5.zip
Change command type
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/model/Command.java1
-rw-r--r--src/main/java/org/traccar/protocol/GatorProtocol.java2
-rw-r--r--src/main/java/org/traccar/protocol/GatorProtocolEncoder.java4
-rw-r--r--src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java2
4 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/model/Command.java b/src/main/java/org/traccar/model/Command.java
index e0c1c3976..99988dd82 100644
--- a/src/main/java/org/traccar/model/Command.java
+++ b/src/main/java/org/traccar/model/Command.java
@@ -45,7 +45,6 @@ public class Command extends BaseCommand {
public static final String TYPE_SILENCE_TIME = "silenceTime";
public static final String TYPE_SET_PHONEBOOK = "setPhonebook";
public static final String TYPE_MESSAGE = "message";
- public static final String TYPE_ROLLCALL = "rollcall";
public static final String TYPE_VOICE_MESSAGE = "voiceMessage";
public static final String TYPE_OUTPUT_CONTROL = "outputControl";
public static final String TYPE_VOICE_MONITORING = "voiceMonitoring";
diff --git a/src/main/java/org/traccar/protocol/GatorProtocol.java b/src/main/java/org/traccar/protocol/GatorProtocol.java
index c54b1b53d..bb0e017f4 100644
--- a/src/main/java/org/traccar/protocol/GatorProtocol.java
+++ b/src/main/java/org/traccar/protocol/GatorProtocol.java
@@ -29,7 +29,7 @@ public class GatorProtocol extends BaseProtocol {
@Inject
public GatorProtocol(Config config) {
setSupportedDataCommands(
- Command.TYPE_ROLLCALL
+ Command.TYPE_POSITION_SINGLE
);
addServer(new TrackerServer(config, getName(), false) {
@Override
diff --git a/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java b/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
index 125031eee..efe8715e3 100644
--- a/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
@@ -90,11 +90,11 @@ public class GatorProtocolEncoder extends BaseProtocolEncoder {
protected Object encodeCommand(Command command) {
switch (command.getType()) {
- case Command.TYPE_ROLLCALL:
+ // According to Protocol Documentation, 0x30 is for rollcall command
+ case Command.TYPE_POSITION_SINGLE:
return encodeContent(command.getDeviceId(), "30", null);
default:
return null;
}
}
-
}
diff --git a/src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java b/src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java
index 74ac35440..04fce0ac8 100644
--- a/src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java
+++ b/src/test/java/org/traccar/protocol/GatorProtocolEncoderTest.java
@@ -19,7 +19,7 @@ public class GatorProtocolEncoderTest extends ProtocolTest {
var encoder = inject(new GatorProtocolEncoder(null));
Command command = new Command();
command.setDeviceId(13332082112L);
- command.setType(Command.TYPE_ROLLCALL);
+ command.setType(Command.TYPE_POSITION_SINGLE);
verifyCommand(encoder, command, binary("24243000062008958C070D"));
}
}