2 #include <lib/dvb/sec.h>
3 #if HAVE_DVB_API_VERSION < 3
4 #include <ost/frontend.h>
5 #define INVERSION Inversion
6 #define FREQUENCY Frequency
7 #define FEC_INNER FEC_inner
8 #define SYMBOLRATE SymbolRate
10 #include <linux/dvb/frontend.h>
11 #define INVERSION inversion
12 #define FREQUENCY frequency
13 #define FEC_INNER fec_inner
14 #define SYMBOLRATE symbol_rate
16 #include <lib/base/eerror.h>
18 DEFINE_REF(eDVBSatelliteEquipmentControl);
20 eDVBSatelliteEquipmentControl::eDVBSatelliteEquipmentControl()
24 RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat)
27 eDebug("(very) ugly and hardcoded eDVBSatelliteEquipmentControl");
29 if (sat.frequency > 11700000)
35 parm.FREQUENCY = sat.frequency - 10600000;
37 parm.FREQUENCY = sat.frequency - 9750000;
39 // frontend.sentDiseqc(...);
41 parm.INVERSION = (!sat.inversion) ? INVERSION_ON : INVERSION_OFF;
48 parm.u.qpsk.FEC_INNER = FEC_AUTO;
51 parm.u.qpsk.SYMBOLRATE = sat.symbol_rate;
53 eDVBDiseqcCommand diseqc;
55 #if HAVE_DVB_API_VERSION < 3
56 diseqc.voltage = sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Vertical ? iDVBFrontend::voltage13 : iDVBFrontend::voltage18;
57 diseqc.tone = hi ? iDVBFrontend::toneOn : iDVBFrontend::toneOff;
59 frontend.setVoltage(sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Vertical ? iDVBFrontend::voltage13 : iDVBFrontend::voltage18);
63 diseqc.data[0] = 0xe0;
64 diseqc.data[1] = 0x10;
65 diseqc.data[2] = 0x38;
66 diseqc.data[3] = 0xF0;
71 if (sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Horizontal)
74 frontend.sendDiseqc(diseqc);
76 #if HAVE_DVB_API_VERSION > 2
77 frontend.setTone(hi ? iDVBFrontend::toneOn : iDVBFrontend::toneOff);