vdr  2.0.6
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 cChannelGetTransponder (void) const
 
uint32_t SubsystemId (void) const
 
bool IsTunedTo (const cChannel *Channel) const
 
void SetChannel (const cChannel *Channel)
 
bool Locked (int TimeoutMs=0)
 
int GetSignalStrength (void) const
 
int GetSignalQuality (void) const
 
bool SetIdle (bool Idle)
 
bool IsIdle (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, tsTuned, tsLocked }
 

Private Member Functions

bool SetFrontendType (const cChannel *Channel)
 
cString GetBondingParams (const cChannel *Channel=NULL) const
 
cDvbTunerGetBondedMaster (void)
 
bool IsBondedMaster (void) const
 
void ClearEventQueue (void) const
 
bool GetFrontendStatus (fe_status_t &Status) const
 
void ExecuteDiseqc (const cDiseqc *Diseqc, unsigned int *Frequency)
 
void ResetToneAndVoltage (void)
 
bool SetFrontend (void)
 
virtual void Action (void)
 
bool OpenFrontend (void) const
 
bool CloseFrontend (void)
 

Private Attributes

int frontendType
 
const cDvbDevicedevice
 
int fd_frontend
 
int adapter
 
int frontend
 
uint32_t subsystemId
 
int tuneTimeout
 
int lockTimeout
 
time_t lastTimeoutReport
 
cChannel channel
 
const cDiseqclastDiseqc
 
const cScrscr
 
bool lnbPowerTurnedOn
 
eTunerStatus tunerStatus
 
cMutex mutex
 
cCondVar locked
 
cCondVar newSet
 
cDvbTunerbondedTuner
 
bool bondedMaster
 
bool isIdle
 

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 284 of file dvbdevice.c.

Member Enumeration Documentation

Enumerator
tsIdle 
tsSet 
tsTuned 
tsLocked 

Definition at line 287 of file dvbdevice.c.

Constructor & Destructor Documentation

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

Member Function Documentation

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 881 of file dvbdevice.c.

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

bool cDvbTuner::Bond ( cDvbTuner Tuner)

Definition at line 380 of file dvbdevice.c.

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

Referenced by cDvbDevice::Bond().

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

Definition at line 429 of file dvbdevice.c.

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

Referenced by cDvbDevice::BondingOk().

void cDvbTuner::ClearEventQueue ( void  ) const
private

Definition at line 520 of file dvbdevice.c.

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

Referenced by GetFrontendStatus(), and GetSignalStrength().

bool cDvbTuner::CloseFrontend ( void  )
private

Definition at line 966 of file dvbdevice.c.

References cCondVar::Broadcast(), fd_frontend, mutex, newSet, tsIdle, and tunerStatus.

Referenced by SetIdle(), and ~cDvbTuner().

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

Definition at line 323 of file dvbdevice.c.

References frontendType.

Referenced by cDvbDevice::DeviceType().

cDvbTuner * cDvbTuner::GetBondedMaster ( void  )
private

Definition at line 445 of file dvbdevice.c.

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

Referenced by SetChannel().

cString cDvbTuner::GetBondingParams ( const cChannel Channel = NULL) const
private
bool cDvbTuner::GetFrontendStatus ( fe_status_t &  Status) const
private

Definition at line 532 of file dvbdevice.c.

References ClearEventQueue(), and fd_frontend.

Referenced by Action(), and GetSignalQuality().

int cDvbTuner::GetSignalQuality ( void  ) const
int cDvbTuner::GetSignalStrength ( void  ) const

Definition at line 547 of file dvbdevice.c.

References adapter, ClearEventQueue(), fd_frontend, frontend, and subsystemId.

Referenced by cDvbDevice::SignalStrength().

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

Definition at line 327 of file dvbdevice.c.

References channel.

Referenced by cDvbDevice::GetCurrentlyTunedTransponder().

bool cDvbTuner::IsBondedMaster ( void  ) const
inlineprivate

Definition at line 309 of file dvbdevice.c.

References bondedMaster.

Referenced by SetFrontend().

bool cDvbTuner::IsIdle ( void  ) const
inline

Definition at line 336 of file dvbdevice.c.

References isIdle.

Referenced by cDvbDevice::ProvidesEIT().

bool cDvbTuner::IsTunedTo ( const cChannel Channel) const
bool cDvbTuner::Locked ( int  TimeoutMs = 0)

Definition at line 508 of file dvbdevice.c.

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

Referenced by cDvbDevice::HasLock().

bool cDvbTuner::OpenFrontend ( void  ) const
private
void cDvbTuner::ResetToneAndVoltage ( void  )
private

Definition at line 710 of file dvbdevice.c.

References bondedTuner, CHECK, and fd_frontend.

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

void cDvbTuner::SetChannel ( const cChannel Channel)
bool cDvbTuner::SetFrontend ( void  )
private
bool cDvbTuner::SetFrontendType ( const cChannel Channel)
private
bool cDvbTuner::SetIdle ( bool  Idle)

Definition at line 944 of file dvbdevice.c.

References CloseFrontend(), isIdle, and OpenFrontend().

Referenced by cDvbDevice::SetIdleDevice().

uint32_t cDvbTuner::SubsystemId ( void  ) const
inline

Definition at line 328 of file dvbdevice.c.

References subsystemId.

void cDvbTuner::UnBond ( void  )

Definition at line 396 of file dvbdevice.c.

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

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

Member Data Documentation

int cDvbTuner::adapter
private
bool cDvbTuner::bondedMaster
private

Definition at line 305 of file dvbdevice.c.

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

cDvbTuner* cDvbTuner::bondedTuner
private
cMutex cDvbTuner::bondMutex
staticprivate

Definition at line 286 of file dvbdevice.c.

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

cChannel cDvbTuner::channel
private
const cDvbDevice* cDvbTuner::device
private

Definition at line 289 of file dvbdevice.c.

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

int cDvbTuner::fd_frontend
mutableprivate
int cDvbTuner::frontend
private
int cDvbTuner::frontendType
private

Definition at line 288 of file dvbdevice.c.

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

bool cDvbTuner::isIdle
mutableprivate

Definition at line 317 of file dvbdevice.c.

Referenced by Action(), cDvbTuner(), IsIdle(), OpenFrontend(), and SetIdle().

const cDiseqc* cDvbTuner::lastDiseqc
private

Definition at line 297 of file dvbdevice.c.

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

time_t cDvbTuner::lastTimeoutReport
private

Definition at line 295 of file dvbdevice.c.

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

bool cDvbTuner::lnbPowerTurnedOn
private

Definition at line 299 of file dvbdevice.c.

Referenced by cDvbTuner(), and ExecuteDiseqc().

cCondVar cDvbTuner::locked
private

Definition at line 302 of file dvbdevice.c.

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

int cDvbTuner::lockTimeout
private

Definition at line 294 of file dvbdevice.c.

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

cMutex cDvbTuner::mutex
mutableprivate

Definition at line 301 of file dvbdevice.c.

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

cCondVar cDvbTuner::newSet
private

Definition at line 303 of file dvbdevice.c.

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

const cScr* cDvbTuner::scr
private

Definition at line 298 of file dvbdevice.c.

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

uint32_t cDvbTuner::subsystemId
private

Definition at line 292 of file dvbdevice.c.

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

eTunerStatus cDvbTuner::tunerStatus
private

Definition at line 300 of file dvbdevice.c.

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

int cDvbTuner::tuneTimeout
private

Definition at line 293 of file dvbdevice.c.

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


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