if (m_fd >= 0)
{
eDebugNoSimulate("close frontend %d", m_dvbid);
+ if (m_data[SATCR] != -1)
+ {
+ turnOffSatCR(m_data[SATCR]);
+ }
setTone(iDVBFrontend::toneOff);
setVoltage(iDVBFrontend::voltageOff);
m_tuneTimer->stop();
case signalQuality:
case signalQualitydB: /* this will move into the driver */
{
+ int sat_max = 1600; // for stv0288 / bsbe2
int ret = 0x12345678;
uint16_t snr=0;
if (m_simulate)
snr_in_db = fval1;
}
#endif
+ sat_max = 1750;
ret = (int)(snr_in_db * 100);
- ret -= 150; // -1.5db for latest bcm4501 firmware..
}
else if (strstr(m_description, "Alps BSBE1 C01A") ||
!strcmp(m_description, "Alps -S(STV0288)"))
!strcmp(m_description, "Philips -S") ||
!strcmp(m_description, "LG -S") )
{
+ sat_max = 1500;
ret = (int)((snr-39075)/17.647);
} else if (!strcmp(m_description, "Alps BSBE2"))
{
return snr;
switch(m_type)
{
- case feSatellite: // we assume a max of 16.0db here
- return ret >= 1600 ? 65536 : ret * 65536 / 1600;
+ case feSatellite:
+ return ret >= sat_max ? 65536 : ret * 65536 / sat_max;
case feCable: // we assume a max of 42db here
return ret >= 4200 ? 65536 : ret * 65536 / 4200;
case feTerrestrial: // we assume a max of 24db here
res = m_sec->prepare(*this, parm, feparm, 1 << m_slotid, tunetimeout);
if (!res)
{
+#if HAVE_DVB_API_VERSION >= 3
+ eDebugNoSimulate("prepare_sat System %d Freq %d Pol %d SR %d INV %d FEC %d orbpos %d system %d modulation %d pilot %d, rolloff %d",
+ feparm.system,
+ feparm.frequency,
+ feparm.polarisation,
+ feparm.symbol_rate,
+ feparm.inversion,
+ feparm.fec,
+ feparm.orbital_position,
+ feparm.system,
+ feparm.modulation,
+ feparm.pilot,
+ feparm.rolloff);
+#else
eDebugNoSimulate("prepare_sat System %d Freq %d Pol %d SR %d INV %d FEC %d orbpos %d",
feparm.system,
feparm.frequency,
feparm.inversion,
feparm.fec,
feparm.orbital_position);
+#endif
parm_u_qpsk_symbol_rate = feparm.symbol_rate;
switch (feparm.inversion)
{
"eDVBFrontend::setSlotInfo must get a tuple with first param slotid, second param slot description and third param enabled boolean");
return false;
}
+
+RESULT eDVBFrontend::turnOffSatCR(int satcr)
+{
+ eSecCommandList sec_sequence;
+ // check if voltage is disabled
+ eSecCommand::pair compare;
+ compare.steps = +9; //nothing to do
+ compare.voltage = iDVBFrontend::voltageOff;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_NOT_VOLTAGE_GOTO, compare) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50 ) );
+
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage18_5) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, iDVBFrontend::toneOff) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 250) );
+
+ eDVBDiseqcCommand diseqc;
+ memset(diseqc.data, 0, MAX_DISEQC_LENGTH);
+ diseqc.len = 5;
+ diseqc.data[0] = 0xE0;
+ diseqc.data[1] = 0x10;
+ diseqc.data[2] = 0x5A;
+ diseqc.data[3] = satcr << 5;
+ diseqc.data[4] = 0x00;
+
+ sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50+20+14*diseqc.len) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) );
+ setSecSequence(sec_sequence);
+ return 0;
+}
+
+RESULT eDVBFrontend::ScanSatCR()
+{
+ setFrontend();
+ usleep(20000);
+ setTone(iDVBFrontend::toneOff);
+ return 0;
+}