X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/cf46f94e89b18107c277852fa3b6db04fa12278d..0192baee767d36a7819ca95b27abea1a8d91a15e:/lib/dvb/sec.cpp diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 16c68e8f..aa00062a 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -138,7 +138,8 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite if ( di_param.m_committed_cmd < eDVBSatelliteDiseqcParameters::SENDNO ) csw = 0xF0 | (csw << 2); - csw |= band; + if (di_param.m_committed_cmd <= eDVBSatelliteDiseqcParameters::SENDNO) + csw |= band; if ( di_param.m_diseqc_mode == eDVBSatelliteDiseqcParameters::V1_2 ) // ROTOR { @@ -355,7 +356,8 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA if ( di_param.m_committed_cmd < eDVBSatelliteDiseqcParameters::SENDNO ) csw = 0xF0 | (csw << 2); - csw |= band; + if (di_param.m_committed_cmd <= eDVBSatelliteDiseqcParameters::SENDNO) + csw |= band; bool send_csw = (di_param.m_committed_cmd != eDVBSatelliteDiseqcParameters::SENDNO); @@ -397,7 +399,10 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA } if (changed_csw) { - if ( di_param.m_use_fast && (lastcsw & 0xF0) && ((csw / 4) == (lastcsw / 4)) ) + if ( di_param.m_use_fast + && di_param.m_committed_cmd < eDVBSatelliteDiseqcParameters::SENDNO + && (lastcsw & 0xF0) + && ((csw / 4) == (lastcsw / 4)) ) eDebug("dont send committed cmd (fast diseqc)"); else { @@ -597,27 +602,24 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) ); // voltage was disabled..so we wait a longer time .. sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 500) ); - sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +4) ); // no need to send stop rotor cmd + sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +7) ); // no need to send stop rotor cmd - eDVBDiseqcCommand diseqc; - if ( !send_mask ) // no switch changed.. so we send first the rotor stop command - { - diseqc.len = 3; - diseqc.data[0] = 0xE0; - diseqc.data[1] = 0x31; // positioner - diseqc.data[2] = 0x60; // stop - sec_sequence.push_back( eSecCommand(eSecCommand::IF_ROTORPOS_VALID_GOTO, +3) ); - sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) ); - // wait 300msec after send rotor stop cmd - sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 300) ); - } + if (send_mask) + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 750) ); // wait 750ms after send switch cmd else - { - // wait 500msec after switching to rotor - sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 500) ); - sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +2) ); sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +1) ); - } + + eDVBDiseqcCommand diseqc; + diseqc.len = 3; + diseqc.data[0] = 0xE0; + diseqc.data[1] = 0x31; // positioner + diseqc.data[2] = 0x60; // stop + sec_sequence.push_back( eSecCommand(eSecCommand::IF_ROTORPOS_VALID_GOTO, +5) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) ); + // wait 300msec after send rotor stop cmd + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 300) ); diseqc.data[0] = 0xE0; diseqc.data[1] = 0x31; // positioner