5 #include <lib/dvb/idvb.h>
12 NONE, SLEEP, SET_VOLTAGE, SET_TONE,
13 SEND_DISEQC, SEND_TONEBURST, IF_LOCK_GOTO, IF_NOT_LOCK_GOTO,
14 MEASURE_IDLE_INPUTPOWER, SET_FRONTEND
23 eDVBDiseqcCommand diseqc;
25 eSecCommand( int cmd )
28 eSecCommand( int cmd, int val )
29 :cmd(cmd), voltage(val)
31 eSecCommand( int cmd, eDVBDiseqcCommand diseqc )
32 :cmd(cmd), diseqc(diseqc)
41 std::list<eSecCommand> secSequence;
42 std::list<eSecCommand>::iterator cur;
45 :cur(secSequence.end())
48 void push_front(const eSecCommand &cmd)
50 secSequence.push_front(cmd);
52 void push_back(const eSecCommand &cmd)
54 secSequence.push_back(cmd);
59 cur=secSequence.end();
61 inline std::list<eSecCommand>::iterator ¤t()
65 inline std::list<eSecCommand>::iterator begin()
67 return secSequence.begin();
69 inline std::list<eSecCommand>::iterator end()
71 return secSequence.end();
75 return secSequence.size();
79 return secSequence.size();
83 class eDVBSatelliteDiseqcParameters
86 enum { AA=0, AB=1, BA=2, BB=3, SENDNO=4 /* and 0xF0 .. 0xFF*/ }; // DiSEqC Parameter
89 enum t_diseqc_mode { NONE=0, V1_0=1, V1_1=2, V1_2=3, SMATV=4 }; // DiSEqC Mode
90 t_diseqc_mode m_diseqc_mode;
92 enum t_toneburst_param { NO=0, A=1, B=2 };
93 t_toneburst_param m_toneburst_param;
95 int m_repeats; // for cascaded switches
96 bool m_use_fast; // send no DiSEqC on H/V or Lo/Hi change
97 bool m_seq_repeat; // send the complete DiSEqC Sequence twice...
98 bool m_swap_cmds; // swaps the committed & uncommitted cmd
99 int m_uncommitted_cmd; // state of the 4 uncommitted switches..
102 class eDVBSatelliteSwitchParameters
105 enum t_22khz_signal { HILO=0, ON=1, OFF=2 }; // 22 Khz
106 enum t_voltage_mode { HV=0, _14V=1, _18V=2, _0V=3 }; // 14/18 V
107 t_voltage_mode m_voltage_mode;
108 t_22khz_signal m_22khz_signal;
111 class eDVBSatelliteRotorParameters
114 enum { NORTH, SOUTH, EAST, WEST };
116 struct eDVBSatelliteRotorInputpowerParameters
118 bool m_use; // can we use rotor inputpower to detect rotor running state ?
119 int m_threshold; // threshold between running and stopped rotor
121 eDVBSatelliteRotorInputpowerParameters m_inputpower_parameters;
123 struct eDVBSatelliteRotorGotoxxParameters
125 bool m_can_use; // rotor support gotoXX cmd ?
126 int m_lo_direction; // EAST, WEST
127 int m_la_direction; // NORT, SOUTH
128 double m_longitude; // longitude for gotoXX° function
129 double m_latitude; // latitude for gotoXX° function
131 eDVBSatelliteRotorGotoxxParameters m_gotoxx_parameters;
133 struct Orbital_Position_Compare
135 inline bool operator()(const int &i1, const int &i2) const
137 return abs(i1-i2) < 6 ? false: i1 < i2;
140 std::map< int, int, Orbital_Position_Compare > m_rotor_position_table;
141 /* mapping orbitalposition <-> number stored in rotor */
143 void setDefaultOptions(); // set default rotor options
146 class eDVBSatelliteParameters
149 eDVBSatelliteDiseqcParameters m_diseqc_parameters;
150 eDVBSatelliteRotorParameters m_rotor_parameters;
151 eDVBSatelliteSwitchParameters m_switch_parameters;
154 class eDVBSatelliteLNBParameters
157 enum t_12V_relais_state { OFF=0, ON };
158 t_12V_relais_state m_12V_relais_state; // 12V relais output on/off
160 unsigned int m_lof_hi, // for 2 band universal lnb 10600 Mhz (high band offset frequency)
161 m_lof_lo, // for 2 band universal lnb 9750 Mhz (low band offset frequency)
162 m_lof_threshold; // for 2 band universal lnb 11750 Mhz (band switch frequency)
164 bool m_increased_voltage; // use increased voltage ( 14/18V )
166 std::map<int, eDVBSatelliteParameters> m_satellites;
169 class eDVBSatelliteEquipmentControl: public iDVBSatelliteEquipmentControl
171 std::list<eDVBSatelliteLNBParameters> m_lnblist;
173 DECLARE_REF(eDVBSatelliteEquipmentControl);
174 eDVBSatelliteEquipmentControl();
175 RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat);