diff options
Diffstat (limited to 'src/org/traccar/protocol/Tk103ProtocolEncoder.java')
-rw-r--r-- | src/org/traccar/protocol/Tk103ProtocolEncoder.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolEncoder.java b/src/org/traccar/protocol/Tk103ProtocolEncoder.java index 946f3ad73..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: @@ -97,6 +99,8 @@ public class Tk103ProtocolEncoder extends StringProtocolEncoder { return formatCommand(command, "({%s}AV010)", Command.KEY_UNIQUE_ID); case Command.TYPE_ENGINE_RESUME: return formatCommand(command, "({%s}AV011)", Command.KEY_UNIQUE_ID); + case Command.TYPE_OUTPUT_CONTROL: + return formatCommand(command, "({%s}AV00{%s})", Command.KEY_UNIQUE_ID, Command.KEY_DATA); default: Log.warning(new UnsupportedOperationException(command.getType())); return null; |