diff = 1<<29;
else if (sat.polarisation != osat.polarisation)
diff = 1<<28;
- else
+ else
+ {
diff = abs(sat.frequency - osat.frequency);
+ diff += abs(sat.symbol_rate - osat.symbol_rate);
+ }
return 0;
}
case iDVBFrontend::feCable:
DEFINE_REF(eDVBFrontend);
eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok)
- :m_type(-1), m_fe(fe), m_timeout(0), m_tuneTimer(0), m_fd(-1)
+ :m_type(-1), m_fe(fe), m_fd(-1), m_timeout(0), m_tuneTimer(0)
#if HAVE_DVB_API_VERSION < 3
,m_secfd(-1)
#endif
for (int i=0; i<entries; ++i)
m_data[i] = -1;
+ m_idleInputpower[0]=m_idleInputpower[1]=0;
+
ok = !openFrontend();
closeFrontend();
}
eDebug("[SEC] error read lnbp (%m)");
if ( m_sec_sequence.current()->mode == eSecCommand::modeStatic )
{
- data[0] |= 0x90; // enable static current limiting
+ data[0] |= 0x80; // enable static current limiting
eDebug("[SEC] set static current limiting");
}
else
{
- data[0] &= ~0x90; // enable dynamic current limiting
+ data[0] &= ~0x80; // enable dynamic current limiting
eDebug("[SEC] set dynamic current limiting");
}
if(::write(fd, data, 1) != 1)
break;
case eSecCommand::IF_INPUTPOWER_DELTA_GOTO:
{
- int idleInputpower = m_idleInputpower[m_curVoltage == iDVBFrontend::voltage13 ? 0 : 1];
+ int idleInputpower = m_idleInputpower[ (m_curVoltage&1) ? 0 : 1];
eSecCommand::rotor &cmd = m_sec_sequence.current()->measure;
const char *txt = cmd.direction ? "running" : "stopped";
eDebug("[SEC] waiting for rotor %s %d, idle %d, delta %d",
#if HAVE_DVB_API_VERSION < 3
secVoltage vlt;
#else
+ bool increased=false;
fe_sec_voltage_t vlt;
#endif
-
m_curVoltage=voltage;
switch (voltage)
{
m_data[i]=-1;
vlt = SEC_VOLTAGE_OFF;
break;
+ case voltage13_5:
+#if HAVE_DVB_API_VERSION < 3
+ vlt = SEC_VOLTAGE_13_5;
+ break;
+#else
+ increased = true;
+#endif
case voltage13:
vlt = SEC_VOLTAGE_13;
break;
+ case voltage18_5:
+#if HAVE_DVB_API_VERSION < 3
+ vlt = SEC_VOLTAGE_18_5;
+ break;
+#else
+ increased = true;
+#endif
case voltage18:
vlt = SEC_VOLTAGE_18;
break;
#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)
+ perror("FE_ENABLE_HIGH_LNB_VOLTAGE");
return ::ioctl(m_fd, FE_SET_VOLTAGE, vlt);
#endif
}
cmd = SEC_MINI_B;
if (::ioctl(m_secfd, SEC_DISEQC_SEND_BURST, cmd))
return -EINVAL;
+#else
+ fe_sec_mini_cmd_t cmd = SEC_MINI_A;
+ if ( burst == eDVBSatelliteDiseqcParameters::A )
+ cmd = SEC_MINI_A;
+ else if ( burst == eDVBSatelliteDiseqcParameters::B )
+ cmd = SEC_MINI_B;
+ else
+ {
+ eDebug("unknown toneburst!");
+ return -EINVAL;
+ }
+ if (::ioctl(m_fd, FE_DISEQC_SEND_BURST, cmd))
+ return -EINVAL;
#endif
return 0;
}