aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAlexander Menk <menk@mestrona.net>2016-12-19 14:04:54 +0100
committerAlexander Menk <menk@mestrona.net>2016-12-19 14:04:54 +0100
commitcdf1dfe387b6f682680746a770941d84f52ebd05 (patch)
tree9849ad6194bddecf1d0baa953adaff609cf2d3c1 /src/org/traccar
parent037c56737afbae584a0e7637094ea0aa1b359675 (diff)
downloadtrackermap-server-cdf1dfe387b6f682680746a770941d84f52ebd05.tar.gz
trackermap-server-cdf1dfe387b6f682680746a770941d84f52ebd05.tar.bz2
trackermap-server-cdf1dfe387b6f682680746a770941d84f52ebd05.zip
#2702 Implement POSITION_PERIODIC for watch Protocol
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/WatchProtocol.java4
-rw-r--r--src/org/traccar/protocol/WatchProtocolEncoder.java2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/WatchProtocol.java b/src/org/traccar/protocol/WatchProtocol.java
index b13fcfb11..8b7d1ee9f 100644
--- a/src/org/traccar/protocol/WatchProtocol.java
+++ b/src/org/traccar/protocol/WatchProtocol.java
@@ -32,6 +32,7 @@ public class WatchProtocol extends BaseProtocol {
super("watch");
setSupportedCommands(
Command.TYPE_POSITION_SINGLE,
+ Command.TYPE_POSITION_PERIODIC,
Command.TYPE_SOS_NUMBER,
Command.TYPE_ALARM_SOS,
Command.TYPE_ALARM_BATTERY,
@@ -40,7 +41,8 @@ public class WatchProtocol extends BaseProtocol {
Command.TYPE_SILENCE_TIME,
Command.TYPE_ALARM_CLOCK,
Command.TYPE_SET_PHONEBOOK,
- Command.TYPE_VOICE_MESSAGE);
+ Command.TYPE_VOICE_MESSAGE
+ );
}
@Override
diff --git a/src/org/traccar/protocol/WatchProtocolEncoder.java b/src/org/traccar/protocol/WatchProtocolEncoder.java
index 0b6a83ce9..41f189a89 100644
--- a/src/org/traccar/protocol/WatchProtocolEncoder.java
+++ b/src/org/traccar/protocol/WatchProtocolEncoder.java
@@ -102,6 +102,8 @@ public class WatchProtocolEncoder extends StringProtocolEncoder {
return formatCommand(command, "PHB,{%s}", Command.KEY_DATA);
case Command.TYPE_VOICE_MESSAGE:
return formatCommand(command, "TK," + getBinaryData(command));
+ case Command.TYPE_POSITION_PERIODIC:
+ return formatCommand(command, "UPLOAD,{%s}", Command.KEY_FREQUENCY);
default:
Log.warning(new UnsupportedOperationException(command.getType()));
break;