X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FDVB%2FDVBFrontendHandle.cc;h=fe05f1e7660c10a85feae2cd5860dc9c619f16f2;hb=a4e14250b78fdbc289e29c5d25dd1444aae7dc3e;hp=eda5a1b3f34b5783df1d6079e1133d6d0577c530;hpb=74e753584f5271c3b9edffdb7ceee73a6a1de5c7;p=senf.git diff --git a/Socket/Protocols/DVB/DVBFrontendHandle.cc b/Socket/Protocols/DVB/DVBFrontendHandle.cc index eda5a1b..fe05f1e 100644 --- a/Socket/Protocols/DVB/DVBFrontendHandle.cc +++ b/Socket/Protocols/DVB/DVBFrontendHandle.cc @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// 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 @@ -31,7 +31,7 @@ #include #include #include -#include "Utils/Exception.hh" +#include "../../../Utils/Exception.hh" //#include "DVBFrontendHandle.mpp" #define prefix_ @@ -40,41 +40,34 @@ /////////////////////////////////////////////////////////////////////////// // senf::DVBFrontendHandle -prefix_ void senf::DVBFrontendProtocol::init_client(uint8_t adapter, boost::uint8_t device) +prefix_ void senf::DVBFrontendSocketProtocol::init_client(uint8_t adapter, boost::uint8_t device) const { std::string devFrontend = str( boost::format( "/dev/dvb/adapter%d/frontend%d") % adapter % device); - int fd = open(devFrontend.c_str(), O_RDONLY | O_NONBLOCK); - if (fd < 0) - throw SystemException(errno); - body().fd(fd); + 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 << "."; + fd(f); } -prefix_ unsigned senf::DVBFrontendProtocol::available() +prefix_ unsigned senf::DVBFrontendSocketProtocol::available() const { return 0; } -prefix_ bool senf::DVBFrontendProtocol::eof() +prefix_ bool senf::DVBFrontendSocketProtocol::eof() const { return false; } -prefix_ std::auto_ptr senf::DVBFrontendProtocol::clone() +prefix_ void senf::DVBFrontendSocketProtocol::signalStrength(int16_t *strength) const { - return std::auto_ptr(new DVBFrontendProtocol()); -} - - -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) + SENF_THROW_SYSTEM_EXCEPTION("Could not get signal strength of DVB adapter."); } ///////////////////////////////cc.e////////////////////////////////////////