blob: a668ebe7b782f7814accf5f192b5212400252d39 (
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
|
#include <config.h>
#include <lib/dvb/sec.h>
#if HAVE_DVB_API_VERSION < 3
#include <ost/frontend.h>
#define INVERSION Inversion
#define FREQUENCY Frequency
#define FEC_INNER FEC_inner
#define SYMBOLRATE SymbolRate
#else
#include <linux/dvb/frontend.h>
#define INVERSION inversion
#define FREQUENCY frequency
#define FEC_INNER fec_inner
#define SYMBOLRATE symbol_rate
#endif
#include <lib/base/eerror.h>
DEFINE_REF(eDVBSatelliteEquipmentControl);
eDVBSatelliteEquipmentControl::eDVBSatelliteEquipmentControl()
{
}
RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat)
{
int hi;
eDebug("(very) ugly and hardcoded eDVBSatelliteEquipmentControl");
if (sat.frequency > 11700000)
hi = 1;
else
hi = 0;
if (hi)
parm.FREQUENCY = sat.frequency - 10600000;
else
parm.FREQUENCY = sat.frequency - 9750000;
// frontend.sentDiseqc(...);
parm.INVERSION = (!sat.inversion) ? INVERSION_ON : INVERSION_OFF;
switch (sat.fec)
{
// case 1:
// case ...:
default:
parm.u.qpsk.FEC_INNER = FEC_AUTO;
break;
}
parm.u.qpsk.SYMBOLRATE = sat.symbol_rate;
eDVBDiseqcCommand diseqc;
#if HAVE_DVB_API_VERSION < 3
diseqc.voltage = sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Vertical ? iDVBFrontend::voltage13 : iDVBFrontend::voltage18;
diseqc.tone = hi ? iDVBFrontend::toneOn : iDVBFrontend::toneOff;
#else
frontend.setVoltage(sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Vertical ? iDVBFrontend::voltage13 : iDVBFrontend::voltage18);
#endif
diseqc.len = 4;
diseqc.data[0] = 0xe0;
diseqc.data[1] = 0x10;
diseqc.data[2] = 0x38;
diseqc.data[3] = 0xF0;
if (hi)
diseqc.data[3] |= 1;
if (sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Horizontal)
diseqc.data[3] |= 2;
frontend.sendDiseqc(diseqc);
#if HAVE_DVB_API_VERSION > 2
frontend.setTone(hi ? iDVBFrontend::toneOn : iDVBFrontend::toneOff);
#endif
return 0;
}
|