CFEManager: Set dummy name for dummy test frontend

Origin commit data
------------------
Commit: f6d5a2826d
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-01-14 (Thu, 14 Jan 2016)
This commit is contained in:
Michael Liebmann
2016-01-14 12:58:45 +01:00
parent 5aaaffad5f
commit b64ad0029d
3 changed files with 8 additions and 0 deletions

View File

@@ -301,6 +301,7 @@ class CFrontend
static fe_delivery_system_t getFEDeliverySystem(delivery_system_t Delsys); static fe_delivery_system_t getFEDeliverySystem(delivery_system_t Delsys);
static uint32_t getFEBandwidth(fe_bandwidth_t bandwidth); static uint32_t getFEBandwidth(fe_bandwidth_t bandwidth);
const char* getName(void) const { return info.name; } const char* getName(void) const { return info.name; }
void setName(const char* _name);
private: private:
// DEPRECATED // DEPRECATED
fe_type_t getType() { return info.type; } fe_type_t getType() { return info.type; }

View File

@@ -118,6 +118,7 @@ bool CFEManager::Init()
if (femap.empty() && getenv("SIMULATE_FE")) { if (femap.empty() && getenv("SIMULATE_FE")) {
INFO("SIMULATE_FE is set, adding dummy frontend for testing"); INFO("SIMULATE_FE is set, adding dummy frontend for testing");
fe = new CFrontend(0,0); fe = new CFrontend(0,0);
fe->setName("DuTu - The dummy tuner");
fekey = MAKE_FE_KEY(0, 0); fekey = MAKE_FE_KEY(0, 0);
femap.insert(std::pair <unsigned short, CFrontend*> (fekey, fe)); femap.insert(std::pair <unsigned short, CFrontend*> (fekey, fe));
livefe = fe; livefe = fe;

View File

@@ -1073,6 +1073,12 @@ uint32_t CFrontend::getFEBandwidth(fe_bandwidth_t bandwidth)
return bandwidth_hz; return bandwidth_hz;
} }
void CFrontend::setName(const char* _name)
{
memset(info.name, '\0', sizeof(info.name));
snprintf(info.name, sizeof(info.name)-1, "%s", _name);
}
bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_properties& cmdseq) bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_properties& cmdseq)
{ {
fe_pilot_t pilot = PILOT_OFF; fe_pilot_t pilot = PILOT_OFF;