5 #include <lib/dvb/idvb.h>
12 NONE, SLEEP, SET_VOLTAGE, SET_TONE, GOTO,
13 SEND_DISEQC, SEND_TONEBURST, SET_FRONTEND,
14 MEASURE_IDLE_INPUTPOWER, MEASURE_RUNNING_INPUTPOWER,
15 IF_TIMEOUT_GOTO, IF_INPUTPOWER_DELTA_GOTO,
16 UPDATE_CURRENT_ROTORPARAMS, SET_TIMEOUT
21 int deltaA; // difference in mA between running and stopped rotor
22 int okcount; // counter
23 int steps; // goto steps
36 eDVBDiseqcCommand diseqc;
38 eSecCommand( int cmd )
41 eSecCommand( int cmd, int val )
44 eSecCommand( int cmd, eDVBDiseqcCommand diseqc )
45 :cmd(cmd), diseqc(diseqc)
47 eSecCommand( int cmd, rotor measure )
48 :cmd(cmd), measure(measure)
57 std::list<eSecCommand> secSequence;
58 std::list<eSecCommand>::iterator cur;
61 :cur(secSequence.end())
64 void push_front(const eSecCommand &cmd)
66 secSequence.push_front(cmd);
68 void push_back(const eSecCommand &cmd)
70 secSequence.push_back(cmd);
75 cur=secSequence.end();
77 inline std::list<eSecCommand>::iterator ¤t()
81 inline std::list<eSecCommand>::iterator begin()
83 return secSequence.begin();
85 inline std::list<eSecCommand>::iterator end()
87 return secSequence.end();
91 return secSequence.size();
95 return secSequence.size();
99 class eDVBSatelliteDiseqcParameters
102 enum { AA=0, AB=1, BA=2, BB=3, SENDNO=4 /* and 0xF0 .. 0xFF*/ }; // DiSEqC Parameter
105 enum t_diseqc_mode { NONE=0, V1_0=1, V1_1=2, V1_2=3, SMATV=4 }; // DiSEqC Mode
106 t_diseqc_mode m_diseqc_mode;
108 enum t_toneburst_param { NO=0, A=1, B=2 };
109 t_toneburst_param m_toneburst_param;
111 int m_repeats; // for cascaded switches
112 bool m_use_fast; // send no DiSEqC on H/V or Lo/Hi change
113 bool m_seq_repeat; // send the complete DiSEqC Sequence twice...
114 bool m_swap_cmds; // swaps the committed & uncommitted cmd
115 int m_uncommitted_cmd; // state of the 4 uncommitted switches..
118 class eDVBSatelliteSwitchParameters
121 enum t_22khz_signal { HILO=0, ON=1, OFF=2 }; // 22 Khz
122 enum t_voltage_mode { HV=0, _14V=1, _18V=2, _0V=3 }; // 14/18 V
123 t_voltage_mode m_voltage_mode;
124 t_22khz_signal m_22khz_signal;
127 class eDVBSatelliteRotorParameters
130 enum { NORTH, SOUTH, EAST, WEST };
132 struct eDVBSatelliteRotorInputpowerParameters
134 bool m_use; // can we use rotor inputpower to detect rotor running state ?
135 int m_threshold; // threshold between running and stopped rotor
137 eDVBSatelliteRotorInputpowerParameters m_inputpower_parameters;
139 struct eDVBSatelliteRotorGotoxxParameters
141 bool m_can_use; // rotor support gotoXX cmd ?
142 int m_lo_direction; // EAST, WEST
143 int m_la_direction; // NORT, SOUTH
144 double m_longitude; // longitude for gotoXX° function
145 double m_latitude; // latitude for gotoXX° function
147 eDVBSatelliteRotorGotoxxParameters m_gotoxx_parameters;
149 struct Orbital_Position_Compare
151 inline bool operator()(const int &i1, const int &i2) const
153 return abs(i1-i2) < 6 ? false: i1 < i2;
156 std::map< int, int, Orbital_Position_Compare > m_rotor_position_table;
157 /* mapping orbitalposition <-> number stored in rotor */
159 void setDefaultOptions() // set default rotor options
161 m_inputpower_parameters.m_use = true;
162 m_inputpower_parameters.m_threshold = 60;
163 m_gotoxx_parameters.m_can_use = true;
164 m_gotoxx_parameters.m_lo_direction = EAST;
165 m_gotoxx_parameters.m_la_direction = NORTH;
166 m_gotoxx_parameters.m_longitude = 0.0;
167 m_gotoxx_parameters.m_latitude = 0.0;
171 class eDVBSatelliteParameters
174 eDVBSatelliteRotorParameters m_rotor_parameters;
175 eDVBSatelliteSwitchParameters m_switch_parameters;
178 class eDVBSatelliteLNBParameters
181 enum t_12V_relais_state { OFF=0, ON };
182 t_12V_relais_state m_12V_relais_state; // 12V relais output on/off
184 unsigned int m_lof_hi, // for 2 band universal lnb 10600 Mhz (high band offset frequency)
185 m_lof_lo, // for 2 band universal lnb 9750 Mhz (low band offset frequency)
186 m_lof_threshold; // for 2 band universal lnb 11750 Mhz (band switch frequency)
188 bool m_increased_voltage; // use increased voltage ( 14/18V )
190 std::map<int, eDVBSatelliteParameters> m_satellites;
191 eDVBSatelliteDiseqcParameters m_diseqc_parameters;
194 class eDVBSatelliteEquipmentControl: public iDVBSatelliteEquipmentControl
196 std::list<eDVBSatelliteLNBParameters> m_lnblist;
198 DECLARE_REF(eDVBSatelliteEquipmentControl);
199 eDVBSatelliteEquipmentControl();
200 RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat);