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_RUNNING_GOTO, IF_STOPPED_GOTO,
16 UPDATE_CURRENT_ROTORPARAMS, SET_TIMEOUT,
28 eDVBDiseqcCommand diseqc;
30 eSecCommand( int cmd )
33 eSecCommand( int cmd, int val )
36 eSecCommand( int cmd, eDVBDiseqcCommand diseqc )
37 :cmd(cmd), diseqc(diseqc)
46 std::list<eSecCommand> secSequence;
47 std::list<eSecCommand>::iterator cur;
50 :cur(secSequence.end())
53 void push_front(const eSecCommand &cmd)
55 secSequence.push_front(cmd);
57 void push_back(const eSecCommand &cmd)
59 secSequence.push_back(cmd);
64 cur=secSequence.end();
66 inline std::list<eSecCommand>::iterator ¤t()
70 inline std::list<eSecCommand>::iterator begin()
72 return secSequence.begin();
74 inline std::list<eSecCommand>::iterator end()
76 return secSequence.end();
80 return secSequence.size();
84 return secSequence.size();
88 class eDVBSatelliteDiseqcParameters
91 enum { AA=0, AB=1, BA=2, BB=3, SENDNO=4 /* and 0xF0 .. 0xFF*/ }; // DiSEqC Parameter
94 enum t_diseqc_mode { NONE=0, V1_0=1, V1_1=2, V1_2=3, SMATV=4 }; // DiSEqC Mode
95 t_diseqc_mode m_diseqc_mode;
97 enum t_toneburst_param { NO=0, A=1, B=2 };
98 t_toneburst_param m_toneburst_param;
100 int m_repeats; // for cascaded switches
101 bool m_use_fast; // send no DiSEqC on H/V or Lo/Hi change
102 bool m_seq_repeat; // send the complete DiSEqC Sequence twice...
103 bool m_swap_cmds; // swaps the committed & uncommitted cmd
104 int m_uncommitted_cmd; // state of the 4 uncommitted switches..
107 class eDVBSatelliteSwitchParameters
110 enum t_22khz_signal { HILO=0, ON=1, OFF=2 }; // 22 Khz
111 enum t_voltage_mode { HV=0, _14V=1, _18V=2, _0V=3 }; // 14/18 V
112 t_voltage_mode m_voltage_mode;
113 t_22khz_signal m_22khz_signal;
116 class eDVBSatelliteRotorParameters
119 enum { NORTH, SOUTH, EAST, WEST };
121 struct eDVBSatelliteRotorInputpowerParameters
123 bool m_use; // can we use rotor inputpower to detect rotor running state ?
124 int m_threshold; // threshold between running and stopped rotor
126 eDVBSatelliteRotorInputpowerParameters m_inputpower_parameters;
128 struct eDVBSatelliteRotorGotoxxParameters
130 bool m_can_use; // rotor support gotoXX cmd ?
131 int m_lo_direction; // EAST, WEST
132 int m_la_direction; // NORT, SOUTH
133 double m_longitude; // longitude for gotoXX° function
134 double m_latitude; // latitude for gotoXX° function
136 eDVBSatelliteRotorGotoxxParameters m_gotoxx_parameters;
138 struct Orbital_Position_Compare
140 inline bool operator()(const int &i1, const int &i2) const
142 return abs(i1-i2) < 6 ? false: i1 < i2;
145 std::map< int, int, Orbital_Position_Compare > m_rotor_position_table;
146 /* mapping orbitalposition <-> number stored in rotor */
148 void setDefaultOptions(); // set default rotor options
151 class eDVBSatelliteParameters
154 eDVBSatelliteDiseqcParameters m_diseqc_parameters;
155 eDVBSatelliteRotorParameters m_rotor_parameters;
156 eDVBSatelliteSwitchParameters m_switch_parameters;
159 class eDVBSatelliteLNBParameters
162 enum t_12V_relais_state { OFF=0, ON };
163 t_12V_relais_state m_12V_relais_state; // 12V relais output on/off
165 unsigned int m_lof_hi, // for 2 band universal lnb 10600 Mhz (high band offset frequency)
166 m_lof_lo, // for 2 band universal lnb 9750 Mhz (low band offset frequency)
167 m_lof_threshold; // for 2 band universal lnb 11750 Mhz (band switch frequency)
169 bool m_increased_voltage; // use increased voltage ( 14/18V )
171 std::map<int, eDVBSatelliteParameters> m_satellites;
174 class eDVBSatelliteEquipmentControl: public iDVBSatelliteEquipmentControl
176 std::list<eDVBSatelliteLNBParameters> m_lnblist;
178 DECLARE_REF(eDVBSatelliteEquipmentControl);
179 eDVBSatelliteEquipmentControl();
180 RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat);