Packets: Fix VariantParser invalid parser access bug
[senf.git] / Socket / Protocols / DVB / DVBFrontendHandle.hh
index 3c783c3..04cc21a 100644 (file)
@@ -1,8 +1,8 @@
 // $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 <tho@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
 /** \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 <boost/cstdint.hpp>
-#include <linux/dvb/frontend.h> 
+#include <linux/dvb/frontend.h>
 #include "../../../Socket/FramingPolicy.hh"
 #include "../../../Socket/CommunicationPolicy.hh"
 #include "../../../Socket/ReadWritePolicy.hh"
@@ -49,12 +49,14 @@ namespace senf {
         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.
      */
-    class DVBFrontendProtocol
-        : public ConcreteSocketProtocol<DVBFrontend_Policy, DVBFrontendProtocol>
+    class DVBFrontendSocketProtocol
+        : public ConcreteSocketProtocol<DVBFrontend_Policy, DVBFrontendSocketProtocol>
     {
     public:
         ///////////////////////////////////////////////////////////////////////////
@@ -63,7 +65,8 @@ namespace senf {
         ///\name Constructors
         ///@{
 
-        void init_client(boost::uint8_t adapter=0, boost::uint8_t device=0) const;       ///< xxx
+        void init_client(boost::uint8_t adapter=0, boost::uint8_t device=0) const;
+                                        ///< Opens the specified frontend device in read-only mode.
                                         /**< \note This member is implicitly called from the
                                              ProtocolClientSocketHandle::ProtocolClientSocketHandle()
                                              constructor */
@@ -71,16 +74,34 @@ namespace senf {
         ///@}
         ///\name Abstract Interface Implementation
         ///@{
-        
-        unsigned available() const;
-        bool eof() const;
+
+        unsigned available() const;     ///< Returns always <tt>0</tt>
+                                        /**< Returns always <tt>0</tt>, since the DVB frontend
+                                             socket is not readable. */
+        bool eof() const;               ///< Returns always <tt>false</tt>
+                                        /**< Returns always <tt>false</tt>, since the DVB frontend
+                                             socket does not support the notion of EOF. */
 
         ///@}
-        
-        void signalStrength(int16_t *strength) const;
+
+        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. */
     };
 
-    typedef ProtocolClientSocketHandle<DVBFrontendProtocol> DVBFrontendHandle;
+    typedef ProtocolClientSocketHandle<DVBFrontendSocketProtocol> DVBFrontendHandle;
 
     ///@}
 }
@@ -92,7 +113,7 @@ namespace senf {
 //#include "DVBFrontendHandle.cti"
 #endif
 
-\f
+
 // Local Variables:
 // mode: c++
 // fill-column: 100