X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FDVB%2FDVBFrontendHandle.hh;h=bc555ff35d7893e692e3e8db702ea22d07d37a08;hb=532240d72e09e19e57fac9bb55c2560b9c9e5b97;hp=626a37233520303c255bd701a59222bbdbf3b2ab;hpb=6f50bf49e282c0528f51faa0a245bbfa2b867399;p=senf.git diff --git a/Socket/Protocols/DVB/DVBFrontendHandle.hh b/Socket/Protocols/DVB/DVBFrontendHandle.hh index 626a372..bc555ff 100644 --- a/Socket/Protocols/DVB/DVBFrontendHandle.hh +++ b/Socket/Protocols/DVB/DVBFrontendHandle.hh @@ -1,9 +1,10 @@ // $Id$ // // Copyright (C) 2007 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Thorsten Horstmann +// Anton Gillert // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -23,18 +24,20 @@ /** \file \brief DVBFrontendHandle public header */ -#ifndef HH_DVBFrontendHandle_ -#define HH_DVBFrontendHandle_ 1 +#ifndef HH_SENF_Socket_Protocols_DVB_DVBFrontendHandle_ +#define HH_SENF_Socket_Protocols_DVB_DVBFrontendHandle_ 1 // Custom includes #include -#include +#include +#include +#include #include "../../../Socket/FramingPolicy.hh" #include "../../../Socket/CommunicationPolicy.hh" #include "../../../Socket/ReadWritePolicy.hh" #include "../../../Socket/ProtocolClientSocketHandle.hh" #include "../../../Socket/SocketProtocol.hh" - +#include //#include "DVBFrontendHandle.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -44,43 +47,125 @@ namespace senf { /// @{ typedef MakeSocketPolicy< - NoAddressingPolicy, + NoAddressingPolicy, DatagramFramingPolicy, UnconnectedCommunicationPolicy, NotReadablePolicy, NotWriteablePolicy - >::policy DVBFrontend_Policy; ///< Socket Policy for xxxx +> ::policy DVBFrontend_Policy; ///< Socket Policy for DVBFrontendSocketProtocol + - /** \brief xxx + /** \brief SocketProtocol for the dvb frontend device + + The DVB frontend device controls the tuner and DVB demodulator hardware. + ATTENTION! + Some calls are not supported by real life drivers, known issues: + + Cinergy T² getParameter is not supported + Cinergy T² in getEvent fe_status_t will be set but dvb_frontend_parameters will be stay untouched + Cinergy DT XS bitErrorRate is not supported + + This dues to the lack of driver implementation. There could be restrictions also for other DVB devices! */ - class DVBFrontendProtocol - : public ConcreteSocketProtocol + + class DVBFrontendSocketProtocol + : public ConcreteSocketProtocol { + private: + void tune(const struct dvb_frontend_parameters & frontend) const; public: + + /////////////////////////////////////////////////////////////////////////// // internal interface ///\name Constructors ///@{ - - void init_client(boost::uint8_t adapter=0, boost::uint8_t device=0) const; ///< xxx + void init_client(unsigned short adapter = 0, unsigned short device = 0, int flags = (O_RDWR | O_NONBLOCK) ) const; + ///< Opens the specified frontend device in read-only mode. /**< \note This member is implicitly called from the ProtocolClientSocketHandle::ProtocolClientSocketHandle() constructor */ ///@} + + void setNonBlock(bool on = true) const; + + void tuneDVB_S(unsigned int frequency, fe_spectral_inversion_t inversion, unsigned int symbole_rate, fe_code_rate_t code_rate) const; + ///< Tunes a DVB-S device + /**< Tunes a DVB-S device. Needs full configuration */ + void tuneDVB_T(unsigned int frequency, + fe_spectral_inversion_t inversion, + fe_bandwidth_t bandwidth, + fe_code_rate_t code_rate_HP, /* high priority stream code rate */ + fe_code_rate_t code_rate_LP, /* low priority stream code rate */ + fe_modulation_t constellation, /* modulation type (see above) */ + fe_transmit_mode_t transmission_mode, + fe_guard_interval_t guard_interval, + fe_hierarchy_t hierarchy_information + ) const; ///< Tunes a DVB-T device + /**< Tunes a DVB-T device. Needs full configuration */ + 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 + ) const; + ///< Tunes a DVB-C device + /**< Tunes a DVB-C device. Needs full configuration */ + dvb_frontend_info getInfo() const; ///< Returns information struct. + /**< Returns information struct, which contains information + about the device which is associated with the current frontend.*/ + struct dvb_frontend_parameters getFrontendParam() const; ///< Returns dvb_frontend_parameters struct. + /**< Returns dvb_frontend_parameters struct, which contains the actual + configuration of the device.*/ ///\name Abstract Interface Implementation ///@{ - unsigned available() const; - bool eof() const; + dvb_frontend_event getEvent() const; + + + unsigned available() const; ///< Returns always 0 + /**< Returns always 0, since the DVB frontend + socket is not readable. */ + bool eof() const; ///< Returns always false + /**< Returns always false, since the DVB frontend + socket does not support the notion of EOF. */ ///@} + + int16_t signalStrength() const; ///< Returns current signal strength + /**< Returns the signal strength value for the signal + currently received by the front-end. For this method, + read-only access to the device is sufficient.*/ + + int16_t signalNoiseRatio() const; + ///< Returns current signal-to-noise ratio + /**< Returns the signal-to-noise ratio for the signal + currently received by the front-end. For this method, + read-only access to the device is sufficient. */ + + uint32_t bitErrorRate() const; ///< Returns the current bit error rate for the signal + /**< Returns the bit error rate for the signal currently + received/demodulated by the front-end. For this method, + read-only access to the device is sufficient. */ + uint32_t uncorrectedBlocks() const; ///< Returns the number of uncorrected blocks + /**< Returns the number of uncorrected blocks + * detected by the device driver during its lifetime. + * For meaningful measurements, the increment in block + * count during a specific time interval should be calculated. + * For this command, read-only access to the device is sufficient. + * Note that the counter will wrap to zero after its maximum count + * has been reached.*/ - void signalStrength(int16_t *strength) const; + fe_status_t status() const; ///< This ioctl call returns status information about the front-end. + /**< This ioctl call returns status information about the + * front-end. This call only requires read-only access + * to the device.*/ + }; - typedef ProtocolClientSocketHandle DVBFrontendHandle; + typedef ProtocolClientSocketHandle DVBFrontendHandle; ///@} } @@ -92,7 +177,7 @@ namespace senf { //#include "DVBFrontendHandle.cti" #endif - + // Local Variables: // mode: c++ // fill-column: 100