X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/c61d41422afe49ea1c31bc14913452ef3b571c21..f990151461bd800976ffc1382b674a537b8f1a3a:/lib/dvb/sec.cpp diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 7319a4be..8d65e413 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -144,12 +144,14 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite if ( di_param.m_diseqc_mode == eDVBSatelliteDiseqcParameters::V1_2 ) // ROTOR rotor = true; - ret = 1000; + ret=10000; + if (rotor && curRotorPos != -1) + ret -= abs(curRotorPos-sat.orbital_position); } else { csw = band; - ret = 2000; + ret = 15000; } while (linked_prev_ptr != -1) // check for linked tuners.. @@ -521,9 +523,12 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA if ( send_mask ) { + eSecCommand::pair compare; + compare.steps = +3; + compare.tone = iDVBFrontend::toneOff; + sec_sequence.push_back( eSecCommand(eSecCommand::IF_TONE_GOTO, compare) ); sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, iDVBFrontend::toneOff) ); sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 15) ); - 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 :) @@ -562,8 +567,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 +602,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; @@ -642,12 +646,12 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA // 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 + sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +9) ); // no need to send stop rotor cmd and recheck voltage } else { 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 + sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +9) ); // no need to send stop rotor cmd and recheck voltage } eDVBDiseqcCommand diseqc; @@ -684,19 +688,19 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA eSecCommand::rotor cmd; eSecCommand::pair compare; compare.voltage = VOLTAGE(18); - compare.steps = +2; + compare.steps = +3; sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) ); sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, compare.voltage) ); // measure idle power values sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 200) ); // wait 200msec after voltage change sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_IDLE_INPUTPOWER, 1) ); - compare.voltage = 1; + compare.val = 1; compare.steps = -2; sec_sequence.push_back( eSecCommand(eSecCommand::IF_MEASURE_IDLE_WAS_NOT_OK_GOTO, compare) ); sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(13)) ); sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 200) ); // wait 200msec before measure sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_IDLE_INPUTPOWER, 0) ); - compare.voltage = 0; + compare.val = 0; sec_sequence.push_back( eSecCommand(eSecCommand::IF_MEASURE_IDLE_WAS_NOT_OK_GOTO, compare) ); //////////////////////////// sec_sequence.push_back( eSecCommand(eSecCommand::SET_POWER_LIMITING_MODE, eSecCommand::modeStatic) ); @@ -736,7 +740,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA eSecCommand::rotor cmd; eSecCommand::pair compare; compare.voltage = VOLTAGE(13); - compare.steps = +2; + compare.steps = +3; sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) ); sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, compare.voltage) ); sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 200) ); // wait 200msec after voltage change @@ -751,7 +755,10 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 2000) ); // wait 2 second before set high voltage sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, voltage) ); + compare.tone = tone; + sec_sequence.push_back( eSecCommand(eSecCommand::IF_TONE_GOTO, compare) ); sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, tone) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 15) ); sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND) ); cmd.direction=1; // check for running rotor @@ -787,6 +794,8 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, voltage) ); sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 10) ); + compare.tone = tone; + sec_sequence.push_back( eSecCommand(eSecCommand::IF_TONE_GOTO, compare) ); sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, tone) ); sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 15) ); } @@ -1103,7 +1112,7 @@ struct sat_compare PyObject *eDVBSatelliteEquipmentControl::get_exclusive_satellites(int tu1, int tu2) { - PyObject *ret=0; + ePyObject ret; if (tu1 != tu2) {