added first (prototype) handle for the DVB frontend device
[senf.git] / Socket / DVBDemuxProtocol.cc
1 // $Id$
2 //
3 // Copyright (C) 2007
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 //     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
23 /** \file
24     \brief xxx
25  */
26
27 #include "DVBDemuxProtocol.hh"
28 //#include "DVBDemuxProtocol.ih"
29
30 // Custom includes
31 #include <sys/socket.h>
32 #include <iostream>
33 #include <string>
34 #include <sys/ioctl.h>
35 #include <linux/sockios.h>
36 #include "SocketHandle.hh"
37
38 //#include "DVBDemuxProtocol.mpp"
39 #define prefix_
40 ///////////////////////////////cc.p////////////////////////////////////////
41
42 prefix_ void senf::DVBDemuxProtocol::setBufferSize(unsigned long size)
43     const
44 {
45     if (::ioctl(body().fd(), DMX_SET_BUFFER_SIZE, size) < 0)
46         throw SystemException(errno);
47 }
48
49 prefix_ void senf::DVBDemuxProtocol::startFiltering()
50     const
51 {
52     if (::ioctl(body().fd(), DMX_START) < 0)
53         throw SystemException(errno);
54 }
55
56 prefix_ void senf::DVBDemuxProtocol::stopFiltering()
57     const
58 {
59     if (::ioctl(body().fd(), DMX_STOP) < 0)
60         throw SystemException(errno);
61 }
62
63 prefix_ bool senf::DVBDemuxProtocol::eof()
64     const
65 {
66     return false;
67 }
68
69 ///////////////////////////////cc.e////////////////////////////////////////
70 #undef prefix_
71 //#include "DVBDemuxProtocol.mpp"
72
73 \f
74 // Local Variables:
75 // mode: c++
76 // fill-column: 100
77 // c-file-style: "senf"
78 // indent-tabs-mode: nil
79 // ispell-local-dictionary: "american"
80 // compile-command: "scons -u test"
81 // comment-column: 40
82 // End: