From 4bc3849e210a0dc1e828b393bee9601f4fa54360 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 21 Oct 2010 06:27:59 +0000 Subject: [PATCH] add reloadsetup (neutrino.conf) to nhttpd controlapi git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@849 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3bf282f8d481610036ad696780f355774a694cb1 Author: Jacek Jendrzej Date: 2010-10-21 (Thu, 21 Oct 2010) Origin message was: ------------------ -add reloadsetup (neutrino.conf) to nhttpd controlapi git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@849 e54a6e83-5905-42d5-8d5c-058d10e6a962 ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 4 ++++ src/neutrino.cpp | 8 ++++++++ src/neutrinoMessages.h | 1 + src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 8 ++++++++ src/nhttpd/tuxboxapi/coolstream/controlapi.h | 1 + src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp | 1 + 6 files changed, 23 insertions(+) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 128c79db7..ebe23a612 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -817,6 +817,10 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 *msg = NeutrinoMessages::UNLOCK_RC; *data = 0; break; + case NeutrinoMessages::RELOAD_SETUP : + *msg = NeutrinoMessages::RELOAD_SETUP; + *data = 0; + break; default: printf("[neutrino] event INITID_HTTPD - unknown eventID 0x%x\n", emsg.eventID ); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index ef04234a0..bc17d5558 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3570,6 +3570,14 @@ printf("NeutrinoMessages::EVT_BOUQUETSCHANGED\n");fflush(stdout); standbyMode( true ); return messages_return::handled; } + else if( msg == NeutrinoMessages::RELOAD_SETUP ) { + bool tmp = g_settings.make_hd_list; + loadSetup(NEUTRINO_SETTINGS_FILE); + if(tmp != g_settings.make_hd_list) + g_Zapit->reinitChannels(); + + return messages_return::handled; + } else if( msg == NeutrinoMessages::STANDBY_TOGGLE ) { standbyMode( !(mode & mode_standby) ); g_RCInput->clearRCMsg(); diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index 42e18ac2a..3fb035850 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -72,6 +72,7 @@ struct NeutrinoMessages { LOCK_RC = CRCInput::RC_Messages + 19, UNLOCK_RC = CRCInput::RC_Messages + 20, REBOOT = CRCInput::RC_Messages + 21, + RELOAD_SETUP = CRCInput::RC_Messages + 22, EVT_VOLCHANGED = CRCInput::RC_Events + 1, EVT_MUTECHANGED = CRCInput::RC_Events + 2, diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index de492fb3a..d870e9c8b 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -170,6 +170,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"gettime", &CControlAPI::GetTimeCGI, "text/plain"}, {"info", &CControlAPI::InfoCGI, "text/plain"}, {"version", &CControlAPI::VersionCGI, ""}, + {"reloadsetup", &CControlAPI::ReloadNutrinoSetupfCGI, ""}, // boxcontrol - devices {"volume", &CControlAPI::VolumeCGI, "text/plain"}, {"lcd", &CControlAPI::LCDAction, "text/plain"}, @@ -1246,6 +1247,13 @@ void CControlAPI::VersionCGI(CyhookHandler *hh) { hh->SendFile("/.version"); } +//----------------------------------------------------------------------------- +void CControlAPI::ReloadNutrinoSetupfCGI(CyhookHandler *hh) +{ + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::RELOAD_SETUP, CEventServer::INITID_HTTPD); + hh->SendOk(); +} + //----------------------------------------------------------------------------- void CControlAPI::ZaptoCGI(CyhookHandler *hh) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.h b/src/nhttpd/tuxboxapi/coolstream/controlapi.h index a1c0bf6d7..78ea95df4 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.h @@ -77,6 +77,7 @@ private: void GetBouquetsCGI(CyhookHandler *hh); void EpgCGI(CyhookHandler *hh); void VersionCGI(CyhookHandler *hh); + void ReloadNutrinoSetupfCGI(CyhookHandler *hh); void ZaptoCGI(CyhookHandler *hh); void StartPluginCGI(CyhookHandler *hh); void LCDAction(CyhookHandler *hh); diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp index 991a3f84b..80f162d97 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp @@ -128,6 +128,7 @@ CNeutrinoAPI::CNeutrinoAPI() EventServer->registerEvent2( NeutrinoMessages::EVT_START_PLUGIN, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); EventServer->registerEvent2( NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); EventServer->registerEvent2( NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + EventServer->registerEvent2( NeutrinoMessages::RELOAD_SETUP, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");//reload neutrino conf } //-------------------------------------------------------------------------