add satconfig part
[vuplus_dvbapp] / lib / dvb / sec.h
1 #ifndef __dvb_sec_h
2 #define __dvb_sec_h
3
4 #include <config.h>
5 #include <lib/dvb/idvb.h>
6
7 class eDVBSatelliteDiseqcParameters
8 {
9 public:
10         enum { AA=0, AB=1, BA=2, BB=3, SENDNO=4 /* and 0xF0 .. 0xFF*/  };       // DiSEqC Parameter
11         int m_commited_cmd;
12
13         enum t_diseqc_mode { NONE=0, V1_0=1, V1_1=2, V1_2=3, SMATV=4 }; // DiSEqC Mode
14         t_diseqc_mode m_diseqc_mode;
15
16         enum t_toneburst_param { NO=0, A=1, B=2 };
17         t_toneburst_param m_toneburst_param;
18
19         int m_repeats;  // for cascaded switches
20         bool m_use_fast;        // send no DiSEqC on H/V or Lo/Hi change
21         bool m_seq_repeat;      // send the complete DiSEqC Sequence twice...
22         bool m_swap_cmds;       // swaps the committed & uncommitted cmd
23         int m_uncommitted_cmd;  // state of the 4 uncommitted switches..
24 };
25
26 class eDVBSatelliteSwitchParameters
27 {
28 public:
29         enum t_22khz_signal {   HILO=0, ON=1, OFF=2     }; // 22 Khz
30         enum t_voltage_mode     {       HV=0, _14V=1, _18V=2, _0V=3 }; // 14/18 V
31         t_voltage_mode m_voltage_mode;
32         t_22khz_signal m_22khz_signal;
33 };
34
35 class eDVBSatelliteRotorParameters
36 {
37 public:
38         enum { NORTH, SOUTH, EAST, WEST };
39
40         struct eDVBSatelliteRotorInputpowerParameters
41         {
42                 bool m_use;     // can we use rotor inputpower to detect rotor running state ?
43                 int m_threshold;        // threshold between running and stopped rotor
44         };
45         eDVBSatelliteRotorInputpowerParameters m_inputpower_parameters;
46
47         struct eDVBSatelliteRotorGotoxxParameters
48         {
49                 bool m_can_use; // rotor support gotoXX cmd ?
50                 int m_lo_direction;     // EAST, WEST
51                 int m_la_direction;     // NORT, SOUTH
52                 double m_longitude;     // longitude for gotoXX° function
53                 double m_latitude;      // latitude for gotoXX° function
54         };
55         eDVBSatelliteRotorGotoxxParameters m_gotoxx_parameters;
56
57         struct Orbital_Position_Compare
58         {
59                 inline bool operator()(const int &i1, const int &i2) const
60                 {
61                         return abs(i1-i2) < 6 ? false: i1 < i2;
62                 }
63         };
64         std::map< int, int, Orbital_Position_Compare > m_rotor_position_table;
65         /* mapping orbitalposition <-> number stored in rotor */
66
67         void setDefaultOptions(); // set default rotor options
68 };
69
70 class eDVBSatelliteParameters
71 {
72 public:
73         eDVBSatelliteDiseqcParameters m_diseqc_parameters;
74         eDVBSatelliteRotorParameters m_rotor_parameters;
75         eDVBSatelliteSwitchParameters m_switch_parameters;
76 };
77
78 class eDVBSatelliteLNBParameters
79 {
80 public:
81         enum t_12V_relais_state { OFF=0, ON };
82         t_12V_relais_state m_12V_relais_state;  // 12V relais output on/off
83
84         unsigned int m_lof_hi,  // for 2 band universal lnb 10600 Mhz (high band offset frequency)
85                                 m_lof_lo,       // for 2 band universal lnb  9750 Mhz (low band offset frequency)
86                                 m_lof_threshold;        // for 2 band universal lnb 11750 Mhz (band switch frequency)
87
88         bool m_increased_voltage; // use increased voltage ( 14/18V )
89
90         std::map<int, eDVBSatelliteParameters> m_satellites;
91 };
92
93 class eDVBSatelliteEquipmentControl: public iDVBSatelliteEquipmentControl
94 {
95         std::list<eDVBSatelliteLNBParameters> m_lnblist;
96 public:
97         DECLARE_REF(eDVBSatelliteEquipmentControl);
98         eDVBSatelliteEquipmentControl();
99         RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat);
100 };
101
102 #endif