MythTV  0.26-pre
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
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)
 Check if a Diseqc device tree exists.

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

Definition at line 310 of file diseqc.cpp.

Definition at line 317 of file diseqc.cpp.


Member Function Documentation

Loads the device tree from the database.

Parameters:
cardidCapture 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().

Stores the device tree to the database.

Parameters:
cardidCapture 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:
settingsConfiguration chain to apply.
tuningTuning parameters.
Returns:
True if execution completed successfully.

Definition at line 484 of file diseqc.cpp.

Referenced by DVBChannel::Tune().

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:
settingsConfiguration chain in effect.
index0 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().

Returns the LNB device object selected by the configuration chain.

Parameters:
settingsConfiguration 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().

Returns a device by ID.

Parameters:
dev_idDevice 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().

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().

Changes the root node of the tree.

Parameters:
rootNew 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:
adrDiSEqC destination address.
cmdDiSEqC command.
repeatsNumber of times to repeat command.
data_lenLength of optional data.
dataPointer to optional data.

Definition at line 628 of file diseqc.cpp.

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

Resets the DiSEqC bus.

Parameters:
hard_resetIf 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]

Definition at line 455 of file diseqc.cpp.

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

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().

Definition at line 762 of file diseqc.cpp.

Referenced by CardUtil::IsInNeedOfExternalInputConf().

Definition at line 113 of file diseqc.h.

Referenced by DiSEqCDevDevice::~DiSEqCDevDevice().

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]

Check if a Diseqc device tree exists.

Parameters:
cardidCapture card id.
Returns:
True if exists.

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 Open(), SetTone(), and SetVoltage().

Definition at line 125 of file diseqc.h.

Referenced by Reset(), and SetVoltage().

Definition at line 126 of file diseqc.h.

vector<uint> DiSEqCDevTree::m_delete [protected]

Definition at line 127 of file diseqc.h.

Referenced by Load(), and Store().

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

Definition at line 129 of file diseqc.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends