diff options
author | parveenkumaryadav <parveenkumardeeva@gmail.com> | 2018-04-13 10:59:55 +0530 |
---|---|---|
committer | parveenkumaryadav <parveenkumardeeva@gmail.com> | 2018-04-13 10:59:55 +0530 |
commit | 1313ec644a58c3988528a27491c16602094286bf (patch) | |
tree | bafa77d01a6f6e3768994448ce533e8a2328ac16 /src/org/traccar | |
parent | d448823edd0e8a7833c79b980cfe9778b849843a (diff) | |
download | trackermap-server-1313ec644a58c3988528a27491c16602094286bf.tar.gz trackermap-server-1313ec644a58c3988528a27491c16602094286bf.tar.bz2 trackermap-server-1313ec644a58c3988528a27491c16602094286bf.zip |
Tk103 Output Control command support added
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/Tk103Protocol.java | 3 | ||||
-rw-r--r-- | src/org/traccar/protocol/Tk103ProtocolEncoder.java | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Tk103Protocol.java b/src/org/traccar/protocol/Tk103Protocol.java index 6ef9c0a56..e23982c74 100644 --- a/src/org/traccar/protocol/Tk103Protocol.java +++ b/src/org/traccar/protocol/Tk103Protocol.java @@ -47,7 +47,8 @@ public class Tk103Protocol extends BaseProtocol { Command.TYPE_REBOOT_DEVICE, Command.TYPE_SET_ODOMETER, Command.TYPE_ENGINE_STOP, - Command.TYPE_ENGINE_RESUME); + Command.TYPE_ENGINE_RESUME, + Command.TYPE_OUTPUT_CONTROL); } @Override diff --git a/src/org/traccar/protocol/Tk103ProtocolEncoder.java b/src/org/traccar/protocol/Tk103ProtocolEncoder.java index 946f3ad73..3375d4ee4 100644 --- a/src/org/traccar/protocol/Tk103ProtocolEncoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolEncoder.java @@ -97,6 +97,14 @@ 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: + if (command.getAttributes().containsKey(Command.KEY_DATA)) { + if (command.getAttributes().get(Command.KEY_DATA).equals("1")) { + return formatCommand(command, "({%s}AV001)", Command.KEY_UNIQUE_ID); + } else { + return formatCommand(command, "({%s}AV000)", Command.KEY_UNIQUE_ID); + } + } default: Log.warning(new UnsupportedOperationException(command.getType())); return null; |