mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 07:22:57 +02:00
controlapi: add possibility to check status of remote control
Origin commit data
------------------
Branch: ni/coolstream
Commit: 3553030bce
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-01-21 (Thu, 21 Jan 2016)
Origin message was:
------------------
- controlapi: add possibility to check status of remote control
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user