senf::DVBSocketController Class Reference

Helperclass for configuration and controlling DVB devices. More...

#include <senf/Socket/Protocols/DVB/DVBSocketController.hh>

Inheritance diagram for senf::DVBSocketController:

Public Types

typedef boost::function< void(const struct dvb_frontend_event &)> Callback
 Callback which is called when an asynchronous tuning succeeds. More...
 

Public Member Functions

 DVBSocketController (DVBFrontendHandle frontendHandle_=DVBFrontendHandle(0, 0), const Callback &cb=NULL)
 
 ~DVBSocketController ()
 
DVBDemuxSectionHandle createDVBDemuxSectionHandle (int adapternumber=0, int demuxnumber=0, bool addToConsole=false)
 
DVBDemuxPESHandle createDVBDemuxPESHandle (int adapternumber=0, int demuxnumber=0, bool addToConsole=false)
 
void addToConsole (DVBDemuxSectionHandle sh)
 Adds an DVBDemuxSectionHandle to the console. More...
 
void addToConsole (DVBDemuxPESHandle sh)
 Adds an DVBDemuxPESHandle to the console. More...
 
void tuneToCMD (std::string const &input, std::string const &mode="async")
 Tunes a DVB device given by the type of the DVBFrontendHandle. More...
 
void tuneTo (std::string const &channel)
 Tunes a DVB device to a channel. More...
 
void tuneDVB_S (unsigned int frequency, fe_spectral_inversion_t inversion, unsigned int symbole_rate, fe_code_rate_t code_rate)
 Tunes a DVB-S device. More...
 
void tuneDVB_T (unsigned int frequency, fe_spectral_inversion_t inversion, fe_bandwidth_t bandwidth, fe_code_rate_t code_rate_HP, fe_code_rate_t code_rate_LP, fe_modulation_t constellation, fe_transmit_mode_t transmission_mode, fe_guard_interval_t guard_interval, fe_hierarchy_t hierarchy_information)
 Tunes a DVB-T device. More...
 
void tuneDVB_C (unsigned int frequency, fe_spectral_inversion_t inversion, unsigned int symbol_rate, fe_code_rate_t fec_inner, fe_modulation_t modulation)
 Tunes a DVB-C device. More...
 
dvb_frontend_event tuneTo_sync (std::string const &channel)
 Tunes a DVB device given by the type of the DVBFrontendHandle. More...
 
dvb_frontend_event tuneDVB_S_sync (unsigned int frequency, fe_spectral_inversion_t inversion, unsigned int symbole_rate, fe_code_rate_t code_rate)
 Tunes a DVB-S device. More...
 
dvb_frontend_event tuneDVB_T_sync (unsigned int frequency, fe_spectral_inversion_t inversion, fe_bandwidth_t bandwidth, fe_code_rate_t code_rate_HP, fe_code_rate_t code_rate_LP, fe_modulation_t constellation, fe_transmit_mode_t transmission_mode, fe_guard_interval_t guard_interval, fe_hierarchy_t hierarsourcechy_information)
 Tunes a DVB-T device. More...
 
dvb_frontend_event tuneDVB_C_sync (unsigned int frequency, fe_spectral_inversion_t inversion, unsigned int symbol_rate, fe_code_rate_t fec_inner, fe_modulation_t modulation)
 Tunes a DVB-C device. More...
 
fe_type_t getType ()
 Returns the type of the card. The type is defined in frontend.h. More...
 
std::string getTypeString ()
 Returns the type of the card. More...
 
std::string status2String (fe_status_t status)
 Returns a human readable status information. More...
 
unsigned int bitErrorRate () const
 Returns the bit error rate. More...
 
unsigned int signalToNoiseRatio () const
 Returns the signal to noise ratio. More...
 
unsigned int signalStrength () const
 Returns the signal strength. More...
 
std::string getTuneInfo (const std::string &conf="Ssbuf")
 Returns a string which shows actual tuning status. More...
 

Public Attributes

console::ScopedDirectory dir
 

Detailed Description

Helperclass for configuration and controlling DVB devices.

The DVB API provides two methods for tuning. The first method is synchronous, which means e.g. "tuneTo_sync" will return when the tuning operation on the card succeed, no matter how long it takes. The second (preferred) method is to tune asynchronous. The call "tuneTo" will return immediately and (if a callback was set) call the callback when the tuning operation succeeds.

Note that you may have to take draw backs in using this API. This dues to the implementation of the DVB device driver which you or your kernel choose. It has shown that the completeness of implementations vary from driver to driver. This wrapper provides the full Frontend API which is defined by Convergence. You have to find out which parts of these functionality are implemented by your preferred device driver by your own.

Definition at line 46 of file DVBSocketController.hh.

Member Typedef Documentation

◆ Callback

typedef boost::function<void (const struct dvb_frontend_event & )> senf::DVBSocketController::Callback

Callback which is called when an asynchronous tuning succeeds.

Definition at line 52 of file DVBSocketController.hh.

Constructor & Destructor Documentation

◆ DVBSocketController()

senf::DVBSocketController::DVBSocketController ( DVBFrontendHandle  frontendHandle_ = DVBFrontendHandle(0,0),
const Callback cb = NULL 
)

Definition at line 33 of file DVBSocketController.cc.

◆ ~DVBSocketController()

senf::DVBSocketController::~DVBSocketController ( )

Definition at line 48 of file DVBSocketController.cc.

Member Function Documentation

◆ addToConsole() [1/2]

void senf::DVBSocketController::addToConsole ( senf::DVBDemuxSectionHandle  sh)

Adds an DVBDemuxSectionHandle to the console.

Allocates the functionality of DVBDemuxSectionProtocol into the folder of the DVBSocketController. If the protocol is closed, or all handles are discarded the console support will automatically removed.

Parameters
[in]shhandle of a protocol

Definition at line 73 of file DVBSocketController.cc.

◆ addToConsole() [2/2]

void senf::DVBSocketController::addToConsole ( senf::DVBDemuxPESHandle  sh)

Adds an DVBDemuxPESHandle to the console.

Allocates the functionality of DVBDemuxPESProtocol into the folder of the DVBSocketController. If the protocol is closed, or all handles are discarded the console support will automatically removed.

Parameters
[in]shhandle of a protocol

Definition at line 81 of file DVBSocketController.cc.

◆ bitErrorRate()

unsigned int senf::DVBSocketController::bitErrorRate ( ) const

Returns the bit error rate.

Note
This function may not be implemented by your specific driver implementation. In this case the output is random. This is true for: Cinergy T� (2.6.27), Terratec Cinergy DT USB XS Diversity (2.6.27)

Definition at line 358 of file DVBSocketController.cc.

◆ createDVBDemuxPESHandle()

senf::DVBDemuxPESHandle senf::DVBSocketController::createDVBDemuxPESHandle ( int  adapternumber = 0,
int  demuxnumber = 0,
bool  addToConsole = false 
)

Definition at line 63 of file DVBSocketController.cc.

◆ createDVBDemuxSectionHandle()

senf::DVBDemuxSectionHandle senf::DVBSocketController::createDVBDemuxSectionHandle ( int  adapternumber = 0,
int  demuxnumber = 0,
bool  addToConsole = false 
)

Definition at line 52 of file DVBSocketController.cc.

◆ getTuneInfo()

std::string senf::DVBSocketController::getTuneInfo ( const std::string &  conf = "Ssbuf")

Returns a string which shows actual tuning status.


"S" prints signal strength (in hex)
"s" prints signal to noise ration (in hex)
"b" prints bit error rate (in hex)
"u" prints uncorrected blocks (in hex)
"f" prints readable overall status e.g. "Has Lock"
These characters can be used to form the output. Be aware, some features may not be supported be your current driver implementation and could end in throwing an exception!

Definition at line 376 of file DVBSocketController.cc.

◆ getType()

fe_type_t senf::DVBSocketController::getType ( )

Returns the type of the card. The type is defined in frontend.h.

Definition at line 440 of file DVBSocketController.cc.

◆ getTypeString()

std::string senf::DVBSocketController::getTypeString ( )

Returns the type of the card.

Returns the type of the card but human readable e.g. "DVB-S", "DVB-T" or "DVB-C"

Definition at line 344 of file DVBSocketController.cc.

◆ signalStrength()

unsigned int senf::DVBSocketController::signalStrength ( ) const

Returns the signal strength.

Returns the signal to noise ratio

Note
This function may not be implemented by your specific driver implementation. In this case the output is random.

Definition at line 370 of file DVBSocketController.cc.

◆ signalToNoiseRatio()

unsigned int senf::DVBSocketController::signalToNoiseRatio ( ) const

Returns the signal to noise ratio.

Note
This function may not be implemented by your specific driver implementation. In this case the output is random. This is true for: Cinergy T� (2.6.27), Terratec Cinergy DT USB XS Diversity (2.6.27)

Definition at line 364 of file DVBSocketController.cc.

◆ status2String()

std::string senf::DVBSocketController::status2String ( fe_status_t  status)

Returns a human readable status information.

Returns a human readable version of fe_status_t (defined by frontend.h)

Definition at line 419 of file DVBSocketController.cc.

◆ tuneDVB_C()

void senf::DVBSocketController::tuneDVB_C ( unsigned int  frequency,
fe_spectral_inversion_t  inversion,
unsigned int  symbol_rate,
fe_code_rate_t  fec_inner,
fe_modulation_t  modulation 
)

Tunes a DVB-C device.

Tunes a DVB-C device in asynchronous mode and calls the callback if existing. Needs full configuration.

Definition at line 219 of file DVBSocketController.cc.

◆ tuneDVB_C_sync()

dvb_frontend_event senf::DVBSocketController::tuneDVB_C_sync ( unsigned int  frequency,
fe_spectral_inversion_t  inversion,
unsigned int  symbol_rate,
fe_code_rate_t  fec_inner,
fe_modulation_t  modulation 
)

Tunes a DVB-C device.

Tunes a DVB-C device in synchronous mode. Needs full configuration

Returns
dvb_frontend_event
Note
The member "dvb_frontend_event.status" should be correct by the most device driver implementations. But "dvb_frontend_event.parameters" maybe not and is definitely not set by: Cinergy T� (2.6.27), Terratec Cinergy DT USB XS Diversity (2.6.27)

Definition at line 321 of file DVBSocketController.cc.

◆ tuneDVB_S()

void senf::DVBSocketController::tuneDVB_S ( unsigned int  frequency,
fe_spectral_inversion_t  inversion,
unsigned int  symbole_rate,
fe_code_rate_t  code_rate 
)

Tunes a DVB-S device.

Tunes a DVB-S device in asynchronous mode and calls the callback if existing. Needs full configuration

Definition at line 204 of file DVBSocketController.cc.

◆ tuneDVB_S_sync()

dvb_frontend_event senf::DVBSocketController::tuneDVB_S_sync ( unsigned int  frequency,
fe_spectral_inversion_t  inversion,
unsigned int  symbole_rate,
fe_code_rate_t  code_rate 
)

Tunes a DVB-S device.

Tunes a DVB-S device in synchronous mode. Needs full configuration

Returns
dvb_frontend_event
Note
The member "dvb_frontend_event.status" should be correct by the most device driver implementations. But "dvb_frontend_event.parameters" maybe not and is definitely not set by: Cinergy T� (2.6.27), Terratec Cinergy DT USB XS Diversity (2.6.27)

Definition at line 302 of file DVBSocketController.cc.

◆ tuneDVB_T()

void senf::DVBSocketController::tuneDVB_T ( unsigned int  frequency,
fe_spectral_inversion_t  inversion,
fe_bandwidth_t  bandwidth,
fe_code_rate_t  code_rate_HP,
fe_code_rate_t  code_rate_LP,
fe_modulation_t  constellation,
fe_transmit_mode_t  transmission_mode,
fe_guard_interval_t  guard_interval,
fe_hierarchy_t  hierarchy_information 
)

Tunes a DVB-T device.

Tunes a DVB-T device in asynchronous mode and calls the callback if existing. Needs full configuration.

Definition at line 175 of file DVBSocketController.cc.

◆ tuneDVB_T_sync()

dvb_frontend_event senf::DVBSocketController::tuneDVB_T_sync ( unsigned int  frequency,
fe_spectral_inversion_t  inversion,
fe_bandwidth_t  bandwidth,
fe_code_rate_t  code_rate_HP,
fe_code_rate_t  code_rate_LP,
fe_modulation_t  constellation,
fe_transmit_mode_t  transmission_mode,
fe_guard_interval_t  guard_interval,
fe_hierarchy_t  hierarsourcechy_information 
)

Tunes a DVB-T device.

Tunes a DVB-T device in synchronous mode. Needs full configuration

Returns
dvb_frontend_event
Note
The member "dvb_frontend_event.status" should be correct by the most device driver implementations. But "dvb_frontend_event.parameters" maybe not and is definitely not set by: Cinergy T� (2.6.27), Terratec Cinergy DT USB XS Diversity (2.6.27)

Definition at line 266 of file DVBSocketController.cc.

◆ tuneTo()

void senf::DVBSocketController::tuneTo ( std::string const &  channel)

Tunes a DVB device to a channel.

Tunes a DVB device to a channel whose parameters are stored in a config file. The method determines the type of DVB device by it self.

Parameters
[in]channelA channel name which will be looked up in config file.

Definition at line 148 of file DVBSocketController.cc.

◆ tuneTo_sync()

dvb_frontend_event senf::DVBSocketController::tuneTo_sync ( std::string const &  channel)

Tunes a DVB device given by the type of the DVBFrontendHandle.

Tunes a DVB device, given by the type of the DVBFrontendHandle, by a channel name in synchronous mode

Parameters
[in]channelA channel name which will be looked up in config file.
Returns
dvb_frontend_event
Note
The member "dvb_frontend_event.status" should be correct by the most device driver implementations. But "dvb_frontend_event.parameters" maybe not and is definitely not set by: Cinergy T� (2.6.27), Terratec Cinergy DT USB XS Diversity (2.6.27)

Definition at line 237 of file DVBSocketController.cc.

◆ tuneToCMD()

void senf::DVBSocketController::tuneToCMD ( std::string const &  input,
std::string const &  mode = "async" 
)

Tunes a DVB device given by the type of the DVBFrontendHandle.

Tunes a DVB device by a channel name or complete configuration line. This method was created for use in the SENF-Console.

Parameters
[in]inputA channel name or a complete configuration line. If a channel name is given it would be searched in the config file.
[in]modeThe mode in which it will tune "sync" or "async"

Definition at line 89 of file DVBSocketController.cc.

Member Data Documentation

◆ dir

console::ScopedDirectory senf::DVBSocketController::dir

Definition at line 50 of file DVBSocketController.hh.


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