Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
senf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wiback
senf
Commits
6f98e372
Commit
6f98e372
authored
16 years ago
by
tho
Browse files
Options
Downloads
Patches
Plain Diff
DVBFrontendHandle: clean-up the signalStrength method signature and documentation update
parent
5aa40ceb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Socket/Protocols/DVB/DVBFrontendHandle.cc
+8
-5
8 additions, 5 deletions
Socket/Protocols/DVB/DVBFrontendHandle.cc
Socket/Protocols/DVB/DVBFrontendHandle.hh
+19
-10
19 additions, 10 deletions
Socket/Protocols/DVB/DVBFrontendHandle.hh
with
27 additions
and
15 deletions
Socket/Protocols/DVB/DVBFrontendHandle.cc
+
8
−
5
View file @
6f98e372
...
...
@@ -40,14 +40,15 @@
///////////////////////////////////////////////////////////////////////////
// senf::DVBFrontendHandle
prefix_
void
senf
::
DVBFrontendSocketProtocol
::
init_client
(
uint8_t
adapter
,
boost
::
uint8_t
device
)
prefix_
void
senf
::
DVBFrontendSocketProtocol
::
init_client
(
boost
::
uint8_t
adapter
,
boost
::
uint8_t
device
)
const
{
std
::
string
devFrontend
=
str
(
boost
::
format
(
"/dev/dvb/adapter%d/frontend%d"
)
%
adapter
%
device
);
int
f
=
open
(
devFrontend
.
c_str
(),
O_RDONLY
|
O_NONBLOCK
);
if
(
f
<
0
)
SENF_THROW_SYSTEM_EXCEPTION
(
""
)
<<
"Could not open frontend device of DVB adapter "
<<
devFrontend
<<
"."
;
SENF_THROW_SYSTEM_EXCEPTION
(
""
)
<<
"Could not open frontend device of DVB adapter "
<<
devFrontend
<<
"."
;
fd
(
f
);
}
...
...
@@ -63,18 +64,20 @@ prefix_ bool senf::DVBFrontendSocketProtocol::eof()
return
false
;
}
prefix_
void
senf
::
DVBFrontendSocketProtocol
::
signalStrength
(
int16_t
*
strength
)
prefix_
int16_t
senf
::
DVBFrontendSocketProtocol
::
signalStrength
()
const
{
if
(
::
ioctl
(
fd
(),
FE_READ_SIGNAL_STRENGTH
,
strength
)
<
0
)
int16_t
strength
;
if
(
::
ioctl
(
fd
(),
FE_READ_SIGNAL_STRENGTH
,
&
strength
)
<
0
)
SENF_THROW_SYSTEM_EXCEPTION
(
"Could not get signal strength of DVB adapter."
);
return
strength
;
}
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
//#include "DVBFrontendHandle.mpp"
// Local Variables:
// mode: c++
// fill-column: 100
...
...
This diff is collapsed.
Click to expand it.
Socket/Protocols/DVB/DVBFrontendHandle.hh
+
19
−
10
View file @
6f98e372
...
...
@@ -28,7 +28,7 @@
// 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,9 +49,11 @@ 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
DVBFrontendSocketProtocol
:
public
ConcreteSocketProtocol
<
DVBFrontend_Policy
,
DVBFrontendSocketProtocol
>
...
...
@@ -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,13 +74,19 @@ 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
;
///< Return current signal strength
/**< Returns the signal strength value for the signal
currently received by the front-end. */
};
typedef
ProtocolClientSocketHandle
<
DVBFrontendSocketProtocol
>
DVBFrontendHandle
;
...
...
@@ -92,7 +101,7 @@ namespace senf {
//#include "DVBFrontendHandle.cti"
#endif
// Local Variables:
// mode: c++
// fill-column: 100
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment