#include <lib/dvb/dvb.h>
#include <lib/base/eerror.h>
+#include <lib/base/nconfig.h> // access to python config
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
state = stateTuning;
else
{
+ eDebug("stateLostLock");
state = stateLostLock;
m_data[CSW] = m_data[UCSW] = m_data[TONEBURST] = -1; // reset diseqc
}
eDebug("FE_GET_FRONTEND (%m)");
else
{
+ const FRONTENDPARAMETERS &parm = original ? this->parm : front;
tmp = "INVERSION_AUTO";
switch(parm_inversion)
{
int res=0;
+ if (!m_sn)
+ {
+ eDebug("no frontend device opened... do not try to tune !!!");
+ return -ENODEV;
+ }
+
if (m_type == -1)
return -ENODEV;
if (!res)
{
m_sec_sequence.push_back( eSecCommand(eSecCommand::START_TUNE_TIMEOUT) );
+ eDVBRegisteredFrontend *linked_fe = (eDVBRegisteredFrontend*)m_data[LINKED_PREV_PTR];
+ if (linked_fe == (eDVBRegisteredFrontend*)-1)
+ {
+ std::string enable_5V;
+ ePythonConfigQuery::getConfigValue("config.terrestrial.enable_5V", enable_5V);
+ if (enable_5V == "yes")
+ m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) );
+ else
+ m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltageOff) );
+ }
+ else
+ m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltageOff) );
m_sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND) );
}
break;
RESULT eDVBFrontend::setVoltage(int voltage)
{
- if (m_type != feSatellite)
+ if (m_type == feCable)
return -1;
#if HAVE_DVB_API_VERSION < 3
secVoltage vlt;
#if HAVE_DVB_API_VERSION < 3
return ::ioctl(m_secfd, SEC_SET_VOLTAGE, vlt);
#else
- if (::ioctl(m_fd, FE_ENABLE_HIGH_LNB_VOLTAGE, increased) < 0)
+ if (m_type == feSatellite && ::ioctl(m_fd, FE_ENABLE_HIGH_LNB_VOLTAGE, increased) < 0)
perror("FE_ENABLE_HIGH_LNB_VOLTAGE");
return ::ioctl(m_fd, FE_SET_VOLTAGE, vlt);
#endif