From: Andreas Monzner Date: Thu, 8 Dec 2005 15:14:51 +0000 (+0000) Subject: add support for sending tonebursts X-Git-Tag: 2.6.0~4781 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/8e13d1b1a0fb7309f6727b712a61f47dbd90a52c add support for sending tonebursts optimize diseqc command order handling code --- diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index a3483904..d4f3d369 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -1059,6 +1059,19 @@ RESULT eDVBFrontend::sendToneburst(int burst) cmd = SEC_MINI_B; if (::ioctl(m_secfd, SEC_DISEQC_SEND_BURST, cmd)) return -EINVAL; +#else + fe_sec_mini_cmd_t cmd = SEC_MINI_A; + if ( burst == eDVBSatelliteDiseqcParameters::A ) + cmd = SEC_MINI_A; + else if ( burst == eDVBSatelliteDiseqcParameters::B ) + cmd = SEC_MINI_B; + else + { + eDebug("unknown toneburst!"); + return -EINVAL; + } + if (::ioctl(m_fd, FE_DISEQC_SEND_BURST, cmd)) + return -EINVAL; #endif return 0; } diff --git a/lib/dvb/rotor_calc.h b/lib/dvb/rotor_calc.h index dde45d22..0635126a 100644 --- a/lib/dvb/rotor_calc.h +++ b/lib/dvb/rotor_calc.h @@ -1,4 +1,4 @@ #ifndef __LIB_ROTOR_CALC_H__ #define __LIB_ROTOR_CALC_H__ double calcSatHourangle( double SatLon, double SiteLat, double SiteLon ); -#endif // __LIB_ROTOR_CALC_H__ \ No newline at end of file +#endif // __LIB_ROTOR_CALC_H__ diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 96729306..411cb52e 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -143,10 +143,9 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite { diseqc=true; if ( di_param.m_committed_cmd < eDVBSatelliteDiseqcParameters::SENDNO ) - { csw = 0xF0 | (csw << 2); - csw |= band; - } + + csw |= band; if ( di_param.m_diseqc_mode == eDVBSatelliteDiseqcParameters::V1_2 ) // ROTOR { @@ -159,7 +158,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite } else csw = band; - + if (!ret) ret=40; @@ -312,10 +311,9 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA if (di_param.m_diseqc_mode >= eDVBSatelliteDiseqcParameters::V1_0) { if ( di_param.m_committed_cmd < eDVBSatelliteDiseqcParameters::SENDNO ) - { csw = 0xF0 | (csw << 2); - csw |= band; - } + + csw |= band; bool send_csw = (di_param.m_committed_cmd != eDVBSatelliteDiseqcParameters::SENDNO); @@ -329,20 +327,57 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA (di_param.m_toneburst_param != eDVBSatelliteDiseqcParameters::NO); bool changed_burst = send_burst && toneburst != lastToneburst; - bool send_diseqc = changed_ucsw; - if (!send_diseqc) - send_diseqc = changed_burst && (send_ucsw || send_csw); - if (!send_diseqc) + int send_mask = 0; /* + 1 must send csw + 2 must send ucsw + 4 send toneburst first + 8 send toneburst at end */ + if (changed_burst) // toneburst first and toneburst changed { - send_diseqc = changed_csw; - if ( send_diseqc && di_param.m_use_fast && (csw & 0xF0) && (lastcsw & 0xF0) && ((csw / 4) == (lastcsw / 4)) ) + if (di_param.m_command_order&1) { - frontend.setData(0, csw); // needed for linked tuner handling - send_diseqc = false; + send_mask |= 4; + if ( send_csw ) + send_mask |= 1; + if ( send_ucsw ) + send_mask |= 2; + } + else + send_mask |= 8; + } + if (changed_ucsw) + { + send_mask |= 2; + if ((di_param.m_command_order&4) && send_csw) + send_mask |= 1; + if (di_param.m_command_order==4 && send_burst) + send_mask |= 8; + } + if (changed_csw) + { + if ( di_param.m_use_fast && (lastcsw & 0xF0) && ((csw / 4) == (lastcsw / 4)) ) + eDebug("dont send committed cmd (fast diseqc)"); + else + { + send_mask |= 1; + if (!(di_param.m_command_order&4) && send_ucsw) + send_mask |= 2; + if (!(di_param.m_command_order&1) && send_burst) + send_mask |= 8; } } - if ( send_diseqc || changed_burst ) +#if 0 + eDebugNoNewLine("sendmask: "); + for (int i=3; i >= 0; --i) + if ( send_mask & (1<