mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
- controlapi: add possibility to check status of remote control
This commit is contained in:
@@ -1655,6 +1655,16 @@ ok<br>
|
|||||||
<div class="title1"><a name="rc"></a><b>Fernbedienung</b></div>
|
<div class="title1"><a name="rc"></a><b>Fernbedienung</b></div>
|
||||||
<div class="URL">Handler: http://box_ip/control/rc</div>
|
<div class="URL">Handler: http://box_ip/control/rc</div>
|
||||||
<br>
|
<br>
|
||||||
|
<b>Parameter:</b>keine/status<br>
|
||||||
|
<b>Rückgabe:</b>on/off<br>
|
||||||
|
<br>
|
||||||
|
Zeigt den Status der Fernbedienung<br>
|
||||||
|
<div class="example">
|
||||||
|
Beispiel:<br>
|
||||||
|
<br>
|
||||||
|
http://box_ip/control/rc?status<br>
|
||||||
|
on<br>
|
||||||
|
</div>
|
||||||
<b>Parameter:</b> lock<br>
|
<b>Parameter:</b> lock<br>
|
||||||
<b>Rückgabe:</b> ok<br>
|
<b>Rückgabe:</b> ok<br>
|
||||||
<br>
|
<br>
|
||||||
@@ -1674,7 +1684,6 @@ Beispiel:<br>
|
|||||||
<br>
|
<br>
|
||||||
http://box_ip/control/rc?unlock<br>
|
http://box_ip/control/rc?unlock<br>
|
||||||
ok<br>
|
ok<br>
|
||||||
<br>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ----------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------- -->
|
||||||
|
@@ -496,23 +496,34 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh)
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CControlAPI::RCCGI(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)
|
if (!locked)
|
||||||
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD);
|
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)
|
if (locked)
|
||||||
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD);
|
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD);
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
|
{
|
||||||
hh->SendError();
|
hh->SendError();
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
hh->SendOk();
|
hh->SendOk();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user