diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 8cedb54d7..4a215504f 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -1655,6 +1655,16 @@ ok
Fernbedienung
Handler: http://box_ip/control/rc

+Parameter:keine/status
+Rückgabe:on/off
+
+Zeigt den Status der Fernbedienung
+
+Beispiel:
+
+http://box_ip/control/rc?status
+on
+
Parameter: lock
Rückgabe: ok

@@ -1674,7 +1684,6 @@ Beispiel:

http://box_ip/control/rc?unlock
ok
-
diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index e61f19c61..093b9d1cf 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -496,23 +496,34 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh) //----------------------------------------------------------------------------- void CControlAPI::RCCGI(CyhookHandler *hh) { - if (!(hh->ParamList.empty())) - { - bool locked = CRCLock::getInstance()->isLocked(); + bool locked = CRCLock::getInstance()->isLocked(); - if (hh->ParamList["1"] == "lock"){ // lock remote control + if (hh->ParamList.empty() || hh->ParamList["1"] == "status") + { + if (locked) + hh->WriteLn("off"); + else + hh->WriteLn("on"); + } + else + { + if (hh->ParamList["1"] == "lock") + { if (!locked) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD); } - else if (hh->ParamList["1"] == "unlock"){// unlock remote control + else if (hh->ParamList["1"] == "unlock") + { if (locked) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD); } - else{ + else + { hh->SendError(); + return; } + hh->SendOk(); } - hh->SendOk(); } //-----------------------------------------------------------------------------