mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CControlAPI:: -add SignalInfoCGI
This commit is contained in:
@@ -49,6 +49,8 @@
|
|||||||
#include "neutrinoapi.h"
|
#include "neutrinoapi.h"
|
||||||
#include "controlapi.h"
|
#include "controlapi.h"
|
||||||
#include <video.h>
|
#include <video.h>
|
||||||
|
#include <zapit/femanager.h>
|
||||||
|
|
||||||
extern cVideo * videoDecoder;
|
extern cVideo * videoDecoder;
|
||||||
|
|
||||||
extern CPlugins *g_PluginList;//for relodplugins
|
extern CPlugins *g_PluginList;//for relodplugins
|
||||||
@@ -161,6 +163,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
|
|||||||
{"epgsearch", &CControlAPI::EpgSearchTXTCGI, ""},
|
{"epgsearch", &CControlAPI::EpgSearchTXTCGI, ""},
|
||||||
{"epg", &CControlAPI::EpgCGI, ""},
|
{"epg", &CControlAPI::EpgCGI, ""},
|
||||||
{"zapto", &CControlAPI::ZaptoCGI, "text/plain"},
|
{"zapto", &CControlAPI::ZaptoCGI, "text/plain"},
|
||||||
|
{"signal", &CControlAPI::SignalInfoCGI, "text/plain"},
|
||||||
{"getonidsid", &CControlAPI::GetChannel_IDCGI, "text/plain"},
|
{"getonidsid", &CControlAPI::GetChannel_IDCGI, "text/plain"},
|
||||||
{"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"},
|
{"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"},
|
||||||
// boxcontrol - system
|
// boxcontrol - system
|
||||||
@@ -210,7 +213,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
|
|||||||
// settings
|
// settings
|
||||||
{"config", &CControlAPI::ConfigCGI, "text/plain"},
|
{"config", &CControlAPI::ConfigCGI, "text/plain"},
|
||||||
// filehandling
|
// filehandling
|
||||||
{"file", &CControlAPI::FileCGI, "+xml"},
|
{"file", &CControlAPI::FileCGI, "+xml"}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -1756,6 +1759,34 @@ void CControlAPI::SendChannelList(CyhookHandler *hh, bool currentTP)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void CControlAPI::SignalInfoCGI(CyhookHandler *hh)
|
||||||
|
{
|
||||||
|
CFrontend *frontend = CFEManager::getInstance()->getLiveFE();
|
||||||
|
if(frontend){
|
||||||
|
bool parame_empty = false;
|
||||||
|
|
||||||
|
if (hh->ParamList["1"].empty())
|
||||||
|
parame_empty = true;
|
||||||
|
|
||||||
|
if ( parame_empty || (hh->ParamList["1"] == "sig") ){
|
||||||
|
unsigned int sig = frontend->getSignalStrength() & 0xFFFF;
|
||||||
|
sig = (sig & 0xFFFF) * 100 / 65535;
|
||||||
|
hh->printf("SIG:%3u\n", sig);
|
||||||
|
}
|
||||||
|
if ( parame_empty || (hh->ParamList["1"] == "snr") ){
|
||||||
|
unsigned int snr = frontend->getSignalNoiseRatio() & 0xFFFF;
|
||||||
|
snr = (snr & 0xFFFF) * 100 / 65535;
|
||||||
|
hh->printf("SNR:%3u\n", snr);
|
||||||
|
}
|
||||||
|
if ( parame_empty || (hh->ParamList["1"] == "ber") ){
|
||||||
|
unsigned int ber = frontend->getBitErrorRate();
|
||||||
|
hh->printf("BER:%3u\n", ber);
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
hh->SendError();
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CControlAPI::SendStreamInfo(CyhookHandler *hh)
|
void CControlAPI::SendStreamInfo(CyhookHandler *hh)
|
||||||
{
|
{
|
||||||
|
@@ -111,6 +111,8 @@ private:
|
|||||||
void logoCGI(CyhookHandler *hh);
|
void logoCGI(CyhookHandler *hh);
|
||||||
void ConfigCGI(CyhookHandler *hh);
|
void ConfigCGI(CyhookHandler *hh);
|
||||||
void FileCGI(CyhookHandler *hh);
|
void FileCGI(CyhookHandler *hh);
|
||||||
|
void SignalInfoCGI(CyhookHandler *hh);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static const unsigned int PLUGIN_DIR_COUNT = 7;
|
static const unsigned int PLUGIN_DIR_COUNT = 7;
|
||||||
|
Reference in New Issue
Block a user