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. Represents a tree of DVB-S devices. More...

#include <libmythtv/diseqc.h>

Collaboration diagram for DiSEqCDevTree:
[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, cmd_vec_t &data) const
 
bool SendCommand (uint adr, uint cmd, uint repeats=0) const
 
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) const
 
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_fdFrontend {-1}
 
DiSEqCDevDevicem_root {nullptr}
 
uint m_lastVoltage {UINT_MAX}
 
uint m_previousFakeDiseqcid {kFirstFakeDiSEqCID}
 
std::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::DiSEqCDevTree ( )
inline

Definition at line 77 of file diseqc.h.

◆ ~DiSEqCDevTree()

DiSEqCDevTree::~DiSEqCDevTree ( )

Definition at line 301 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 311 of file diseqc.cpp.

Referenced by CardUtil::DeleteInput(), 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 343 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 422 of file diseqc.cpp.

Referenced by CardUtil::DeleteInput(), and 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 509 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 536 of file diseqc.cpp.

Referenced by DiSEqCDevTree(), and 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 550 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 573 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 596 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 620 of file diseqc.cpp.

◆ Root()

DiSEqCDevDevice* DiSEqCDevTree::Root ( void  )
inline

Retrieves the root node in the tree.

Definition at line 93 of file diseqc.h.

Referenced by CardUtil::DeleteInput(), 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 632 of file diseqc.cpp.

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

◆ SendCommand() [1/2]

bool DiSEqCDevTree::SendCommand ( uint  adr,
uint  cmd,
uint  repeats,
cmd_vec_t data 
) const

◆ SendCommand() [2/2]

bool DiSEqCDevTree::SendCommand ( uint  adr,
uint  cmd,
uint  repeats = 0 
) const
inline

Definition at line 98 of file diseqc.h.

◆ 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 741 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 790 of file diseqc.cpp.

Referenced by DVBChannel::Open().

◆ Close()

void DiSEqCDevTree::Close ( void  )
inline

Definition at line 108 of file diseqc.h.

Referenced by DVBChannel::Close().

◆ GetFD()

int DiSEqCDevTree::GetFD ( void  ) const
inline

◆ SetTone()

bool DiSEqCDevTree::SetTone ( bool  on) const

Definition at line 482 of file diseqc.cpp.

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

◆ SetVoltage()

bool DiSEqCDevTree::SetVoltage ( uint  voltage)

Definition at line 798 of file diseqc.cpp.

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

◆ GetVoltage()

uint DiSEqCDevTree::GetVoltage ( void  ) const
inline

Definition at line 116 of file diseqc.h.

Referenced by DiSEqCDevRotor::GetProgress().

◆ IsInNeedOfConf()

bool DiSEqCDevTree::IsInNeedOfConf ( void  ) const

Definition at line 834 of file diseqc.cpp.

Referenced by CardUtil::IsInNeedOfExternalInputConf().

◆ AddDeferredDelete()

void DiSEqCDevTree::AddDeferredDelete ( uint  dev_id)
inline

Definition at line 120 of file diseqc.h.

Referenced by DiSEqCDevDevice::~DiSEqCDevDevice().

◆ CreateFakeDiSEqCID()

uint DiSEqCDevTree::CreateFakeDiSEqCID ( void  )
inline

Definition at line 121 of file diseqc.h.

Referenced by DiSEqCDevDevice::CreateByType().

◆ IsFakeDiSEqCID()

static bool DiSEqCDevTree::IsFakeDiSEqCID ( uint  id)
inlinestatic

Definition at line 123 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 393 of file diseqc.cpp.

Referenced by DVBConfigurationGroup::Load().

◆ ApplyVoltage()

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

Definition at line 842 of file diseqc.cpp.

Referenced by Execute().

Member Data Documentation

◆ m_fdFrontend

int DiSEqCDevTree::m_fdFrontend {-1}
protected

Definition at line 130 of file diseqc.h.

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

◆ m_root

DiSEqCDevDevice* DiSEqCDevTree::m_root {nullptr}
protected

◆ m_lastVoltage

uint DiSEqCDevTree::m_lastVoltage {UINT_MAX}
protected

Definition at line 132 of file diseqc.h.

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

◆ m_previousFakeDiseqcid

uint DiSEqCDevTree::m_previousFakeDiseqcid {kFirstFakeDiSEqCID}
protected

Definition at line 133 of file diseqc.h.

Referenced by CreateFakeDiSEqCID().

◆ m_delete

std::vector<uint> DiSEqCDevTree::m_delete
protected

Definition at line 134 of file diseqc.h.

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

◆ kFirstFakeDiSEqCID

const uint DiSEqCDevTree::kFirstFakeDiSEqCID = 0xf0000000
staticprotected

Definition at line 136 of file diseqc.h.

Referenced by IsFakeDiSEqCID().


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