From ab1eee942e75874739ce5f0b4ba289aac5cc3faf Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 13 Mar 2014 19:42:07 +0000 Subject: Restructure into more sensibly arranged libs --- p2pvr/devices/frontend.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 p2pvr/devices/frontend.cpp (limited to 'p2pvr/devices/frontend.cpp') diff --git a/p2pvr/devices/frontend.cpp b/p2pvr/devices/frontend.cpp new file mode 100644 index 0000000..54870a1 --- /dev/null +++ b/p2pvr/devices/frontend.cpp @@ -0,0 +1,39 @@ +#include +#include "frontend.h" +#include "tuner.h" +#include +#include +#include +#include + +Frontend::Frontend(Tuner * t, int fd, const struct dvb_frontend_info & i) : + tuner(t), + frontendFD(fd), + fe_info(i) +{ +} + +Frontend::~Frontend() +{ + close(frontendFD); +} + +const struct dvb_frontend_info & +Frontend::Info() const +{ + return fe_info; +} + +fe_status +Frontend::GetStatus() const +{ + fe_status_t status; + if (ioctl(frontendFD, FE_READ_STATUS, &status) < 0) { + Logger()->messagebf(LOG_ERR, "Reading frontend %s status failed (%s:%d)", tuner->Device(), strerror(errno), errno); + throw P2PVR::DeviceError(tuner->Device(), strerror(errno), errno); + } + return status; +} + +INSTANTIATESTORE(fe_type, FrontendLoader); + -- cgit v1.2.3