DiSEqCDevTree Class Reference

DVB-S device tree class. More...

#include <diseqc.h>

List of all members.

Public Member Functions

 DiSEqCDevTree ()
 ~DiSEqCDevTree ()
bool Load (uint cardid)
 Loads the device tree from the database.
bool Store (uint cardid)
 Stores the device tree to the database.
bool Execute (const DiSEqCDevSettings &settings, const DTVMultiplex &tuning)
 Applies settings to the entire tree.
void Reset (void)
 Reset state of nodes in tree, forcing updates on the next Execute command.
DiSEqCDevRotorFindRotor (const DiSEqCDevSettings &settings, uint index=0)
 Returns the nth rotor device object in the tree.
DiSEqCDevLNBFindLNB (const DiSEqCDevSettings &settings)
 Returns the LNB device object selected by the configuration chain.
DiSEqCDevDeviceFindDevice (uint dev_id)
 Returns a device by ID.
DiSEqCDevDeviceRoot (void)
 Retrieves the root node in the tree.
void SetRoot (DiSEqCDevDevice *root)
 Changes the root node of the tree.
bool SendCommand (uint adr, uint cmd, uint repeats=0, uint data_len=0, unsigned char *data=NULL)
 Sends a DiSEqC command.
bool ResetDiseqc (bool hard_reset)
 Resets the DiSEqC bus.
void Open (int fd_frontend)
void Close (void)
int GetFD (void) const
bool SetTone (bool on)
bool SetVoltage (uint voltage)
uint GetVoltage (void) const
bool IsInNeedOfConf (void) const
void AddDeferredDelete (uint dev_id)
uint CreateFakeDiSEqCID (void)

Static Public Member Functions

static bool IsFakeDiSEqCID (uint id)
static bool Exists (int id)

Protected Member Functions

bool ApplyVoltage (const DiSEqCDevSettings &settings, const DTVMultiplex &tuning)

Protected Attributes

int m_fd_frontend
DiSEqCDevDevicem_root
uint m_last_voltage
uint m_previous_fake_diseqcid
vector< uintm_delete

Static Protected Attributes

static const uint kFirstFakeDiSEqCID = 0xf0000000

Detailed Description

DVB-S device tree class.

Represents a tree of DVB-S devices.

Definition at line 74 of file diseqc.h.


Constructor & Destructor Documentation

DiSEqCDevTree::DiSEqCDevTree (  ) 

Definition at line 310 of file diseqc.cpp.

DiSEqCDevTree::~DiSEqCDevTree (  ) 

Definition at line 317 of file diseqc.cpp.


Member Function Documentation

bool DiSEqCDevTree::Load ( uint  cardid  ) 

Loads the device tree from the database.

Parameters:
cardid Capture card id.
Returns:
True if successful.

Definition at line 327 of file diseqc.cpp.

Referenced by CardUtil::DeleteCard(), DTVDeviceConfigGroup::DTVDeviceConfigGroup(), DiSEqCDevTrees::FindTree(), and DVBConfigurationGroup::Load().

bool DiSEqCDevTree::Store ( uint  cardid  ) 

Stores the device tree to the database.

Parameters:
cardid Capture card id.
Returns:
True if successful.

Definition at line 398 of file diseqc.cpp.

Referenced by convert_diseqc_db(), CardUtil::DeleteCard(), and DVBConfigurationGroup::Save().

bool DiSEqCDevTree::Execute ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning 
)

Applies settings to the entire tree.

Parameters:
settings Configuration chain to apply.
tuning Tuning parameters.
Returns:
True if execution completed successfully.

Definition at line 484 of file diseqc.cpp.

Referenced by DVBChannel::Tune().

void DiSEqCDevTree::Reset ( void   ) 

Reset state of nodes in tree, forcing updates on the next Execute command.

Returns:
True if reset completed successfully.

Definition at line 511 of file diseqc.cpp.

Referenced by DiSEqCDevTree(), and ResetDiseqc().

DiSEqCDevRotor * DiSEqCDevTree::FindRotor ( const DiSEqCDevSettings settings,
uint  index = 0 
)

Returns the nth rotor device object in the tree.

Parameters:
settings Configuration chain in effect.
index 0 for first rotor, 1 for second, etc.
Returns:
Pointer to rotor object if found, NULL otherwise.

Definition at line 525 of file diseqc.cpp.

Referenced by DVBChannel::GetRotor().

DiSEqCDevLNB * DiSEqCDevTree::FindLNB ( const DiSEqCDevSettings settings  ) 

Returns the LNB device object selected by the configuration chain.

Parameters:
settings Configuration chain in effect.
Returns:
Pointer to LNB object if found, NULL otherwise.

Definition at line 548 of file diseqc.cpp.

Referenced by DiSEqCDevSwitch::ExecuteDiseqc(), DiSEqCDevSwitch::ExecuteLegacy(), DiSEqCDevSwitch::ShouldSwitch(), and DVBChannel::Tune().

DiSEqCDevDevice * DiSEqCDevTree::FindDevice ( uint  dev_id  ) 

Returns a device by ID.

Parameters:
dev_id Device ID to find.
Returns:
Pointer to device, or NULL if not found in this tree.

Definition at line 572 of file diseqc.cpp.

Referenced by DeviceTree::CreateNewNodeDialog(), DeviceTree::del(), and DeviceTree::EditNodeDialog().

DiSEqCDevDevice* DiSEqCDevTree::Root ( void   )  [inline]

Retrieves the root node in the tree.

Definition at line 91 of file diseqc.h.

Referenced by DTVDeviceConfigGroup::AddNodes(), CardUtil::DeleteCard(), DTVDeviceConfigGroup::DTVDeviceConfigGroup(), and DeviceTree::PopulateTree().

void DiSEqCDevTree::SetRoot ( DiSEqCDevDevice root  ) 

Changes the root node of the tree.

Parameters:
root New root node (may be NULL).

Definition at line 584 of file diseqc.cpp.

Referenced by convert_diseqc_db(), DeviceTree::CreateRootNodeDialog(), DeviceTree::del(), and CardUtil::DeleteCard().

bool DiSEqCDevTree::SendCommand ( uint  adr,
uint  cmd,
uint  repeats = 0,
uint  data_len = 0,
unsigned char *  data = NULL 
)

Sends a DiSEqC command.

Parameters:
adr DiSEqC destination address.
cmd DiSEqC command.
repeats Number of times to repeat command.
data_len Length of optional data.
data Pointer to optional data.

Definition at line 628 of file diseqc.cpp.

Referenced by DiSEqCDevSwitch::ExecuteDiseqc(), DiSEqCDevRotor::ExecuteRotor(), DiSEqCDevRotor::ExecuteUSALS(), and ResetDiseqc().

bool DiSEqCDevTree::ResetDiseqc ( bool  hard_reset  ) 

Resets the DiSEqC bus.

Parameters:
hard_reset If true, the bus will be power cycled.
Returns:
True if successful.

Definition at line 687 of file diseqc.cpp.

Referenced by Open().

void DiSEqCDevTree::Open ( int  fd_frontend  ) 

Definition at line 720 of file diseqc.cpp.

Referenced by DVBChannel::Open().

void DiSEqCDevTree::Close ( void   )  [inline]

Definition at line 101 of file diseqc.h.

Referenced by DVBChannel::Close().

int DiSEqCDevTree::GetFD ( void   )  const [inline]
bool DiSEqCDevTree::SetTone ( bool  on  ) 

Definition at line 455 of file diseqc.cpp.

Referenced by DiSEqCDevLNB::Execute(), and Execute().

bool DiSEqCDevTree::SetVoltage ( uint  voltage  ) 

Definition at line 728 of file diseqc.cpp.

Referenced by ApplyVoltage(), and ResetDiseqc().

uint DiSEqCDevTree::GetVoltage ( void   )  const [inline]

Definition at line 109 of file diseqc.h.

Referenced by DiSEqCDevRotor::GetProgress().

bool DiSEqCDevTree::IsInNeedOfConf ( void   )  const

Definition at line 762 of file diseqc.cpp.

Referenced by CardUtil::IsInNeedOfExternalInputConf().

void DiSEqCDevTree::AddDeferredDelete ( uint  dev_id  )  [inline]

Definition at line 113 of file diseqc.h.

Referenced by DiSEqCDevDevice::~DiSEqCDevDevice().

uint DiSEqCDevTree::CreateFakeDiSEqCID ( void   )  [inline]

Definition at line 114 of file diseqc.h.

Referenced by DiSEqCDevDevice::CreateByType().

static bool DiSEqCDevTree::IsFakeDiSEqCID ( uint  id  )  [inline, static]

Definition at line 116 of file diseqc.h.

Referenced by DiSEqCDevDevice::IsRealDeviceID().

bool DiSEqCDevTree::Exists ( int  id  )  [static]

Definition at line 370 of file diseqc.cpp.

Referenced by DVBConfigurationGroup::Load().

bool DiSEqCDevTree::ApplyVoltage ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning 
) [protected]

Definition at line 770 of file diseqc.cpp.

Referenced by Execute().


Member Data Documentation

Definition at line 123 of file diseqc.h.

Referenced by Close(), GetFD(), Open(), SetTone(), and SetVoltage().

Definition at line 125 of file diseqc.h.

Referenced by GetVoltage(), Reset(), and SetVoltage().

Definition at line 126 of file diseqc.h.

Referenced by CreateFakeDiSEqCID().

vector<uint> DiSEqCDevTree::m_delete [protected]

Definition at line 127 of file diseqc.h.

Referenced by AddDeferredDelete(), Load(), and Store().

const uint DiSEqCDevTree::kFirstFakeDiSEqCID = 0xf0000000 [static, protected]

Definition at line 129 of file diseqc.h.

Referenced by IsFakeDiSEqCID().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Mon May 28 06:42:00 2012 for MythTV by  doxygen 1.6.3