From 4dcadc5fc5ad5172d90c90290830607c32f88243 Mon Sep 17 00:00:00 2001 From: lado Date: Thu, 20 Oct 2011 03:58:37 +0200 Subject: protocol changes --- .../vdrmanager/utils/svdrp/SetTimerClient.java | 27 ++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SetTimerClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SetTimerClient.java index 0863c6d..c1e0f73 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SetTimerClient.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SetTimerClient.java @@ -10,10 +10,24 @@ import de.bjusystems.vdrmanager.data.Timer; */ public class SetTimerClient extends SvdrpClient { + public enum TimerOperation { + CREATE("C"),// + DELETE("D"),// + MODIFY("M");// + private String command; + private TimerOperation(String command){ + this.command = command; + } + public String getCommand(){ + return this.command; + } + + } + /** channel names for timer */ Timer timer; /** timer should be deleted */ - boolean deleteTimer; + private TimerOperation timerOperation; /** * Constructor @@ -21,10 +35,10 @@ public class SetTimerClient extends SvdrpClient { * @param port port * @param ssl use ssl */ - public SetTimerClient(final Timer timer, final boolean deleteTimer) { + public SetTimerClient(final Timer timer, TimerOperation op) { super(); this.timer = timer; - this.deleteTimer = deleteTimer; + this.timerOperation = op; } /** @@ -36,12 +50,11 @@ public class SetTimerClient extends SvdrpClient { final StringBuilder command = new StringBuilder(); command.append("timer "); - if (deleteTimer) { - command.append("-"); - } + command.append(timerOperation.getCommand()); + command.append(timer.getNumber()); command.append(" "); - command.append(timer.toCommandLine()); + command.append(timer.toCommandLine(timerOperation)); runCommand(command.toString()); } -- cgit v1.2.3