vdr  2.4.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
cDvbTuner Class Reference
Collaboration diagram for cDvbTuner:
[legend]

Public Member Functions

 cDvbTuner (const cDvbDevice *Device, int Fd_Frontend, int Adapter, int Frontend)
 
virtual ~cDvbTuner ()
 
int FrontendType (void) const
 
bool Bond (cDvbTuner *Tuner)
 
void UnBond (void)
 
bool BondingOk (const cChannel *Channel, bool ConsiderOccupied=false) const
 
const cChannel * GetTransponder (void) const
 
uint32_t SubsystemId (void) const
 
bool IsTunedTo (const cChannel *Channel) const
 
void SetChannel (const cChannel *Channel)
 
bool Locked (int TimeoutMs=0)
 
const cPositioner * Positioner (void) const
 
bool GetSignalStats (int &Valid, double *Strength=NULL, double *Cnr=NULL, double *BerPre=NULL, double *BerPost=NULL, double *Per=NULL, int *Status=NULL) const
 
int GetSignalStrength (void) const
 
int GetSignalQuality (void) const
 
- Public Member Functions inherited from cThread
 cThread (const char *Description=NULL, bool LowPriority=false)
 
virtual ~cThread ()
 
void SetDescription (const char *Description,...) __attribute__((format(printf
 
void bool Start (void)
 
bool Active (void)
 

Private Types

enum  eTunerStatus {
  tsIdle, tsSet, tsPositioning, tsTuned,
  tsLocked
}
 

Private Member Functions

bool SetFrontendType (const cChannel *Channel)
 
cString GetBondingParams (const cChannel *Channel=NULL) const
 
cDvbTuner * GetBondedMaster (void)
 
bool IsBondedMaster (void) const
 
void ClearEventQueue (void) const
 
bool GetFrontendStatus (fe_status_t &Status) const
 
cPositioner * GetPositioner (void)
 
void ExecuteDiseqc (const cDiseqc *Diseqc, int *Frequency)
 
void ResetToneAndVoltage (void)
 
bool SetFrontend (void)
 
virtual void Action (void)
 

Private Attributes

int frontendType
 
const cDvbDevice * device
 
int fd_frontend
 
int adapter
 
int frontend
 
uint32_t subsystemId
 
int tuneTimeout
 
int lockTimeout
 
time_t lastTimeoutReport
 
uint32_t lastUncValue
 
uint32_t lastUncDelta
 
time_t lastUncChange
 
cChannel channel
 
const cDiseqc * lastDiseqc
 
int diseqcOffset
 
int lastSource
 
cPositioner * positioner
 
const cScr * scr
 
bool lnbPowerTurnedOn
 
eTunerStatus tunerStatus
 
cMutex mutex
 
cCondVar locked
 
cCondVar newSet
 
cDvbTuner * bondedTuner
 
bool bondedMaster
 

Static Private Attributes

static cMutex bondMutex
 

Additional Inherited Members

- Static Public Member Functions inherited from cThread
static tThreadId ThreadId (void)
 
static tThreadId IsMainThread (void)
 
static void SetMainThreadId (void)
 
- Protected Member Functions inherited from cThread
void SetPriority (int Priority)
 
void SetIOPriority (int Priority)
 
void Lock (void)
 
void Unlock (void)
 
bool Running (void)
 
void Cancel (int WaitSeconds=0)
 

Detailed Description

Definition at line 300 of file dvbdevice.c.

Member Enumeration Documentation

◆ eTunerStatus

Enumerator
tsIdle 
tsSet 
tsPositioning 
tsTuned 
tsLocked 

Definition at line 303 of file dvbdevice.c.

Constructor & Destructor Documentation

◆ cDvbTuner()

cDvbTuner::cDvbTuner ( const cDvbDevice *  Device,
int  Fd_Frontend,
int  Adapter,
int  Frontend 
)

◆ ~cDvbTuner()

cDvbTuner::~cDvbTuner ( )
virtual

Definition at line 386 of file dvbdevice.c.

References cCondVar::Broadcast(), cThread::Cancel(), locked, newSet, tsIdle, tunerStatus, and UnBond().

Member Function Documentation

◆ Action()

void cDvbTuner::Action ( void  )
privatevirtual

A derived cThread class must implement the code it wants to execute as a separate thread in this function.

If this is a loop, it must check Running() repeatedly to see whether it's time to stop.

Implements cThread.

Definition at line 1399 of file dvbdevice.c.

References adapter, cCondVar::Broadcast(), channel, diseqcOffset, esyslog, frontend, GetFrontendStatus(), cPositioner::IsMoving(), isyslog, lastDiseqc, lastSource, lastTimeoutReport, locked, lockTimeout, mutex, cChannel::Name(), newSet, cChannel::Number(), positioner, cThread::Running(), scr, SCR_RANDOM_TIMEOUT, cTimeMs::Set(), SetFrontend(), cTimeMs::TimedOut(), cCondVar::TimedWait(), cChannel::Transponder(), tsIdle, tsLocked, tsPositioning, tsSet, tsTuned, tunerStatus, and tuneTimeout.

◆ Bond()

bool cDvbTuner::Bond ( cDvbTuner *  Tuner)

Definition at line 401 of file dvbdevice.c.

References adapter, bondedMaster, bondedTuner, bondMutex, dsyslog, esyslog, frontend, and ResetToneAndVoltage().

Referenced by cDvbDevice::Bond().

◆ BondingOk()

bool cDvbTuner::BondingOk ( const cChannel *  Channel,
bool  ConsiderOccupied = false 
) const

Definition at line 450 of file dvbdevice.c.

References bondedTuner, bondMutex, GetBondingParams(), and IDLEPRIORITY.

Referenced by cDvbDevice::BondingOk().

◆ ClearEventQueue()

void cDvbTuner::ClearEventQueue ( void  ) const
private

Definition at line 542 of file dvbdevice.c.

References fd_frontend, cPoller::Poll(), and TUNER_POLL_TIMEOUT.

Referenced by GetFrontendStatus(), GetSignalStats(), and GetSignalStrength().

◆ ExecuteDiseqc()

void cDvbTuner::ExecuteDiseqc ( const cDiseqc *  Diseqc,
int *  Frequency 
)
private

◆ FrontendType()

int cDvbTuner::FrontendType ( void  ) const
inline

Definition at line 342 of file dvbdevice.c.

References frontendType.

Referenced by cDvbDevice::DeviceType().

◆ GetBondedMaster()

cDvbTuner * cDvbTuner::GetBondedMaster ( void  )
private

Definition at line 466 of file dvbdevice.c.

References adapter, bondedMaster, bondedTuner, bondMutex, dsyslog, and frontend.

Referenced by SetChannel().

◆ GetBondingParams()

cString cDvbTuner::GetBondingParams ( const cChannel *  Channel = NULL) const
private

◆ GetFrontendStatus()

bool cDvbTuner::GetFrontendStatus ( fe_status_t &  Status) const
private

Definition at line 552 of file dvbdevice.c.

References ClearEventQueue(), and fd_frontend.

Referenced by Action(), and GetSignalQuality().

◆ GetPositioner()

cPositioner * cDvbTuner::GetPositioner ( void  )
private

Definition at line 1171 of file dvbdevice.c.

References fd_frontend, cPositioner::GetPositioner(), positioner, and cPositioner::SetFrontend().

Referenced by ExecuteDiseqc().

◆ GetSignalQuality()

int cDvbTuner::GetSignalQuality ( void  ) const

◆ GetSignalStats()

bool cDvbTuner::GetSignalStats ( int &  Valid,
double *  Strength = NULL,
double *  Cnr = NULL,
double *  BerPre = NULL,
double *  BerPost = NULL,
double *  Per = NULL,
int *  Status = NULL 
) const

◆ GetSignalStrength()

int cDvbTuner::GetSignalStrength ( void  ) const

◆ GetTransponder()

const cChannel* cDvbTuner::GetTransponder ( void  ) const
inline

Definition at line 346 of file dvbdevice.c.

References channel.

Referenced by cDvbDevice::GetCurrentlyTunedTransponder().

◆ IsBondedMaster()

bool cDvbTuner::IsBondedMaster ( void  ) const
inlineprivate

Definition at line 331 of file dvbdevice.c.

References bondedMaster, and bondedTuner.

Referenced by SetFrontend().

◆ IsTunedTo()

bool cDvbTuner::IsTunedTo ( const cChannel *  Channel) const

◆ Locked()

bool cDvbTuner::Locked ( int  TimeoutMs = 0)

Definition at line 530 of file dvbdevice.c.

References locked, mutex, cCondVar::TimedWait(), tsLocked, and tunerStatus.

Referenced by cDvbDevice::HasLock().

◆ Positioner()

const cPositioner* cDvbTuner::Positioner ( void  ) const
inline

Definition at line 351 of file dvbdevice.c.

References positioner.

Referenced by ExecuteDiseqc(), and cDvbDevice::Positioner().

◆ ResetToneAndVoltage()

void cDvbTuner::ResetToneAndVoltage ( void  )
private

Definition at line 1237 of file dvbdevice.c.

References bondedTuner, CHECK, and fd_frontend.

Referenced by Bond(), ExecuteDiseqc(), SetChannel(), and SetFrontend().

◆ SetChannel()

void cDvbTuner::SetChannel ( const cChannel *  Channel)

◆ SetFrontend()

bool cDvbTuner::SetFrontend ( void  )
private

◆ SetFrontendType()

bool cDvbTuner::SetFrontendType ( const cChannel *  Channel)
private

◆ SubsystemId()

uint32_t cDvbTuner::SubsystemId ( void  ) const
inline

Definition at line 347 of file dvbdevice.c.

References subsystemId.

◆ UnBond()

void cDvbTuner::UnBond ( void  )

Definition at line 417 of file dvbdevice.c.

References adapter, bondedMaster, bondedTuner, bondMutex, dsyslog, and frontend.

Referenced by cDvbDevice::UnBond(), and ~cDvbTuner().

Member Data Documentation

◆ adapter

int cDvbTuner::adapter
private

◆ bondedMaster

bool cDvbTuner::bondedMaster
private

Definition at line 327 of file dvbdevice.c.

Referenced by Bond(), cDvbTuner(), GetBondedMaster(), IsBondedMaster(), and UnBond().

◆ bondedTuner

cDvbTuner* cDvbTuner::bondedTuner
private

◆ bondMutex

cMutex cDvbTuner::bondMutex
staticprivate

Definition at line 302 of file dvbdevice.c.

Referenced by Bond(), BondingOk(), GetBondedMaster(), SetChannel(), and UnBond().

◆ channel

cChannel cDvbTuner::channel
private

◆ device

const cDvbDevice* cDvbTuner::device
private

Definition at line 305 of file dvbdevice.c.

Referenced by cDvbTuner(), GetBondingParams(), SetChannel(), and SetFrontend().

◆ diseqcOffset

int cDvbTuner::diseqcOffset
private

Definition at line 317 of file dvbdevice.c.

Referenced by Action(), cDvbTuner(), ExecuteDiseqc(), and SetChannel().

◆ fd_frontend

int cDvbTuner::fd_frontend
private

◆ frontend

int cDvbTuner::frontend
private

◆ frontendType

int cDvbTuner::frontendType
private

Definition at line 304 of file dvbdevice.c.

Referenced by cDvbTuner(), FrontendType(), GetSignalQuality(), and SetFrontend().

◆ lastDiseqc

const cDiseqc* cDvbTuner::lastDiseqc
private

Definition at line 316 of file dvbdevice.c.

Referenced by Action(), cDvbTuner(), and SetFrontend().

◆ lastSource

int cDvbTuner::lastSource
private

Definition at line 318 of file dvbdevice.c.

Referenced by Action(), cDvbTuner(), and SetFrontend().

◆ lastTimeoutReport

time_t cDvbTuner::lastTimeoutReport
private

Definition at line 311 of file dvbdevice.c.

Referenced by Action(), cDvbTuner(), and SetChannel().

◆ lastUncChange

time_t cDvbTuner::lastUncChange
mutableprivate

Definition at line 314 of file dvbdevice.c.

Referenced by cDvbTuner(), and GetSignalQuality().

◆ lastUncDelta

uint32_t cDvbTuner::lastUncDelta
mutableprivate

Definition at line 313 of file dvbdevice.c.

Referenced by cDvbTuner(), and GetSignalQuality().

◆ lastUncValue

uint32_t cDvbTuner::lastUncValue
mutableprivate

Definition at line 312 of file dvbdevice.c.

Referenced by cDvbTuner(), and GetSignalQuality().

◆ lnbPowerTurnedOn

bool cDvbTuner::lnbPowerTurnedOn
private

Definition at line 321 of file dvbdevice.c.

Referenced by cDvbTuner(), and ExecuteDiseqc().

◆ locked

cCondVar cDvbTuner::locked
private

Definition at line 324 of file dvbdevice.c.

Referenced by Action(), Locked(), and ~cDvbTuner().

◆ lockTimeout

int cDvbTuner::lockTimeout
private

Definition at line 310 of file dvbdevice.c.

Referenced by Action(), cDvbTuner(), and SetFrontend().

◆ mutex

cMutex cDvbTuner::mutex
private

Definition at line 323 of file dvbdevice.c.

Referenced by Action(), Locked(), and SetChannel().

◆ newSet

cCondVar cDvbTuner::newSet
private

Definition at line 325 of file dvbdevice.c.

Referenced by Action(), SetChannel(), and ~cDvbTuner().

◆ positioner

cPositioner* cDvbTuner::positioner
private

Definition at line 319 of file dvbdevice.c.

Referenced by Action(), cDvbTuner(), ExecuteDiseqc(), GetPositioner(), and Positioner().

◆ scr

const cScr* cDvbTuner::scr
private

Definition at line 320 of file dvbdevice.c.

Referenced by Action(), cDvbTuner(), ExecuteDiseqc(), and SetFrontend().

◆ subsystemId

uint32_t cDvbTuner::subsystemId
private

Definition at line 308 of file dvbdevice.c.

Referenced by cDvbTuner(), GetSignalQuality(), GetSignalStrength(), and SubsystemId().

◆ tunerStatus

eTunerStatus cDvbTuner::tunerStatus
private

Definition at line 322 of file dvbdevice.c.

Referenced by Action(), cDvbTuner(), IsTunedTo(), Locked(), SetChannel(), and ~cDvbTuner().

◆ tuneTimeout

int cDvbTuner::tuneTimeout
private

Definition at line 309 of file dvbdevice.c.

Referenced by Action(), cDvbTuner(), and SetFrontend().


The documentation for this class was generated from the following file: