From cdf1dfe387b6f682680746a770941d84f52ebd05 Mon Sep 17 00:00:00 2001 From: Alexander Menk Date: Mon, 19 Dec 2016 14:04:54 +0100 Subject: #2702 Implement POSITION_PERIODIC for watch Protocol --- src/org/traccar/protocol/WatchProtocol.java | 4 +++- src/org/traccar/protocol/WatchProtocolEncoder.java | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/org') 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; -- cgit v1.2.3