1 #ifndef __dvb_frontend_h
2 #define __dvb_frontend_h
4 #include <lib/dvb/idvb.h>
5 class eDVBFrontendParameters: public iDVBFrontendParameters
7 DECLARE_REF(eDVBFrontendParameters);
10 eDVBFrontendParametersSatellite sat;
11 eDVBFrontendParametersCable cable;
12 eDVBFrontendParametersTerrestrial terrestrial;
16 eDVBFrontendParameters();
17 ~eDVBFrontendParameters() {}
19 RESULT getSystem(int &type) const;
20 RESULT getDVBS(eDVBFrontendParametersSatellite &SWIG_OUTPUT) const;
21 RESULT getDVBC(eDVBFrontendParametersCable &SWIG_OUTPUT) const;
22 RESULT getDVBT(eDVBFrontendParametersTerrestrial &SWIG_OUTPUT) const;
24 RESULT setDVBS(const eDVBFrontendParametersSatellite &p, bool no_rotor_command_on_tune=false);
25 RESULT setDVBC(const eDVBFrontendParametersCable &p);
26 RESULT setDVBT(const eDVBFrontendParametersTerrestrial &p);
28 RESULT calculateDifference(const iDVBFrontendParameters *parm, int &SWIG_OUTPUT, bool exact) const;
30 RESULT getHash(unsigned long &SWIG_OUTPUT) const;
35 #include <lib/dvb/sec.h>
36 class eSecCommandList;
38 class eDVBFrontend: public iDVBFrontend, public Object
40 DECLARE_REF(eDVBFrontend);
45 #if HAVE_DVB_API_VERSION < 3
47 char m_sec_filename[128];
50 FRONTENDPARAMETERS parm;
52 Signal1<void,iDVBFrontend*> m_stateChanged;
53 ePtr<iDVBSatelliteEquipmentControl> m_sec;
54 eSocketNotifier *m_sn;
59 eSecCommandList m_sec_sequence;
62 CSW, // state of the committed switch
63 UCSW, // state of the uncommitted switch
64 TONEBURST, // current state of toneburst switch
65 NEW_ROTOR_CMD, // prev sent rotor cmd
66 NEW_ROTOR_POS, // new rotor position (not validated)
67 ROTOR_CMD, // completed rotor cmd (finalized)
68 ROTOR_POS, // current rotor position
69 LINKED_PREV_PTR, // prev double linked list (for linked FEs)
70 LINKED_NEXT_PTR, // next double linked list (for linked FEs)
71 SATPOS_DEPENDS_PTR, // pointer to FE with configured rotor (with twin/quattro lnb)
72 FREQ_OFFSET, // current frequency offset
73 CUR_VOLTAGE, // current voltage
74 CUR_TONE, // current continuous tone
78 int m_data[NUM_DATA_ENTRIES];
80 int m_idleInputpower[2]; // 13V .. 18V
81 int m_runningInputpower;
83 int m_timeoutCount; // needed for timeout
84 int m_retryCount; // diseqc retry for rotor
88 void tuneLoop(); // called by m_tuneTimer
91 bool setSecSequencePos(int steps);
93 eDVBFrontend(int adap, int fe, int &ok);
94 virtual ~eDVBFrontend();
96 RESULT getFrontendType(int &type);
97 RESULT tune(const iDVBFrontendParameters &where);
98 RESULT prepare_sat(const eDVBFrontendParametersSatellite &);
99 RESULT prepare_cable(const eDVBFrontendParametersCable &);
100 RESULT prepare_terrestrial(const eDVBFrontendParametersTerrestrial &);
101 RESULT connectStateChange(const Slot1<void,iDVBFrontend*> &stateChange, ePtr<eConnection> &connection);
102 RESULT getState(int &state);
103 RESULT setTone(int tone);
104 RESULT setVoltage(int voltage);
105 RESULT sendDiseqc(const eDVBDiseqcCommand &diseqc);
106 RESULT sendToneburst(int burst);
107 RESULT setSEC(iDVBSatelliteEquipmentControl *sec);
108 RESULT setSecSequence(const eSecCommandList &list);
109 RESULT getData(int num, int &data);
110 RESULT setData(int num, int val);
112 int readFrontendData(int type); // bitErrorRate, signalPower, signalQuality, locked, synced
113 void getFrontendStatus(ePyObject dest);
114 void getTransponderData(ePyObject dest, bool original);
115 void getFrontendData(ePyObject dest);
117 int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm);
118 int getID() { return m_fe; }