eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok)
:m_enabled(false), m_type(-1), m_dvbid(fe), m_slotid(fe)
- ,m_fd(-1), m_need_rotor_workaround(false), m_sn(0), m_timeout(0), m_tuneTimer(0)
+ ,m_fd(-1), m_need_rotor_workaround(false), m_can_handle_dvbs2(false)
+ ,m_sn(0), m_timeout(0), m_tuneTimer(0)
#if HAVE_DVB_API_VERSION < 3
,m_secfd(-1)
#endif
break;
case eSecCommand::SET_POWER_LIMITING_MODE:
{
- if (m_need_rotor_workaround)
+ char proc_name[64];
+ sprintf(proc_name, "/proc/stb/frontend/%d/static_current_limiting", m_dvbid);
+ FILE *f=fopen(proc_name, "w");
+ if (f) // new interface exist?
+ {
+ bool slimiting = m_sec_sequence.current()->mode == eSecCommand::modeStatic;
+ if (fprintf(f, "%s", slimiting ? "on" : "off") <= 0)
+ eDebug("write %s failed!! (%m)", proc_name);
+ else
+ eDebug("[SEC] set %s current limiting", slimiting ? "static" : "dynamic");
+ fclose(f);
+ }
+ else if (m_need_rotor_workaround)
{
char dev[16];
int type;
if (feparm->getSystem(type) || type != m_type || !m_enabled)
return 0;
-
if (m_type == eDVBFrontend::feSatellite)
{
ASSERT(m_sec);
eDVBFrontendParametersSatellite sat_parm;
int ret = feparm->getDVBS(sat_parm);
ASSERT(!ret);
- return m_sec->canTune(sat_parm, this, 1 << m_slotid);
+ if (sat_parm.system == eDVBFrontendParametersSatellite::System::DVB_S2 && !m_can_handle_dvbs2)
+ return 0;
+ ret = m_sec->canTune(sat_parm, this, 1 << m_slotid);
+ if (ret > 1 && sat_parm.system == eDVBFrontendParametersSatellite::System::DVB_S && m_can_handle_dvbs2)
+ ret -= 1;
+ return ret;
}
else if (m_type == eDVBFrontend::feCable)
return 2; // more prio for cable frontends
- return 1;
+ else if (m_type == eDVBFrontend::feTerrestrial)
+ return 1;
+ return 0;
}
bool eDVBFrontend::setSlotInfo(ePyObject obj)
// HACK.. the rotor workaround is neede for all NIMs with LNBP21 voltage regulator...
m_need_rotor_workaround = !!strstr(m_description, "Alps BSBE1") ||
!!strstr(m_description, "Alps BSBE2") ||
- !!strstr(m_description, "Alps -S");
- eDebug("setSlotInfo for dvb frontend %d to slotid %d, descr %s, need rotorworkaround %s, enabled %s",
- m_dvbid, m_slotid, m_description, m_need_rotor_workaround ? "Yes" : "No", m_enabled ? "Yes" : "No" );
+ !!strstr(m_description, "Alps -S") ||
+ !!strstr(m_description, "BCM4501");
+ m_can_handle_dvbs2 = !!strstr(m_description, "Alps BSBE2") || !!strstr(m_description, "BCM4501");
+ eDebug("setSlotInfo for dvb frontend %d to slotid %d, descr %s, need rotorworkaround %s, enabled %s, DVB-S2 %s",
+ m_dvbid, m_slotid, m_description, m_need_rotor_workaround ? "Yes" : "No", m_enabled ? "Yes" : "No", m_can_handle_dvbs2 ? "Yes" : "No" );
return true;
arg_error:
PyErr_SetString(PyExc_StandardError,