diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-05-08 15:23:21 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-05-08 15:23:21 -0700 |
commit | ecbb40a86bb32005a734fd2da33890f4fd076901 (patch) | |
tree | 3d736904975a8e5e1375894f0bec877ad1822ea4 /src/org/traccar | |
parent | e35ba89765eda5919870b3dfe43230974cf77a5e (diff) | |
download | traccar-server-ecbb40a86bb32005a734fd2da33890f4fd076901.tar.gz traccar-server-ecbb40a86bb32005a734fd2da33890f4fd076901.tar.bz2 traccar-server-ecbb40a86bb32005a734fd2da33890f4fd076901.zip |
Support custom commands for TK103 (fix #3869)
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/Tk103ProtocolEncoder.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolEncoder.java b/src/org/traccar/protocol/Tk103ProtocolEncoder.java index 3ec562cc3..d64c85c2c 100644 --- a/src/org/traccar/protocol/Tk103ProtocolEncoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolEncoder.java @@ -47,6 +47,8 @@ public class Tk103ProtocolEncoder extends StringProtocolEncoder { if (alternative) { switch (command.getType()) { + case Command.TYPE_CUSTOM: + return formatAlt(command, "{%s}", Command.KEY_DATA); case Command.TYPE_GET_VERSION: return formatAlt(command, "*about*"); case Command.TYPE_REBOOT_DEVICE: @@ -57,8 +59,6 @@ public class Tk103ProtocolEncoder extends StringProtocolEncoder { return formatAlt(command, "*routetrack*99*"); case Command.TYPE_POSITION_STOP: return formatAlt(command, "*routetrackoff*"); - case Command.TYPE_CUSTOM: - return formatAlt(command, "{%s}", Command.KEY_DATA); case Command.TYPE_GET_DEVICE_STATUS: return formatAlt(command, "*status*"); case Command.TYPE_IDENTIFICATION: @@ -80,6 +80,8 @@ public class Tk103ProtocolEncoder extends StringProtocolEncoder { } } else { switch (command.getType()) { + case Command.TYPE_CUSTOM: + return formatCommand(command, "({%s}{%s})", Command.KEY_UNIQUE_ID, Command.KEY_DATA); case Command.TYPE_GET_VERSION: return formatCommand(command, "({%s}AP07)", Command.KEY_UNIQUE_ID); case Command.TYPE_REBOOT_DEVICE: |