X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/d58968e5ca43995658257b6e89f092c7572cde0a..271b34fd82da86aa15e3da90703c59d822e89826:/lib/dvb/sec.cpp diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 3d8084c8..10b2c2c1 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -315,6 +315,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA bool doSetFrontend = true; bool doSetVoltageToneFrontend = true; bool allowDiseqc1_2 = true; + bool sendDiSEqC = false; long band=0, voltage = iDVBFrontend::voltageOff, tone = iDVBFrontend::toneOff, @@ -544,9 +545,8 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA // check if voltage is disabled compare.voltage = iDVBFrontend::voltageOff; - compare.steps = +5; + compare.steps = +4; sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) ); - sec_sequence.push_back( eSecCommand(eSecCommand::INVALIDATE_CURRENT_SWITCHPARMS) ); // voltage is changed... use DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_SWITCH_CMDS sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, vlt) ); @@ -557,6 +557,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, vlt) ); sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_SWITCH_CMDS]) ); + sec_sequence.push_back( eSecCommand(eSecCommand::INVALIDATE_CURRENT_SWITCHPARMS) ); for (int seq_repeat = 0; seq_repeat < (di_param.m_seq_repeat?2:1); ++seq_repeat) { if ( send_mask & 4 ) @@ -633,6 +634,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_TONEBURST]) ); } } + sendDiSEqC = true; } eDebug("RotorCmd %02x, lastRotorCmd %02lx", RotorCmd, lastRotorCmd); @@ -715,7 +717,6 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA 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) ); sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_DISEQC_RETRYS, m_params[MOTOR_COMMAND_RETRIES]) ); // 2 retries sec_sequence.push_back( eSecCommand(eSecCommand::INVALIDATE_CURRENT_ROTORPARMS) ); sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) ); @@ -730,9 +731,10 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::IF_INPUTPOWER_DELTA_GOTO, cmd ) ); // check if rotor has started sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +2 ) ); // timeout .. we assume now the rotor is already at the correct position sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) ); // goto loop start - sec_sequence.push_back( eSecCommand(eSecCommand::IF_NO_MORE_ROTOR_DISEQC_RETRYS_GOTO, turn_fast ? 9 : 8 ) ); // timeout .. we assume now the rotor is already at the correct position + sec_sequence.push_back( eSecCommand(eSecCommand::IF_NO_MORE_ROTOR_DISEQC_RETRYS_GOTO, turn_fast ? 10 : 9 ) ); // timeout .. we assume now the rotor is already at the correct position sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -8) ); // goto loop start //////////////////// + sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_MOVING) ); if (turn_fast) sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) ); sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, m_params[MOTOR_RUNNING_TIMEOUT]*20) ); // 2 minutes running timeout @@ -746,7 +748,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) ); // running loop start ///////////////////// sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_ROTORPARAMS) ); - sec_sequence.push_back( eSecCommand(eSecCommand::SET_POWER_LIMITING_MODE, eSecCommand::modeDynamic) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_STOPPED) ); } else { // use normal turning mode @@ -760,8 +762,8 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, compare.voltage) ); sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_MOTOR_CMD]) ); // wait 150msec after voltage change - sec_sequence.push_back( eSecCommand(eSecCommand::SET_POWER_LIMITING_MODE, eSecCommand::modeStatic) ); sec_sequence.push_back( eSecCommand(eSecCommand::INVALIDATE_CURRENT_ROTORPARMS) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_MOVING) ); sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) ); compare.voltage = voltage; @@ -786,10 +788,14 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +3 ) ); sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -3) ); // goto loop start sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_ROTORPARAMS) ); - sec_sequence.push_back( eSecCommand(eSecCommand::SET_POWER_LIMITING_MODE, eSecCommand::modeDynamic) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_STOPPED) ); + sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +3) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND) ); + sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) ); } sec_fe->setData(eDVBFrontend::NEW_ROTOR_CMD, RotorCmd); sec_fe->setData(eDVBFrontend::NEW_ROTOR_POS, sat.orbital_position); + sendDiSEqC = true; } } } @@ -799,6 +805,9 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA csw = band; } + if (sendDiSEqC) + sec_sequence.push_front( eSecCommand(eSecCommand::SET_POWER_LIMITING_MODE, eSecCommand::modeStatic) ); + sec_fe->setData(eDVBFrontend::NEW_CSW, csw); sec_fe->setData(eDVBFrontend::NEW_UCSW, ucsw); sec_fe->setData(eDVBFrontend::NEW_TONEBURST, di_param.m_toneburst_param); @@ -824,6 +833,10 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::START_TUNE_TIMEOUT, tunetimeout) ); sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND) ); } + + if (sendDiSEqC) + sec_sequence.push_back( eSecCommand(eSecCommand::SET_POWER_LIMITING_MODE, eSecCommand::modeDynamic) ); + frontend.setSecSequence(sec_sequence); return 0;