4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Thorsten Horstmann <tho@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief DVBFrontendHandle public header */
26 #ifndef HH_DVBFrontendHandle_
27 #define HH_DVBFrontendHandle_ 1
30 #include <boost/cstdint.hpp>
31 #include <linux/dvb/frontend.h>
32 #include "../../../Socket/FramingPolicy.hh"
33 #include "../../../Socket/CommunicationPolicy.hh"
34 #include "../../../Socket/ReadWritePolicy.hh"
35 #include "../../../Socket/ProtocolClientSocketHandle.hh"
36 #include "../../../Socket/SocketProtocol.hh"
38 //#include "DVBFrontendHandle.mpp"
39 ///////////////////////////////hh.p////////////////////////////////////////
43 /// \addtogroup concrete_protocol_group
46 typedef MakeSocketPolicy<
48 DatagramFramingPolicy,
49 UnconnectedCommunicationPolicy,
52 >::policy DVBFrontend_Policy; ///< Socket Policy for DVBFrontendSocketProtocol
54 /** \brief SocketProtocol for the dvb frontend device
56 The DVB frontend device controls the tuner and DVB demodulator hardware.
58 class DVBFrontendSocketProtocol
59 : public ConcreteSocketProtocol<DVBFrontend_Policy, DVBFrontendSocketProtocol>
62 ///////////////////////////////////////////////////////////////////////////
68 void init_client(boost::uint8_t adapter=0, boost::uint8_t device=0) const;
69 ///< Opens the specified frontend device in read-only mode.
70 /**< \note This member is implicitly called from the
71 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
75 ///\name Abstract Interface Implementation
78 unsigned available() const; ///< Returns always <tt>0</tt>
79 /**< Returns always <tt>0</tt>, since the DVB frontend
80 socket is not readable. */
81 bool eof() const; ///< Returns always <tt>false</tt>
82 /**< Returns always <tt>false</tt>, since the DVB frontend
83 socket does not support the notion of EOF. */
87 int16_t signalStrength() const; ///< Returns current signal strength
88 /**< Returns the signal strength value for the signal
89 currently received by the front-end. For this method,
90 read-only access to the device is sufficient.*/
92 int16_t signalNoiseRatio() const;
93 ///< Returns current signal-to-noise ratio
94 /**< Returns the signal-to-noise ratio for the signal
95 currently received by the front-end. For this method,
96 read-only access to the device is sufficient. */
98 uint32_t bitErrorRate() const; ///< Returns the current bit error rate for the signal
99 /**< Returns the bit error rate for the signal currently
100 received/demodulated by the front-end. For this method,
101 read-only access to the device is sufficient. */
104 typedef ProtocolClientSocketHandle<DVBFrontendSocketProtocol> DVBFrontendHandle;
110 ///////////////////////////////hh.e////////////////////////////////////////
111 //#include "DVBFrontendHandle.cci"
112 //#include "DVBFrontendHandle.ct"
113 //#include "DVBFrontendHandle.cti"
120 // c-file-style: "senf"
121 // indent-tabs-mode: nil
122 // ispell-local-dictionary: "american"
123 // compile-command: "scons -u test"
124 // comment-column: 40