senf::DVBSocketController Class Reference

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

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

List of all members.


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 56 of file DVBSocketController.hh.


Public Types

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

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.
void  addToConsole (DVBDemuxPESHandle sh)
  Adds an DVBDemuxPESHandle to the console.
void  tuneToCMD (std::string const &input, std::string const &mode="async")
  Tunes a DVB device given by the type of the DVBFrontendHandle.
void  tuneTo (std::string const &channel)
  Tunes a DVB device to a channel.
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.
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.
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.
dvb_frontend_event  tuneTo_sync (std::string const &channel)
  Tunes a DVB device given by the type of the DVBFrontendHandle.
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.
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.
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.
fe_type_t  getType ()
  Returns the type of the card. The type is defined in frontend.h.
std::string  getTypeString ()
  Returns the type of the card.
std::string  status2String (fe_status_t status)
  Returns a human readable status information.
unsigned int  bitErrorRate ()
  Returns the bit error rate.
unsigned int  signalToNoiseRatio ()
  Returns the signal to noise ratio.
unsigned int  signalStrength ()
  Returns the signal strength.
std::string  getTuneInfo (const std::string &conf="Ssbuf")
  Returns a string which shows actual tuning status.

Public Attributes

console::ScopedDirectory
< DVBSocketController
dir

Member Typedef Documentation

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

Callback which is called when an asynchronous tuning succeeds.

Definition at line 63 of file DVBSocketController.hh.


Constructor & Destructor Documentation

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

Definition at line 42 of file DVBSocketController.cc.

senf::DVBSocketController::
~DVBSocketController ()

Definition at line 58 of file DVBSocketController.cc.


Member Function Documentation

void senf::DVBSocketController::
addToConsole ( 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]  sh  handle of a protocol

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]  sh  handle of a protocol

Definition at line 83 of file DVBSocketController.cc.

unsigned int senf::DVBSocketController::
bitErrorRate ()

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 368 of file DVBSocketController.cc.

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

Definition at line 73 of file DVBSocketController.cc.

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

Definition at line 62 of file DVBSocketController.cc.

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 383 of file DVBSocketController.cc.

fe_type_t senf::DVBSocketController::
getType ()

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

Definition at line 447 of file DVBSocketController.cc.

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 354 of file DVBSocketController.cc.

unsigned int senf::DVBSocketController::
signalStrength ()

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 378 of file DVBSocketController.cc.

unsigned int senf::DVBSocketController::
signalToNoiseRatio ()

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 373 of file DVBSocketController.cc.

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 426 of file DVBSocketController.cc.

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 229 of file DVBSocketController.cc.

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 331 of file DVBSocketController.cc.

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 214 of file DVBSocketController.cc.

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 312 of file DVBSocketController.cc.

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 185 of file DVBSocketController.cc.

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 276 of file DVBSocketController.cc.

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]  channel  A channel name which will be looked up in config file.

Definition at line 158 of file DVBSocketController.cc.

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]  channel  A 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 247 of file DVBSocketController.cc.

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]  input  A channel name or a complete configuration line. If a channel name is given it would be searched in the config file.
[in]  mode  The mode in which it will tune "sync" or "async"

Definition at line 99 of file DVBSocketController.cc.


Member Data Documentation

console::ScopedDirectory<DVBSocketController> senf::DVBSocketController::
dir

Definition at line 60 of file DVBSocketController.hh.


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