X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FDVB%2FDVBFrontendHandle.cc;h=43dcd1cfd342c59315af4d628e294021c8edc4a2;hb=1ad3873b372da6187b1fbc645bf276287d2efb54;hp=b56fb840ff7ef0064fa87da277f8ffacab6f0a8b;hpb=2c4c9deecc7491fbfc916aeb41074dcb76e8a2c2;p=senf.git diff --git a/Socket/Protocols/DVB/DVBFrontendHandle.cc b/Socket/Protocols/DVB/DVBFrontendHandle.cc index b56fb84..43dcd1c 100644 --- a/Socket/Protocols/DVB/DVBFrontendHandle.cc +++ b/Socket/Protocols/DVB/DVBFrontendHandle.cc @@ -3,7 +3,7 @@ // Copyright (C) 2007 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) // Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Thorsten Horstmann // // 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 @@ -21,24 +21,17 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief xxx - */ + \brief DVBFrontendHandle non-inline non-template implementation */ #include "DVBFrontendHandle.hh" //#include "DVBFrontendHandle.ih" // Custom includes -#include +#include #include -#include -#include #include -#include -#include #include -#include "Socket/SocketHandle.hh" - -#include "Utils/Exception.hh" +#include "../../../Utils/Exception.hh" //#include "DVBFrontendHandle.mpp" #define prefix_ @@ -47,13 +40,15 @@ /////////////////////////////////////////////////////////////////////////// // senf::DVBFrontendHandle -prefix_ void senf::DVBFrontendProtocol::init_client() +prefix_ void senf::DVBFrontendProtocol::init_client(uint8_t adapter, boost::uint8_t device) const { - int fd = open("/dev/dvb/adapter0/frontend0", O_RDONLY | O_NONBLOCK); - if (fd < 0) - throw SystemException(errno); - body().fd(fd); + 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) + throwErrno(); + fd(f); } prefix_ unsigned senf::DVBFrontendProtocol::available() @@ -78,8 +73,8 @@ prefix_ std::auto_ptr senf::DVBFrontendProtocol::clone() prefix_ void senf::DVBFrontendProtocol::signalStrength(int16_t *strength) const { - if (::ioctl(body().fd(), FE_READ_SIGNAL_STRENGTH, strength) < 0) - throw SystemException(errno); + if (::ioctl(fd(), FE_READ_SIGNAL_STRENGTH, strength) < 0) + throwErrno(); } ///////////////////////////////cc.e////////////////////////////////////////