MythTV  master
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
DiSEqCDevTree Class Reference

DVB-S device tree class. More...

#include <diseqc.h>

Collaboration diagram for DiSEqCDevTree:
Collaboration graph
[legend]

Public Member Functions

 DiSEqCDevTree ()
 
 ~DiSEqCDevTree ()
 
bool Load (const QString &device)
 Loads the device tree from the database. More...
 
bool Load (uint cardid)
 Loads the device tree from the database. More...
 
bool Store (uint cardid, const QString &device="")
 Stores the device tree to the database. More...
 
bool Execute (const DiSEqCDevSettings &settings, const DTVMultiplex &tuning)
 Applies settings to the entire tree. More...
 
void Reset (void)
 Reset state of nodes in tree, forcing updates on the next Execute command. More...
 
DiSEqCDevRotorFindRotor (const DiSEqCDevSettings &settings, uint index=0)
 Returns the nth rotor device object in the tree. More...
 
DiSEqCDevLNBFindLNB (const DiSEqCDevSettings &settings)
 Returns the LNB device object selected by the configuration chain. More...
 
DiSEqCDevSCRFindSCR (const DiSEqCDevSettings &settings)
 Returns the SCR device object selected by the configuration chain. More...
 
DiSEqCDevDeviceFindDevice (uint dev_id)
 Returns a device by ID. More...
 
DiSEqCDevDeviceRoot (void)
 Retrieves the root node in the tree. More...
 
void SetRoot (DiSEqCDevDevice *root)
 Changes the root node of the tree. More...
 
bool SendCommand (uint adr, uint cmd, uint repeats=0, uint data_len=0, unsigned char *data=nullptr)
 Sends a DiSEqC command. More...
 
bool ResetDiseqc (bool hard_reset, bool is_SCR)
 Resets the DiSEqC bus. More...
 
void Open (int fd_frontend, bool is_SCR)
 Retrieve device tree. More...
 
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 cardid)
 Check if a Diseqc device tree exists. More...
 

Protected Member Functions

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

Protected Attributes

int m_fd_frontend {-1}
 
DiSEqCDevDevicem_root {nullptr}
 
uint m_last_voltage
 
uint m_previous_fake_diseqcid {kFirstFakeDiSEqCID}
 
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 73 of file diseqc.h.

Constructor & Destructor Documentation

◆ DiSEqCDevTree()

DiSEqCDevTree::DiSEqCDevTree ( )
inline

Definition at line 76 of file diseqc.h.

◆ ~DiSEqCDevTree()

DiSEqCDevTree::~DiSEqCDevTree ( )

Definition at line 305 of file diseqc.cpp.

Member Function Documentation

◆ Load() [1/2]

bool DiSEqCDevTree::Load ( const QString &  device)

Loads the device tree from the database.

Parameters
devicerecording input uses.
Returns
True if successful.

Definition at line 315 of file diseqc.cpp.

Referenced by DTVDeviceConfigGroup::DTVDeviceConfigGroup(), DiSEqCDevTrees::FindTree(), and DVBConfigurationGroup::reloadDiseqcTree().

◆ Load() [2/2]

bool DiSEqCDevTree::Load ( uint  cardid)

Loads the device tree from the database.

Parameters
cardidCapture card id.
Returns
True if successful.

Definition at line 347 of file diseqc.cpp.

◆ Store()

bool DiSEqCDevTree::Store ( uint  cardid,
const QString &  device = "" 
)

Stores the device tree to the database.

Parameters
cardidCapture card id.
deviceDevice id.
Returns
True if successful.

Definition at line 421 of file diseqc.cpp.

Referenced by DVBConfigurationGroup::Save().

◆ Execute()

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 511 of file diseqc.cpp.

Referenced by DVBChannel::Tune().

◆ Reset()

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 538 of file diseqc.cpp.

Referenced by ResetDiseqc().

◆ FindRotor()

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, nullptr otherwise.

Definition at line 552 of file diseqc.cpp.

Referenced by DVBChannel::GetRotor().

◆ FindLNB()

DiSEqCDevLNB * DiSEqCDevTree::FindLNB ( const DiSEqCDevSettings settings)

Returns the LNB device object selected by the configuration chain.

Parameters
settingsConfiguration chain in effect.
Returns
Pointer to LNB object if found, nullptr otherwise.

Definition at line 575 of file diseqc.cpp.

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

◆ FindSCR()

DiSEqCDevSCR * DiSEqCDevTree::FindSCR ( const DiSEqCDevSettings settings)

Returns the SCR device object selected by the configuration chain.

Parameters
settingsConfiguration chain in effect.
Returns
Pointer to SCR object if found, nullptr otherwise.

Definition at line 598 of file diseqc.cpp.

Referenced by DVBChannel::Open(), and DVBChannel::Tune().

◆ FindDevice()

DiSEqCDevDevice * DiSEqCDevTree::FindDevice ( uint  dev_id)

Returns a device by ID.

Parameters
dev_idDevice ID to find.
Returns
Pointer to device, or nullptr if not found in this tree.

Definition at line 622 of file diseqc.cpp.

◆ Root()

DiSEqCDevDevice* DiSEqCDevTree::Root ( void  )
inline

Retrieves the root node in the tree.

Definition at line 92 of file diseqc.h.

Referenced by DTVDeviceConfigGroup::DTVDeviceConfigGroup(), and DeviceTree::PopulateTree().

◆ SetRoot()

void DiSEqCDevTree::SetRoot ( DiSEqCDevDevice root)

Changes the root node of the tree.

Parameters
rootNew root node (may be nullptr).

Definition at line 634 of file diseqc.cpp.

Referenced by DeviceTree::DeleteDevice(), and DeviceTree::ValueChanged().

◆ SendCommand()

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

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 677 of file diseqc.cpp.

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

◆ ResetDiseqc()

bool DiSEqCDevTree::ResetDiseqc ( bool  hard_reset,
bool  is_SCR 
)

Resets the DiSEqC bus.

Parameters
hard_resetIf true, the bus will be power cycled.
is_SCRIs this an SCR bus?
Returns
True if successful.

Definition at line 747 of file diseqc.cpp.

Referenced by Open().

◆ Open()

void DiSEqCDevTree::Open ( int  fd_frontend,
bool  is_SCR 
)

Retrieve device tree.

Parameters
fd_frontendDVB frontend device file descriptor.
is_SCRIs this an SCR bus?

Definition at line 796 of file diseqc.cpp.

Referenced by DVBChannel::Open().

◆ Close()

void DiSEqCDevTree::Close ( void  )
inline

Definition at line 102 of file diseqc.h.

Referenced by DVBChannel::Close().

◆ GetFD()

int DiSEqCDevTree::GetFD ( void  ) const
inline

◆ SetTone()

bool DiSEqCDevTree::SetTone ( bool  on)

Definition at line 482 of file diseqc.cpp.

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

◆ SetVoltage()

bool DiSEqCDevTree::SetVoltage ( uint  voltage)

Definition at line 804 of file diseqc.cpp.

Referenced by ApplyVoltage(), ResetDiseqc(), and DiSEqCDevSCR::SendCommand().

◆ GetVoltage()

uint DiSEqCDevTree::GetVoltage ( void  ) const
inline

Definition at line 110 of file diseqc.h.

Referenced by DiSEqCDevRotor::GetProgress().

◆ IsInNeedOfConf()

bool DiSEqCDevTree::IsInNeedOfConf ( void  ) const

Definition at line 838 of file diseqc.cpp.

Referenced by CardUtil::IsInNeedOfExternalInputConf().

◆ AddDeferredDelete()

void DiSEqCDevTree::AddDeferredDelete ( uint  dev_id)
inline

Definition at line 114 of file diseqc.h.

Referenced by DiSEqCDevDevice::~DiSEqCDevDevice().

◆ CreateFakeDiSEqCID()

uint DiSEqCDevTree::CreateFakeDiSEqCID ( void  )
inline

Definition at line 115 of file diseqc.h.

Referenced by DiSEqCDevDevice::CreateByType().

◆ IsFakeDiSEqCID()

static bool DiSEqCDevTree::IsFakeDiSEqCID ( uint  id)
inlinestatic

Definition at line 117 of file diseqc.h.

Referenced by DiSEqCDevDevice::IsRealDeviceID().

◆ Exists()

bool DiSEqCDevTree::Exists ( int  cardid)
static

Check if a Diseqc device tree exists.

Parameters
cardidCapture card id.
Returns
True if exists.

Definition at line 392 of file diseqc.cpp.

Referenced by DVBConfigurationGroup::Load().

◆ ApplyVoltage()

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

Definition at line 846 of file diseqc.cpp.

Referenced by Execute().

Member Data Documentation

◆ m_fd_frontend

int DiSEqCDevTree::m_fd_frontend {-1}
protected

Definition at line 124 of file diseqc.h.

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

◆ m_root

DiSEqCDevDevice* DiSEqCDevTree::m_root {nullptr}
protected

◆ m_last_voltage

uint DiSEqCDevTree::m_last_voltage
protected

Definition at line 126 of file diseqc.h.

Referenced by Reset(), and SetVoltage().

◆ m_previous_fake_diseqcid

uint DiSEqCDevTree::m_previous_fake_diseqcid {kFirstFakeDiSEqCID}
protected

Definition at line 127 of file diseqc.h.

◆ m_delete

vector<uint> DiSEqCDevTree::m_delete
protected

Definition at line 128 of file diseqc.h.

Referenced by Load(), and Store().

◆ kFirstFakeDiSEqCID

const uint DiSEqCDevTree::kFirstFakeDiSEqCID = 0xf0000000
staticprotected

Definition at line 130 of file diseqc.h.


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