X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/10e7e45ae92d4fe06f70126ed256b87896dbc432..7049be52bf2235dfb848b28dcd9aa44eb204771c:/lib/dvb/frontend.cpp diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index 01eb27ae..a74e65ca 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -81,22 +81,26 @@ if (!m_simulate) \ eDebug(x); \ } while(0) -// else \ -// { \ -// eDebugNoNewLine("SIMULATE:"); \ -// eDebug(x); \ -// } \ +#if 0 + else \ + { \ + eDebugNoNewLine("SIMULATE:"); \ + eDebug(x); \ + } +#endif #define eDebugNoSimulateNoNewLine(x...) \ do { \ if (!m_simulate) \ eDebugNoNewLine(x); \ } while(0) -// else \ -// { \ -// eDebugNoNewLine("SIMULATE:"); \ -// eDebugNoNewLine(x); \ -// } \ +#if 0 + else \ + { \ + eDebugNoNewLine("SIMULATE:"); \ + eDebugNoNewLine(x); \ + } +#endif void eDVBDiseqcCommand::setCommandString(const char *str) { @@ -455,10 +459,10 @@ eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate) sprintf(m_filename, "/dev/dvb/adapter%d/frontend%d", adap, fe); #endif - m_timeout = new eTimer(eApp); + m_timeout = eTimer::create(eApp); CONNECT(m_timeout->timeout, eDVBFrontend::timeout); - m_tuneTimer = new eTimer(eApp); + m_tuneTimer = eTimer::create(eApp); CONNECT(m_tuneTimer->timeout, eDVBFrontend::tuneLoop); for (int i=0; i= 3 + else + { + float fval1 = SDS_SNRE / 268435456.0, + fval2, fval3, fval4; + if (parm_u_qpsk_fec_inner <= FEC_S2_QPSK_9_10) // DVB-S2 QPSK + { + fval2 = 6.76; + fval3 = 4.35; + } + else // 8PSK + { + fval1 *= 0.5; + fval2 = 8.06; + fval3 = 6.18; + } + fval4 = -10.0 * log10(fval1); + fval1 = fval4; + for (int i=0; i < 5; ++i) + fval1 = fval4 - fval2 * log10(1.0+pow(10.0, (fval3-fval1)/fval2)); + snr_in_db = fval1; + } +#endif return (int)(snr_in_db * 100.0); } else if (strstr(m_description, "Alps BSBE1 C01A") || @@ -783,7 +809,6 @@ int eDVBFrontend::readFrontendData(int type) i; if(INRANGE(CN_lookup[Imin][REGVAL],regval,CN_lookup[Imax][REGVAL])) { - long val; while((Imax-Imin)>1) { i=(Imax+Imin)/2; @@ -989,22 +1014,19 @@ void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &parm, e break; } PutToDict(dict, "rolloff", tmp); - if (parm_u_qpsk_fec_inner > FEC_S2_QPSK_9_10) + switch(parm_inversion & 0x30) { - switch(parm_inversion & 0x30) - { - case 0: // pilot off - tmp = "PILOT_OFF"; - break; - case 0x10: // pilot on - tmp = "PILOT_ON"; - break; - case 0x20: // pilot auto - tmp = "PILOT_AUTO"; - break; - } - PutToDict(dict, "pilot", tmp); + case 0: // pilot off + tmp = "PILOT_OFF"; + break; + case 0x10: // pilot on + tmp = "PILOT_ON"; + break; + case 0x20: // pilot auto + tmp = "PILOT_AUTO"; + break; } + PutToDict(dict, "pilot", tmp); tmp = "DVB-S2"; } else @@ -1285,7 +1307,7 @@ void eDVBFrontend::getTransponderData(ePyObject dest, bool original) { const FRONTENDPARAMETERS &parm = original || m_simulate ? this->parm : front; const char *tmp = "INVERSION_AUTO"; - switch(parm_inversion) + switch(parm_inversion & 3) { case INVERSION_ON: tmp = "INVERSION_ON"; @@ -1494,7 +1516,12 @@ void eDVBFrontend::tuneLoop() // called by m_tuneTimer eDebugNoSimulateNoNewLine("[SEC] sendDiseqc: "); for (int i=0; i < m_sec_sequence.current()->diseqc.len; ++i) eDebugNoSimulateNoNewLine("%02x", m_sec_sequence.current()->diseqc.data[i]); - eDebugNoSimulate(""); + if (!memcmp(m_sec_sequence.current()->diseqc.data, "\xE0\x00\x00", 3)) + eDebugNoSimulate("(DiSEqC reset)"); + else if (!memcmp(m_sec_sequence.current()->diseqc.data, "\xE0\x00\x03", 3)) + eDebugNoSimulate("(DiSEqC peripherial power on)"); + else + eDebugNoSimulate(""); ++m_sec_sequence.current(); break; case eSecCommand::SEND_TONEBURST: @@ -1886,10 +1913,10 @@ RESULT eDVBFrontend::prepare_sat(const eDVBFrontendParametersSatellite &feparm, return -EINVAL; } parm_inversion |= (feparm.rolloff << 2); // Hack.. we use bit 2..3 of inversion param for rolloff + parm_inversion |= (feparm.pilot << 4); // Hack.. we use bit 4..5 of inversion param for pilot if (feparm.modulation == eDVBFrontendParametersSatellite::Modulation::M8PSK) { parm_u_qpsk_fec_inner = (fe_code_rate_t)((int)parm_u_qpsk_fec_inner+9); // 8PSK fec driver values are decimal 9 bigger - parm_inversion |= (feparm.pilot << 4); // Hack.. we use bit 4..5 of inversion param for pilot } } #endif