diff options
author | Matjaž Črnko <m.crnko@txt.si> | 2021-12-31 17:41:03 +0100 |
---|---|---|
committer | Matjaž Črnko <m.crnko@txt.si> | 2021-12-31 17:41:03 +0100 |
commit | 1eb5988991f98ecbcef33f53713e2cd452cc2014 (patch) | |
tree | 2ca4fbedb3268d31fd9a3d736cab859cec4130ba /src/main/java/org/traccar/protocol/TotemProtocolEncoder.java | |
parent | fe25a2a89533fa39a3df7a4b248dbf25b3a4e845 (diff) | |
download | trackermap-server-1eb5988991f98ecbcef33f53713e2cd452cc2014.tar.gz trackermap-server-1eb5988991f98ecbcef33f53713e2cd452cc2014.tar.bz2 trackermap-server-1eb5988991f98ecbcef33f53713e2cd452cc2014.zip |
feat: Totem - add some basic commands
Diffstat (limited to 'src/main/java/org/traccar/protocol/TotemProtocolEncoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/TotemProtocolEncoder.java | 10 |
1 files changed, 10 insertions, 0 deletions
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); |