add neutrino restart to webif

Signed-off-by: GetAway <get-away@t-online.de>
This commit is contained in:
TangoCash
2021-11-08 21:57:24 +01:00
committed by GetAway
parent 27c8115cee
commit d918e6c517
11 changed files with 64 additions and 14 deletions

View File

@@ -188,6 +188,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
{"standby", &CControlAPI::StandbyCGI, "text/plain"},
{"shutdown", &CControlAPI::ShutdownCGI, "text/plain"},
{"reboot", &CControlAPI::RebootCGI, "text/plain"},
{"restart", &CControlAPI::RestartCGI, "text/plain"},
{"getdate", &CControlAPI::GetDateCGI, "text/plain"},
{"gettime", &CControlAPI::GetTimeCGI, "text/plain"},
{"info", &CControlAPI::InfoCGI, "text/plain"},
@@ -879,6 +880,18 @@ void CControlAPI::RebootCGI(CyhookHandler *hh)
hh->SendError();
}
//-----------------------------------------------------------------------------
void CControlAPI::RestartCGI(CyhookHandler *hh)
{
if (hh->ParamList.empty())
{
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::RESTART, CEventServer::INITID_HTTPD);
hh->SendOk();
}
else
hh->SendError();
}
//-----------------------------------------------------------------------------
unsigned int revert_translate(unsigned int code)
{

View File

@@ -111,6 +111,7 @@ private:
void LCDAction(CyhookHandler *hh);
void YWebCGI(CyhookHandler *hh);
void RebootCGI(CyhookHandler *hh);
void RestartCGI(CyhookHandler *hh);
void RCEmCGI(CyhookHandler *hh);
void AspectRatioCGI(CyhookHandler *hh);
void VideoFormatCGI(CyhookHandler *hh);

View File

@@ -131,6 +131,7 @@ CNeutrinoAPI::CNeutrinoAPI()
EventServer = new CEventServer;
EventServer->registerEvent2( NeutrinoMessages::SHUTDOWN, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::REBOOT, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::RESTART, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::STANDBY_ON, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::STANDBY_OFF, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::STANDBY_TOGGLE, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");