summaryrefslogtreecommitdiff
path: root/vdr-androvdr/handler.cpp
diff options
context:
space:
mode:
authorbju <bju@maxi.fritz.box>2011-03-31 00:39:54 +0200
committerbju <bju@maxi.fritz.box>2011-03-31 00:39:54 +0200
commit1f38710cbed1e6fd6507376e3cb5c5b3c509de39 (patch)
treeb1239d478248453a5f38e947d340ff81e9889f08 /vdr-androvdr/handler.cpp
parent99c8ef0c1bd6551bbb39658c0c7fe2a4e0b09e3f (diff)
downloadvdr-manager-1f38710cbed1e6fd6507376e3cb5c5b3c509de39.tar.gz
vdr-manager-1f38710cbed1e6fd6507376e3cb5c5b3c509de39.tar.bz2
Renamed from androvdr to vdrmanager
Diffstat (limited to 'vdr-androvdr/handler.cpp')
-rw-r--r--vdr-androvdr/handler.cpp92
1 files changed, 0 insertions, 92 deletions
diff --git a/vdr-androvdr/handler.cpp b/vdr-androvdr/handler.cpp
deleted file mode 100644
index 18f6e02..0000000
--- a/vdr-androvdr/handler.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * event und message handler
- */
-
-#include <unistd.h>
-#include <vdr/plugin.h>
-#include <vdr/timers.h>
-#include "sock.h"
-#include "select.h"
-#include "androvdrthread.h"
-#include "helpers.h"
-
-bool cHandler::HandleNewClient(cVdrmanagerClientSocket * sock)
-{
- return true;
-}
-
-bool cHandler::HandleClientRequest(cVdrmanagerClientSocket * sock)
-{
- while(sock->Read())
- {
- // get lines
- while (sock->IsLineComplete())
- {
- string line;
- sock->GetLine(line);
-
- // parse request
- size_t space = line.find(' ');
- string cmd;
- string args;
- if (space != string::npos) {
- cmd = cHelpers::ToUpper(line.substr(0, space));
- args = cHelpers::Trim(line.substr(space+1));
- } else {
- cmd = cHelpers::ToUpper(line);
- args = "";
- }
-
- if (!sock->IsLoggedIn() && cmd != "PASSWD") {
- sock->PutLine("!ERROR\r\n");
- }
- else if (cmd == "PASSWD")
- {
- if (args != sock->GetPassword()) {
- sock->PutLine("!ERROR\r\n");
- } else {
- sock->SetLoggedIn();
- sock->PutLine("!OK\r\n");
- }
- }
- else if (cmd == "TIMERS")
- {
- string text = cHelpers::GetTimers(args);
- sock->PutLine(text);
- }
- else if (cmd == "CHANNELS")
- {
- string text = cHelpers::GetChannels(args);
- sock->PutLine(text);
- }
- else if (cmd == "TEVENTS")
- {
- string text = cHelpers::GetTimeEvents(args);
- sock->PutLine(text);
- }
- else if (cmd == "CEVENTS")
- {
- string text = cHelpers::GetChannelEvents(args);
- sock->PutLine(text);
- }
- else if (cmd == "TIMER")
- {
- string text = cHelpers::SetTimer(args);
- sock->PutLine(text);
- }
- else if (cmd == "SEARCH")
- {
- string text = cHelpers::SearchEvents(args);
- sock->PutLine(text);
- }
- else if (cmd == "QUIT")
- {
- // close socket
- sock->PutLine(string("Good bye! :-)\n"));
- sock->Disconnect();
- }
- }
- }
-
- return true;
-}