X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/40f102b5f749e9d66236f0a1dafcbd403f10b013..6aa0ed7fff929c4b2651667ab809d0ace1dac56d:/lib/dvb/sec.cpp diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 2a35ba14..86f549c2 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -544,8 +544,8 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) ); compare.steps = +3; sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, compare.voltage) ); - // voltage was disabled..so we wait a longer time .. for normal switches 200ms should be enough - sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 200) ); + // voltage was disabled..so we wait a longer time .. for normal switches 750ms should be enough + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 750) ); for (int seq_repeat = 0; seq_repeat < (di_param.m_seq_repeat?2:1); ++seq_repeat) { @@ -562,8 +562,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA if ( send_mask & 2 ) ++loops; - for ( int i=0; i < di_param.m_repeats; ++i ) - loops *= 2; + loops <<= di_param.m_repeats; for ( int i = 0; i < loops;) // fill commands... { @@ -598,7 +597,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA cmd=0x38; if (cmd) { - static int delay = (120 - 54) / 2; // standard says 100msek between two repeated commands + int delay = di_param.m_repeats ? (120 - 54) / 2 : 120; // standard says 100msek between two repeated commands sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, delay) ); diseqc.data[2]=cmd; diseqc.data[3]=(cmd==0x38) ? csw : ucsw; @@ -627,25 +626,28 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA if ( RotorCmd != -1 && RotorCmd != lastRotorCmd ) { eSecCommand::pair compare; - compare.voltage = iDVBFrontend::voltageOff; - compare.steps = +4; - // the next is a check if voltage is switched off.. then we first set a voltage :) - // else we set voltage after all diseqc stuff.. - sec_sequence.push_back( eSecCommand(eSecCommand::IF_NOT_VOLTAGE_GOTO, compare) ); - - if (rotor_param.m_inputpower_parameters.m_use) - sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(13)) ); // in normal mode start turning with 13V - else - sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) ); // turn always with 18V + if (!send_mask) + { + compare.voltage = iDVBFrontend::voltageOff; + compare.steps = +4; + // the next is a check if voltage is switched off.. then we first set a voltage :) + // else we set voltage after all diseqc stuff.. + sec_sequence.push_back( eSecCommand(eSecCommand::IF_NOT_VOLTAGE_GOTO, compare) ); - // voltage was disabled..so we wait a longer time .. - sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 500) ); - sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +7) ); // no need to send stop rotor cmd + if (rotor_param.m_inputpower_parameters.m_use) + sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(13)) ); // in normal mode start turning with 13V + else + sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) ); // turn always with 18V - if (send_mask) - sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 750) ); // wait 750ms after send switch cmd + // voltage was disabled..so we wait a longer time .. + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 750) ); + sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +8) ); // no need to send stop rotor cmd and recheck voltage + } else - sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +1) ); + { + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 750) ); // wait 750ms after send switch cmd + sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +8) ); // no need to send stop rotor cmd and recheck voltage + } eDVBDiseqcCommand diseqc; diseqc.len = 3; @@ -1113,6 +1115,7 @@ PyObject *eDVBSatelliteEquipmentControl::get_exclusive_satellites(int tu1, int t else if (cnt == tu2) p2 = *it; } + if (p1 && p2) { // check for linked tuners @@ -1145,10 +1148,12 @@ PyObject *eDVBSatelliteEquipmentControl::get_exclusive_satellites(int tu1, int t int tmp2=-1; // check for rotor dependency p1->m_frontend->getData(eDVBFrontend::SATPOS_DEPENDS_PTR, tmp1); + if (tmp1 != -1) + p1 = (eDVBRegisteredFrontend*)tmp1; p2->m_frontend->getData(eDVBFrontend::SATPOS_DEPENDS_PTR, tmp2); - if (tmp1 != -1 && (void*)tmp1 != p2 - && tmp2 != -1 && (void*)tmp2 != p1 - && tmp1 != tmp2 ) + if (tmp2 != -1) + p2 = (eDVBRegisteredFrontend*)tmp2; + if (p1 != p2) { int tu1_mask = 1 << p1->m_frontend->getID(), tu2_mask = 1 << p2->m_frontend->getID();