blob: 208b15fd6c3df7e372a27b7c21713aea992996a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
#include <stdio.h>
#include <libsig_comp.h>
#include <lib/base/ebase.h>
#include <lib/base/eerror.h>
#include <lib/base/init.h>
#include <lib/base/init_num.h>
#include <lib/dvb/dvb.h>
#include <lib/dvb/db.h>
#include <lib/dvb/isection.h>
#include <lib/dvb/esection.h>
#include <dvbsi++/program_map_section.h>
#include <lib/dvb/scan.h>
#include <unistd.h>
class eMain: public eApplication, public Object
{
eInit init;
eDVBScan *m_scan;
ePtr<eDVBResourceManager> m_mgr;
ePtr<iDVBChannel> m_channel;
ePtr<eDVBDB> m_dvbdb;
void scanEvent(int evt)
{
eDebug("scan event %d!", evt);
if (evt == eDVBScan::evtFinish)
{
m_scan->insertInto(m_dvbdb);
quit(0);
}
}
ePtr<eConnection> m_scan_event_connection;
public:
eMain()
{
m_dvbdb = new eDVBDB();
m_mgr = new eDVBResourceManager();
eDVBFrontendParametersSatellite fesat;
fesat.frequency = 11817000; // 12070000;
fesat.symbol_rate = 27500000;
fesat.polarisation = eDVBFrontendParametersSatellite::Polarisation_Vertical;
fesat.fec = eDVBFrontendParametersSatellite::FEC_3_4;
fesat.inversion = eDVBFrontendParametersSatellite::Inversion_Off;
fesat.orbital_position = 192;
eDVBFrontendParameters *fe = new eDVBFrontendParameters();
fe->setDVBS(fesat);
if (m_mgr->allocateRawChannel(m_channel))
eDebug("shit it failed!");
// init.setRunlevel(eAutoInitNumbers::main);
eDebug("starting scan...");
std::list<ePtr<iDVBFrontendParameters> > list;
list.push_back(fe);
m_scan = new eDVBScan(m_channel);
m_scan->start(list);
m_scan->connectEvent(slot(*this, &eMain::scanEvent), m_scan_event_connection);
}
~eMain()
{
delete m_scan;
eDebug("... nicht mehr.");
}
};
#ifdef OBJECT_DEBUG
int object_total_remaining;
void object_dump()
{
printf("%d items left\n", object_total_remaining);
}
#endif
int main()
{
#ifdef OBJECT_DEBUG
atexit(object_dump);
#endif
eMain app;
return app.exec();
}
|