aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2022-01-03 13:42:04 -0800
committerGitHub <noreply@github.com>2022-01-03 13:42:04 -0800
commit4873b53337def07db8b603c3a871d76565dfd80e (patch)
tree11aae1cca96dbc6ff76eae060ea8f02886607bb0 /src/main/java
parent605374f7e8ef48b4bf6de445d536378f6be9ae1c (diff)
parent1eb5988991f98ecbcef33f53713e2cd452cc2014 (diff)
downloadtrackermap-server-4873b53337def07db8b603c3a871d76565dfd80e.tar.gz
trackermap-server-4873b53337def07db8b603c3a871d76565dfd80e.tar.bz2
trackermap-server-4873b53337def07db8b603c3a871d76565dfd80e.zip
Merge pull request #4787 from jinzo/feature/totemtek-commands
Totem - add some basic commands
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/TotemProtocol.java5
-rw-r--r--src/main/java/org/traccar/protocol/TotemProtocolEncoder.java10
2 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/TotemProtocol.java b/src/main/java/org/traccar/protocol/TotemProtocol.java
index f8cda8358..7cf30475b 100644
--- a/src/main/java/org/traccar/protocol/TotemProtocol.java
+++ b/src/main/java/org/traccar/protocol/TotemProtocol.java
@@ -26,6 +26,11 @@ public class TotemProtocol extends BaseProtocol {
public TotemProtocol() {
setSupportedDataCommands(
+ Command.TYPE_CUSTOM,
+ Command.TYPE_REBOOT_DEVICE,
+ Command.TYPE_FACTORY_RESET,
+ Command.TYPE_GET_VERSION,
+ Command.TYPE_POSITION_SINGLE,
Command.TYPE_ENGINE_RESUME,
Command.TYPE_ENGINE_STOP
);
diff --git a/src/main/java/org/traccar/protocol/TotemProtocolEncoder.java b/src/main/java/org/traccar/protocol/TotemProtocolEncoder.java
index a96dd1ee3..4717c3920 100644
--- a/src/main/java/org/traccar/protocol/TotemProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/TotemProtocolEncoder.java
@@ -32,6 +32,16 @@ public class TotemProtocolEncoder extends StringProtocolEncoder {
initDevicePassword(command, "000000");
switch (command.getType()) {
+ case Command.TYPE_CUSTOM:
+ return formatCommand(command, "*%s,%s#", Command.KEY_DEVICE_PASSWORD, Command.KEY_DATA);
+ case Command.TYPE_REBOOT_DEVICE:
+ return formatCommand(command, "*%s,006#", Command.KEY_DEVICE_PASSWORD);
+ case Command.TYPE_FACTORY_RESET:
+ return formatCommand(command, "*%s,007#", Command.KEY_DEVICE_PASSWORD);
+ case Command.TYPE_GET_VERSION:
+ return formatCommand(command, "*%s,056#", Command.KEY_DEVICE_PASSWORD);
+ case Command.TYPE_POSITION_SINGLE:
+ return formatCommand(command, "*%s,012#", Command.KEY_DEVICE_PASSWORD);
// Assuming PIN 8 (Output C) is the power wire, like manual says but it can be PIN 5,7,8
case Command.TYPE_ENGINE_STOP:
return formatCommand(command, "*%s,025,C,1#", Command.KEY_DEVICE_PASSWORD);