aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-05-08 15:23:21 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2018-05-08 15:23:21 -0700
commitecbb40a86bb32005a734fd2da33890f4fd076901 (patch)
tree3d736904975a8e5e1375894f0bec877ad1822ea4 /src/org/traccar
parente35ba89765eda5919870b3dfe43230974cf77a5e (diff)
downloadtraccar-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.java6
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: