1 #ifndef __dvb_frontend_h
2 #define __dvb_frontend_h
4 #include <lib/dvb/idvb.h>
5 #include <lib/dvb/sec.h>
9 class eDVBFrontendParameters: public iDVBFrontendParameters
11 DECLARE_REF(eDVBFrontendParameters);
14 eDVBFrontendParametersSatellite sat;
15 eDVBFrontendParametersCable cable;
16 eDVBFrontendParametersTerrestrial terrestrial;
20 eDVBFrontendParameters();
22 RESULT getSystem(int &type) const;
23 RESULT getDVBS(eDVBFrontendParametersSatellite &p) const;
24 RESULT getDVBC(eDVBFrontendParametersCable &p) const;
25 RESULT getDVBT(eDVBFrontendParametersTerrestrial &p) const;
27 RESULT setDVBS(const eDVBFrontendParametersSatellite &p);
28 RESULT setDVBC(const eDVBFrontendParametersCable &p);
29 RESULT setDVBT(const eDVBFrontendParametersTerrestrial &p);
31 RESULT calculateDifference(const iDVBFrontendParameters *parm, int &diff) const;
33 RESULT getHash(unsigned long &hash) const;
36 class eDVBFrontend: public iDVBFrontend, public Object
38 DECLARE_REF(eDVBFrontend);
43 #if HAVE_DVB_API_VERSION < 3
45 char m_sec_filename[128];
48 FRONTENDPARAMETERS parm;
50 Signal1<void,iDVBFrontend*> m_stateChanged;
51 ePtr<iDVBSatelliteEquipmentControl> m_sec;
52 eSocketNotifier *m_sn;
57 eSecCommandList m_sec_sequence;
59 int m_data[9]; /* when satellite frontend then
60 data[0] = lastcsw -> state of the committed switch
61 data[1] = lastucsw -> state of the uncommitted switch
62 data[2] = lastToneburst -> current state of toneburst switch
63 data[3] = newRotorCmd -> last sent rotor cmd
64 data[4] = newRotorPos -> current Rotor Position
67 data[7] = linkedToTunerNo
68 data[8] = dependsToTunerNo (just satpos.. for rotor with twin lnb) */
70 int m_idleInputpower[2]; // 13V .. 18V
71 int m_runningInputpower;
72 int m_timeoutCount; // needed for timeout
73 int m_retryCount; // diseqc retry for rotor
78 void tuneLoop(); // called by m_tuneTimer
81 bool setSecSequencePos(int steps);
83 eDVBFrontend(int adap, int fe, int &ok);
84 virtual ~eDVBFrontend();
86 RESULT getFrontendType(int &type);
87 RESULT tune(const iDVBFrontendParameters &where);
88 RESULT connectStateChange(const Slot1<void,iDVBFrontend*> &stateChange, ePtr<eConnection> &connection);
89 RESULT getState(int &state);
90 RESULT setTone(int tone);
91 RESULT setVoltage(int voltage);
92 RESULT sendDiseqc(const eDVBDiseqcCommand &diseqc);
93 RESULT sendToneburst(int burst);
94 RESULT setSEC(iDVBSatelliteEquipmentControl *sec);
95 RESULT setSecSequence(const eSecCommandList &list);
96 RESULT getData(int num, int &data);
97 RESULT setData(int num, int val);
99 int readFrontendData(int type); // bitErrorRate, signalPower, signalQuality
100 int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm);
101 int getID() { return m_fe; }