5 #include <lib/dvb/idvb.h>
11 enum { modeStatic, modeDynamic };
13 NONE, SLEEP, SET_VOLTAGE, SET_TONE, GOTO,
14 SEND_DISEQC, SEND_TONEBURST, SET_FRONTEND,
15 MEASURE_IDLE_INPUTPOWER, MEASURE_RUNNING_INPUTPOWER,
16 IF_TIMEOUT_GOTO, IF_INPUTPOWER_DELTA_GOTO,
17 UPDATE_CURRENT_ROTORPARAMS, SET_TIMEOUT,
18 IF_IDLE_INPUTPOWER_AVAIL_GOTO, SET_POWER_LIMITING_MODE,
24 int deltaA; // difference in mA between running and stopped rotor
25 int okcount; // counter
26 int steps; // goto steps
45 eDVBDiseqcCommand diseqc;
48 eSecCommand( int cmd )
51 eSecCommand( int cmd, int val )
54 eSecCommand( int cmd, eDVBDiseqcCommand diseqc )
55 :cmd(cmd), diseqc(diseqc)
57 eSecCommand( int cmd, rotor measure )
58 :cmd(cmd), measure(measure)
60 eSecCommand( int cmd, pair compare )
61 :cmd(cmd), compare(compare)
70 std::list<eSecCommand> secSequence;
71 std::list<eSecCommand>::iterator cur;
74 :cur(secSequence.end())
77 void push_front(const eSecCommand &cmd)
79 secSequence.push_front(cmd);
81 void push_back(const eSecCommand &cmd)
83 secSequence.push_back(cmd);
88 cur=secSequence.end();
90 inline std::list<eSecCommand>::iterator ¤t()
94 inline std::list<eSecCommand>::iterator begin()
96 return secSequence.begin();
98 inline std::list<eSecCommand>::iterator end()
100 return secSequence.end();
104 return secSequence.size();
106 operator bool() const
108 return secSequence.size();
112 class eDVBSatelliteDiseqcParameters
115 enum { AA=0, AB=1, BA=2, BB=3, SENDNO=4 /* and 0xF0 .. 0xFF*/ }; // DiSEqC Parameter
118 enum t_diseqc_mode { NONE=0, V1_0=1, V1_1=2, V1_2=3, SMATV=4 }; // DiSEqC Mode
119 t_diseqc_mode m_diseqc_mode;
121 enum t_toneburst_param { NO=0, A=1, B=2 };
122 t_toneburst_param m_toneburst_param;
124 int m_repeats; // for cascaded switches
125 bool m_use_fast; // send no DiSEqC on H/V or Lo/Hi change
126 bool m_seq_repeat; // send the complete DiSEqC Sequence twice...
127 bool m_swap_cmds; // swaps the committed & uncommitted cmd
128 int m_uncommitted_cmd; // state of the 4 uncommitted switches..
131 class eDVBSatelliteSwitchParameters
134 enum t_22khz_signal { HILO=0, ON=1, OFF=2 }; // 22 Khz
135 enum t_voltage_mode { HV=0, _14V=1, _18V=2, _0V=3 }; // 14/18 V
136 t_voltage_mode m_voltage_mode;
137 t_22khz_signal m_22khz_signal;
140 class eDVBSatelliteRotorParameters
143 enum { NORTH, SOUTH, EAST, WEST };
145 struct eDVBSatelliteRotorInputpowerParameters
147 bool m_use; // can we use rotor inputpower to detect rotor running state ?
148 int m_threshold; // threshold between running and stopped rotor
150 eDVBSatelliteRotorInputpowerParameters m_inputpower_parameters;
152 struct eDVBSatelliteRotorGotoxxParameters
154 bool m_can_use; // rotor support gotoXX cmd ?
155 int m_lo_direction; // EAST, WEST
156 int m_la_direction; // NORT, SOUTH
157 double m_longitude; // longitude for gotoXX° function
158 double m_latitude; // latitude for gotoXX° function
160 eDVBSatelliteRotorGotoxxParameters m_gotoxx_parameters;
162 struct Orbital_Position_Compare
164 inline bool operator()(const int &i1, const int &i2) const
166 return abs(i1-i2) < 6 ? false: i1 < i2;
169 std::map< int, int, Orbital_Position_Compare > m_rotor_position_table;
170 /* mapping orbitalposition <-> number stored in rotor */
172 void setDefaultOptions() // set default rotor options
174 m_inputpower_parameters.m_use = true;
175 m_inputpower_parameters.m_threshold = 60;
176 m_gotoxx_parameters.m_can_use = true;
177 m_gotoxx_parameters.m_lo_direction = EAST;
178 m_gotoxx_parameters.m_la_direction = NORTH;
179 m_gotoxx_parameters.m_longitude = 0.0;
180 m_gotoxx_parameters.m_latitude = 0.0;
184 class eDVBSatelliteLNBParameters
187 enum t_12V_relais_state { OFF=0, ON };
188 t_12V_relais_state m_12V_relais_state; // 12V relais output on/off
190 unsigned int m_lof_hi, // for 2 band universal lnb 10600 Mhz (high band offset frequency)
191 m_lof_lo, // for 2 band universal lnb 9750 Mhz (low band offset frequency)
192 m_lof_threshold; // for 2 band universal lnb 11750 Mhz (band switch frequency)
194 bool m_increased_voltage; // use increased voltage ( 14/18V )
196 std::map<int, eDVBSatelliteSwitchParameters> m_satellites;
197 eDVBSatelliteDiseqcParameters m_diseqc_parameters;
198 eDVBSatelliteRotorParameters m_rotor_parameters;
201 class eDVBSatelliteEquipmentControl: public iDVBSatelliteEquipmentControl
203 std::list<eDVBSatelliteLNBParameters> m_lnblist;
205 DECLARE_REF(eDVBSatelliteEquipmentControl);
206 eDVBSatelliteEquipmentControl();
207 RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat);