removed thedoc's colors because of broken network setup
[enigma2.git] / lib / dvb / sec.cpp
index 041d1fbcde19c88c65e4b8b212037a524121ded0..71a1e4609b88f68457a44c540a4e86067c85b154 100644 (file)
@@ -21,8 +21,8 @@ eDVBSatelliteEquipmentControl::eDVBSatelliteEquipmentControl()
 {
        m_lnblist.push_back(eDVBSatelliteLNBParameters());
        eDVBSatelliteLNBParameters &lnb_ref = m_lnblist.front();
+       eDVBSatelliteDiseqcParameters &diseqc_ref = lnb_ref.m_diseqc_parameters;
        eDVBSatelliteParameters &astra1 = lnb_ref.m_satellites[192];
-       eDVBSatelliteDiseqcParameters &diseqc_ref = astra1.m_diseqc_parameters;
        eDVBSatelliteSwitchParameters &switch_ref = astra1.m_switch_parameters;
 
        lnb_ref.m_lof_hi = 10600000;
@@ -36,7 +36,7 @@ eDVBSatelliteEquipmentControl::eDVBSatelliteEquipmentControl()
        diseqc_ref.m_swap_cmds = false;
        diseqc_ref.m_toneburst_param = eDVBSatelliteDiseqcParameters::NO;
        diseqc_ref.m_uncommitted_cmd = 0;
-       diseqc_ref.m_use_fast = 1;
+       diseqc_ref.m_use_fast = 0;
 
        switch_ref.m_22khz_signal = eDVBSatelliteSwitchParameters::HILO;
        switch_ref.m_voltage_mode = eDVBSatelliteSwitchParameters::HV;
@@ -48,11 +48,12 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
        for (;it != m_lnblist.end(); ++it )
        {
                eDVBSatelliteLNBParameters &lnb_param = *it;
+               eDVBSatelliteDiseqcParameters &di_param = lnb_param.m_diseqc_parameters;
                std::map<int, eDVBSatelliteParameters>::iterator sit =
                        lnb_param.m_satellites.find(sat.orbital_position);
                if ( sit != lnb_param.m_satellites.end())
                {
-                       eDVBSatelliteDiseqcParameters &di_param = sit->second.m_diseqc_parameters;
+
                        eDVBSatelliteSwitchParameters &sw_param = sit->second.m_switch_parameters;
                        eDVBSatelliteRotorParameters &rotor_param = sit->second.m_rotor_parameters;
                        int hi=0,
@@ -332,13 +333,19 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, 8) );  // 2 seconds rotor start timout
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 250) );
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_RUNNING_INPUTPOWER) );
-                                                       sec_sequence.push_back( eSecCommand(eSecCommand::IF_RUNNING_GOTO, +3 ) );
+                                                       eSecCommand::rotor cmd;
+                                                       cmd.direction=1;  // check for running rotor
+                                                       cmd.deltaA=rotor_param.m_inputpower_parameters.m_threshold;
+                                                       cmd.steps=+3;
+                                                       cmd.okcount=0;
+                                                       sec_sequence.push_back( eSecCommand(eSecCommand::IF_INPUTPOWER_DELTA_GOTO, cmd ) );
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +8 ) );
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) );
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, 240) );  // 1 minute running timeout
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 250) );
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_RUNNING_INPUTPOWER) );
-                                                       sec_sequence.push_back( eSecCommand(eSecCommand::IF_STOPPED_GOTO, +3 ) );
+                                                       cmd.direction=0;  // check for stopped rotor
+                                                       sec_sequence.push_back( eSecCommand(eSecCommand::IF_INPUTPOWER_DELTA_GOTO, cmd ) );
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +2 ) );
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) );
                                                        sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_ROTORPARAMS) );