MythTV  master
diseqc.h
Go to the documentation of this file.
1 /* -*- Mode: c++ -*-
2  * \file diseqc.h
3  * \brief DVB-S Device Tree Control Classes.
4  * \author Copyright (C) 2006, Yeasah Pell
5  */
6 
7 #ifndef _DISEQC_H_
8 #define _DISEQC_H_
9 
10 // C++ headers
11 #include <cinttypes>
12 #include <vector>
13 using namespace std;
14 
15 // Qt headers
16 #include <QString>
17 #include <QMutex>
18 #include <QMap>
19 
20 class DTVMultiplex;
21 
22 class DiSEqCDevSettings;
23 class DiSEqCDevTrees;
24 class DiSEqCDevTree;
25 class DiSEqCDevDevice;
26 class DiSEqCDevRotor;
27 class DiSEqCDevLNB;
28 class DiSEqCDevSCR;
29 
30 using uint_to_dbl_t = QMap<uint, double>;
31 using dbl_to_uint_t = QMap<double, uint>;
32 using cardid_to_diseqc_tree_t = QMap<uint, DiSEqCDevTree*>;
33 using dvbdev_vec_t = vector<DiSEqCDevDevice*>;
34 
36 {
37  public:
38  DiSEqCDevSettings() = default;
39 
40  bool Load( uint card_input_id);
41  bool Store(uint card_input_id) const;
42  double GetValue(uint devid) const;
43  void SetValue(uint devid, double value);
44 
45  protected:
46  uint_to_dbl_t m_config; //< map of dev tree id to configuration value
47  uint m_inputId {1};
48 };
49 
50 class DiSEqCDev
51 {
52  public:
53  static DiSEqCDevTree* FindTree(uint cardid);
54  static void InvalidateTrees(void);
55 
56  protected:
58 };
59 
61 {
62  public:
63  ~DiSEqCDevTrees();
64 
65  DiSEqCDevTree *FindTree(uint cardid);
66  void InvalidateTrees(void);
67 
68  protected:
70  QMutex m_treesLock;
71 };
72 
74 {
75  public:
76  DiSEqCDevTree() { Reset(); }
77  ~DiSEqCDevTree();
78 
79  bool Load(const QString &device);
80  bool Load(uint cardid);
81  bool Store(uint cardid, const QString &device = "");
82  bool Execute(const DiSEqCDevSettings &settings,
83  const DTVMultiplex &tuning);
84  void Reset(void);
85 
86  DiSEqCDevRotor *FindRotor(const DiSEqCDevSettings &settings, uint index = 0);
87  DiSEqCDevLNB *FindLNB(const DiSEqCDevSettings &settings);
88  DiSEqCDevSCR *FindSCR(const DiSEqCDevSettings &settings);
89  DiSEqCDevDevice *FindDevice(uint dev_id);
90 
92  DiSEqCDevDevice *Root(void) { return m_root; }
93  void SetRoot(DiSEqCDevDevice *root);
94 
95  bool SendCommand(uint adr, uint cmd, uint repeats = 0,
96  uint data_len = 0, unsigned char *data = nullptr);
97 
98  bool ResetDiseqc(bool hard_reset, bool is_SCR);
99 
100  // frontend fd
101  void Open(int fd_frontend, bool is_SCR);
102  void Close(void) { m_fdFrontend = -1; }
103  int GetFD(void) const { return m_fdFrontend; }
104 
105  // Sets
106  bool SetTone(bool on);
107  bool SetVoltage(uint voltage);
108 
109  // Gets
110  uint GetVoltage(void) const { return m_lastVoltage; }
111  bool IsInNeedOfConf(void) const;
112 
113  // tree management
114  void AddDeferredDelete(uint dev_id) { m_delete.push_back(dev_id); }
115  uint CreateFakeDiSEqCID(void) { return m_previousFakeDiseqcid++; }
116 
117  static bool IsFakeDiSEqCID(uint id) { return id >= kFirstFakeDiSEqCID; }
118  static bool Exists(int cardid);
119 
120  protected:
121  bool ApplyVoltage(const DiSEqCDevSettings &settings,
122  const DTVMultiplex &tuning);
123 
124  int m_fdFrontend {-1};
125  DiSEqCDevDevice *m_root {nullptr};
126  uint m_lastVoltage {UINT_MAX};
127  uint m_previousFakeDiseqcid {kFirstFakeDiSEqCID};
128  vector<uint> m_delete;
129 
130  static const uint kFirstFakeDiSEqCID;
131 };
132 
134 {
135  public:
137  : m_devid(devid), m_tree(tree) {}
138  virtual ~DiSEqCDevDevice();
139 
140  // Commands
141  virtual void Reset(void) {}
142  virtual bool Execute(const DiSEqCDevSettings&, const DTVMultiplex&) = 0;
143  virtual bool Load(void) = 0;
144  virtual bool Store(void) const = 0;
145 
146  // Sets
147  enum dvbdev_t
148  {
149  kTypeSwitch = 0,
150  kTypeRotor = 1,
151  kTypeSCR = 2,
152  kTypeLNB = 3,
153  };
154  void SetDeviceType(dvbdev_t type) { m_devType = type; }
155  void SetParent(DiSEqCDevDevice* parent) { m_parent = parent; }
156  void SetOrdinal(uint ordinal) { m_ordinal = ordinal; }
157  void SetDescription(const QString &desc) { m_desc = desc; }
158  void SetRepeatCount(uint repeat) { m_repeat = repeat; }
159  virtual bool SetChild(uint /*ordinal*/, DiSEqCDevDevice */*device*/)
160  {return false; }
161 
162  // Gets
163  dvbdev_t GetDeviceType(void) const { return m_devType; }
164  uint GetDeviceID(void) const { return m_devid; }
165  bool IsRealDeviceID(void) const
166  { return !DiSEqCDevTree::IsFakeDiSEqCID(m_devid); }
167  DiSEqCDevDevice *GetParent(void) const { return m_parent; }
168  uint GetOrdinal(void) const { return m_ordinal; }
169  QString GetDescription(void) const { return m_desc; }
170  uint GetRepeatCount(void) const { return m_repeat; }
171  virtual uint GetChildCount(void) const { return 0; }
172  virtual bool IsCommandNeeded(
173  const DiSEqCDevSettings &/*settings*/, const DTVMultiplex &/*tuning*/)
174  const { return false; }
175  virtual uint GetVoltage(
176  const DiSEqCDevSettings &/*settings*/, const DTVMultiplex &/*tuning*/) const = 0;
177 
178  // Non-const Gets
179  DiSEqCDevDevice *FindDevice(uint dev_id);
181  const DiSEqCDevSettings &/*settings*/) const { return nullptr; }
182  virtual DiSEqCDevDevice *GetChild(uint /*ordinal*/) { return nullptr; }
183 
184  // Statics
185  static QString DevTypeToString(dvbdev_t type)
186  { return TableToString((uint)type, kDvbdevLookup); }
187  static dvbdev_t DevTypeFromString(const QString &type)
188  { return (dvbdev_t) TableFromString(type, kDvbdevLookup); }
189 
190  static DiSEqCDevDevice *CreateById( DiSEqCDevTree &tree,
191  uint devid);
192  static DiSEqCDevDevice *CreateByType(DiSEqCDevTree &tree,
193  dvbdev_t type,
194  uint dev_id = 0);
195 
196  protected:
197  void SetDeviceID(uint devid) const { m_devid = devid; }
198 
199  mutable uint m_devid;
200  dvbdev_t m_devType {kTypeLNB};
201  QString m_desc;
203  DiSEqCDevDevice *m_parent {nullptr};
204  uint m_ordinal {0};
205  uint m_repeat {1};
206 
207  struct TypeTable { QString name; uint value; };
208  static QString TableToString(uint type, const TypeTable *table);
209  static uint TableFromString(const QString &type,
210  const TypeTable *table);
211 
212  private:
213  static const TypeTable kDvbdevLookup[5];
214 };
215 
217 {
218  public:
219  DiSEqCDevSwitch(DiSEqCDevTree &tree, uint devid);
220  ~DiSEqCDevSwitch() override;
221 
222  // Commands
223  void Reset(void) override; // DiSEqCDevDevice
224  bool Execute(const DiSEqCDevSettings &/*settings*/,
225  const DTVMultiplex &/*tuning*/) override; // DiSEqCDevDevice
226  bool Load(void) override; // DiSEqCDevDevice
227  bool Store(void) const override; // DiSEqCDevDevice
228 
229  // Sets
231  {
232  kTypeTone = 0,
233  kTypeDiSEqCCommitted = 1,
234  kTypeDiSEqCUncommitted = 2,
235  kTypeLegacySW21 = 3,
236  kTypeLegacySW42 = 4,
237  kTypeLegacySW64 = 5,
238  kTypeVoltage = 6,
239  kTypeMiniDiSEqC = 7,
240  };
241  void SetType(dvbdev_switch_t type) { m_type = type; }
242  void SetAddress(uint address) { m_address = address; }
243  void SetNumPorts(uint num_ports);
244  bool SetChild(uint ordinal, DiSEqCDevDevice *device) override; // DiSEqCDevDevice
245 
246  // Gets
247  dvbdev_switch_t GetType(void) const { return m_type; }
248  uint GetAddress(void) const { return m_address; }
249  uint GetNumPorts(void) const { return m_numPorts; }
250  bool ShouldSwitch(const DiSEqCDevSettings &settings,
251  const DTVMultiplex &tuning) const;
252  uint GetChildCount(void) const override; // DiSEqCDevDevice
253  bool IsCommandNeeded(const DiSEqCDevSettings &settings,
254  const DTVMultiplex &tuning) const override; // DiSEqCDevDevice
255  uint GetVoltage(const DiSEqCDevSettings &settings,
256  const DTVMultiplex &tuning) const override; // DiSEqCDevDevice
257 
258  // Non-const Gets
259  DiSEqCDevDevice *GetSelectedChild(const DiSEqCDevSettings &settings) const override; // DiSEqCDevDevice
260  DiSEqCDevDevice *GetChild(uint ordinal) override; // DiSEqCDevDevice
261 
262  // Statics
264  { return TableToString((uint)type, kSwitchTypeTable); }
266  { return (dvbdev_switch_t) TableFromString(type, kSwitchTypeTable); }
267 
268 
269  protected:
270  bool ExecuteLegacy(
271  const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, uint pos);
272  bool ExecuteTone(
273  const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, uint pos);
274  bool ExecuteVoltage(
275  const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, uint pos);
276  bool ExecuteMiniDiSEqC(
277  const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, uint pos);
278  bool ExecuteDiseqc(
279  const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, uint pos);
280 
281  int GetPosition( const DiSEqCDevSettings &settings) const;
282 
283  private:
284  dvbdev_switch_t m_type {kTypeTone};
285  uint m_address {0x10}; //DISEQC_ADR_SW_ALL
286  uint m_numPorts {2};
287  uint m_lastPos {UINT_MAX};
288  uint m_lastHighBand {UINT_MAX};
289  uint m_lastHorizontal {UINT_MAX};
291 
292  static const TypeTable kSwitchTypeTable[9];
293 };
294 
296 {
297  public:
299  : DiSEqCDevDevice(tree, devid) { DiSEqCDevRotor::Reset(); }
300  ~DiSEqCDevRotor() override;
301 
302  // Commands
303  void Reset(void) override; // DiSEqCDevDevice
304  bool Execute(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) override; // DiSEqCDevDevice
305  bool Load(void) override; // DiSEqCDevDevice
306  bool Store(void) const override; // DiSEqCDevDevice
307 
308  // Sets
309  enum dvbdev_rotor_t { kTypeDiSEqC_1_2 = 0, kTypeDiSEqC_1_3 = 1, };
310  void SetType(dvbdev_rotor_t type) { m_type = type; }
311  void SetLoSpeed(double speed) { m_speedLo = speed; }
312  void SetHiSpeed(double speed) { m_speedHi = speed; }
313  void SetPosMap(const uint_to_dbl_t &posmap);
314  bool SetChild(uint ordinal, DiSEqCDevDevice* device) override; // DiSEqCDevDevice
315  void RotationComplete(void) const;
316 
317  // Gets
318  dvbdev_rotor_t GetType(void) const { return m_type; }
319  double GetLoSpeed(void) const { return m_speedLo; }
320  double GetHiSpeed(void) const { return m_speedHi; }
321  uint_to_dbl_t GetPosMap(void) const;
322  double GetProgress(void) const;
323  bool IsPositionKnown(void) const;
324  uint GetChildCount(void) const override // DiSEqCDevDevice
325  { return 1; }
326  bool IsCommandNeeded(const DiSEqCDevSettings &settings,
327  const DTVMultiplex &tuning) const override; // DiSEqCDevDevice
328  bool IsMoving(const DiSEqCDevSettings &settings) const;
329  uint GetVoltage(const DiSEqCDevSettings &settings,
330  const DTVMultiplex &tuning) const override; // DiSEqCDevDevice
331 
332  // Non-const Gets
333  DiSEqCDevDevice *GetSelectedChild(const DiSEqCDevSettings &setting) const override; // DiSEqCDevDevice
334  DiSEqCDevDevice *GetChild(uint /*ordinal*/) override // DiSEqCDevDevice
335  { return m_child; }
336 
337  // Statics
339  { return TableToString((uint)type, kRotorTypeTable); }
340  static dvbdev_rotor_t RotorTypeFromString(const QString &type)
341  { return (dvbdev_rotor_t) TableFromString(type, kRotorTypeTable); }
342 
343  protected:
344  bool ExecuteRotor(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning,
345  double angle);
346  bool ExecuteUSALS(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning,
347  double angle);
348  void StartRotorPositionTracking(double azimuth);
349 
350  static double CalculateAzimuth(double angle);
351  double GetApproxAzimuth(void) const;
352 
353  private:
354  // configuration
355  dvbdev_rotor_t m_type {kTypeDiSEqC_1_3};
356  double m_speedHi {2.5};
357  double m_speedLo {1.9};
359  DiSEqCDevDevice *m_child {nullptr};
360 
361  // state
362  double m_lastPosition {0.0};
363  double m_desiredAzimuth {0.0};
364  bool m_reset {true};
365 
366  // rotor position tracking state
367  mutable double m_moveTime {0.0};
368  mutable bool m_lastPosKnown {false};
369  mutable double m_lastAzimuth {0.0};
370 
371  // statics
372  static const TypeTable kRotorTypeTable[3];
373 };
374 
376 {
377  public:
379  : DiSEqCDevDevice(tree, devid) { DiSEqCDevSCR::Reset(); }
380  ~DiSEqCDevSCR() override;
381 
382  // Commands
383  void Reset(void) override; // DiSEqCDevDevice
384  bool Execute(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) override; // DiSEqCDevDevice
385  bool PowerOff(void) const;
386  bool Load(void) override; // DiSEqCDevDevice
387  bool Store(void) const override; // DiSEqCDevDevice
388 
389  // Sets
391  {
392  kTypeScrPosA = 0,
393  kTypeScrPosB = 1,
394  };
395  void SetUserBand(uint userband) { m_scrUserband = userband; }
396  void SetFrequency(uint freq) { m_scrFrequency = freq; }
397  void SetPIN(int pin) { m_scrPin = pin; }
398  bool SetChild(uint ordinal, DiSEqCDevDevice* device) override; // DiSEqCDevDevice
399 
400  // Gets
401  uint GetUserBand(void) const { return m_scrUserband; }
402  uint GetFrequency(void) const { return m_scrFrequency; }
403  int GetPIN(void) const { return m_scrPin; }
404  uint GetChildCount(void) const override // DiSEqCDevDevice
405  { return 1; }
406  bool IsCommandNeeded(const DiSEqCDevSettings &/*settings*/,
407  const DTVMultiplex &/*tuning*/) const override // DiSEqCDevDevice
408  { return false; }
409  uint GetVoltage(const DiSEqCDevSettings &settings,
410  const DTVMultiplex &tuning) const override; // DiSEqCDevDevice
411  uint32_t GetIntermediateFrequency(uint32_t frequency) const;
412 
413  // Non-const Gets
414  DiSEqCDevDevice *GetSelectedChild(const DiSEqCDevSettings &/*settings*/) const override // DiSEqCDevDevice
415  { return m_child; }
416  DiSEqCDevDevice *GetChild(uint /*ordinal*/) override // DiSEqCDevDevice
417  { return m_child; }
418 
419  // statics
420  static QString SCRPositionToString(dvbdev_pos_t pos)
421  { return TableToString((uint)pos, kSCRPositionTable); }
422 
423  static dvbdev_pos_t SCRPositionFromString(const QString &pos)
424  { return (dvbdev_pos_t) TableFromString(pos, kSCRPositionTable); }
425 
426  protected:
427  bool SendCommand(uint cmd, uint repeats, uint data_len = 0,
428  unsigned char *data = nullptr) const;
429 
430  private:
431  uint m_scrUserband {0}; /* 0-7 */
432  uint m_scrFrequency {1400};
433  int m_scrPin {-1}; /* 0-255, -1=disabled */
434 
435  DiSEqCDevDevice *m_child {nullptr};
436 
437  static const TypeTable kSCRPositionTable[3];
438 };
439 
441 {
442  public:
444  : DiSEqCDevDevice(tree, devid) { DiSEqCDevLNB::Reset(); }
445 
446  // Commands
447  bool Execute(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) override; // DiSEqCDevDevice
448  bool Load(void) override; // DiSEqCDevDevice
449  bool Store(void) const override; // DiSEqCDevDevice
450 
451  // Sets
453  {
454  kTypeFixed = 0,
455  kTypeVoltageControl = 1,
456  kTypeVoltageAndToneControl = 2,
457  kTypeBandstacked = 3,
458  };
459  void SetType(dvbdev_lnb_t type) { m_type = type; }
460  void SetLOFSwitch(uint lof_switch) { m_lofSwitch = lof_switch; }
461  void SetLOFHigh( uint lof_hi) { m_lofHi = lof_hi; }
462  void SetLOFLow( uint lof_lo) { m_lofLo = lof_lo; }
463  void SetPolarityInverted(bool inv) { m_polInv = inv; }
464 
465  // Gets
466  dvbdev_lnb_t GetType(void) const { return m_type; }
467  uint GetLOFSwitch(void) const { return m_lofSwitch; }
468  uint GetLOFHigh(void) const { return m_lofHi; }
469  uint GetLOFLow(void) const { return m_lofLo; }
470  bool IsPolarityInverted(void) const { return m_polInv; }
471  bool IsHighBand(const DTVMultiplex &tuning) const;
472  bool IsHorizontal(const DTVMultiplex &tuning) const;
473  uint32_t GetIntermediateFrequency(const DiSEqCDevSettings& settings,
474  const DTVMultiplex &tuning) const;
475  uint GetVoltage(const DiSEqCDevSettings &settings,
476  const DTVMultiplex &tuning) const override; // DiSEqCDevDevice
477 
478  // statics
480  { return TableToString((uint)type, kLNBTypeTable); }
481 
482  static dvbdev_lnb_t LNBTypeFromString(const QString &type)
483  { return (dvbdev_lnb_t) TableFromString(type, kLNBTypeTable); }
484 
485  private:
486  dvbdev_lnb_t m_type {kTypeVoltageAndToneControl};
487  uint m_lofSwitch {11700000};
488  uint m_lofHi {10600000};
489  uint m_lofLo { 9750000};
493  bool m_polInv {false};
494 
495  static const TypeTable kLNBTypeTable[5];
496 };
497 
498 #endif // _DISEQC_H_
uint GetUserBand(void) const
Definition: diseqc.h:401
QMutex m_treesLock
Definition: diseqc.h:70
cardid_to_diseqc_tree_t m_trees
Definition: diseqc.h:69
void SetPolarityInverted(bool inv)
Definition: diseqc.h:463
DiSEqCDevTree & m_tree
Definition: diseqc.h:202
DVB-S device settings class.
Definition: diseqc.h:35
DiSEqCDevDevice * Root(void)
Retrieves the root node in the tree.
Definition: diseqc.h:92
QString m_desc
Definition: diseqc.h:201
uint GetDeviceID(void) const
Definition: diseqc.h:164
void SetDescription(const QString &desc)
Definition: diseqc.h:157
void SetAddress(uint address)
Definition: diseqc.h:242
bool IsRealDeviceID(void) const
Definition: diseqc.h:165
void SetPIN(int pin)
Definition: diseqc.h:397
static QString SCRPositionToString(dvbdev_pos_t pos)
Definition: diseqc.h:420
uint m_devid
Definition: diseqc.h:199
virtual DiSEqCDevDevice * GetChild(uint)
Retrieves the nth child of this node.
Definition: diseqc.h:182
static QString SwitchTypeToString(dvbdev_switch_t type)
Definition: diseqc.h:263
void SetUserBand(uint userband)
Definition: diseqc.h:395
void SetLOFHigh(uint lof_hi)
Definition: diseqc.h:461
uint GetVoltage(void) const
Definition: diseqc.h:110
uint_to_dbl_t m_config
Definition: diseqc.h:46
DiSEqCDevSCR(DiSEqCDevTree &tree, uint devid)
Definition: diseqc.h:378
dbl_to_uint_t m_posmap
Definition: diseqc.h:358
uint32_t freq[4]
Definition: element.c:44
vector< DiSEqCDevDevice * > dvbdev_vec_t
Definition: diseqc.h:33
virtual bool SetChild(uint, DiSEqCDevDevice *)
Changes the nth child of this node.
Definition: diseqc.h:159
static DiSEqCDevTrees s_trees
Definition: diseqc.h:57
DiSEqCDevRotor(DiSEqCDevTree &tree, uint devid)
Definition: diseqc.h:298
void SetLOFSwitch(uint lof_switch)
Definition: diseqc.h:460
uint GetRepeatCount(void) const
Definition: diseqc.h:170
dvbdev_t GetDeviceType(void) const
Definition: diseqc.h:163
static QString DevTypeToString(dvbdev_t type)
Definition: diseqc.h:185
DiSEqCDevTree()
Definition: diseqc.h:76
static QString RotorTypeToString(dvbdev_rotor_t type)
Definition: diseqc.h:338
static bool IsFakeDiSEqCID(uint id)
Definition: diseqc.h:117
DiSEqCDevDevice(DiSEqCDevTree &tree, uint devid)
Definition: diseqc.h:136
uint GetOrdinal(void) const
Definition: diseqc.h:168
Represents a node in a DVB-S device network.
Definition: diseqc.h:133
void SetParent(DiSEqCDevDevice *parent)
Definition: diseqc.h:155
virtual DiSEqCDevDevice * GetSelectedChild(const DiSEqCDevSettings &) const
Retrieves the selected child for this configuration, if any.
Definition: diseqc.h:180
uint GetChildCount(void) const override
Retrieves the proper number of children for this node.
Definition: diseqc.h:324
void SetHiSpeed(double speed)
Definition: diseqc.h:312
int GetFD(void) const
Definition: diseqc.h:103
static dvbdev_rotor_t RotorTypeFromString(const QString &type)
Definition: diseqc.h:340
void SetLOFLow(uint lof_lo)
Definition: diseqc.h:462
static dvbdev_pos_t SCRPositionFromString(const QString &pos)
Definition: diseqc.h:423
double GetLoSpeed(void) const
Definition: diseqc.h:319
void Reset(void) override
Resets to the last known settings for this device.
Definition: diseqc.cpp:1750
vector< uint > m_delete
Definition: diseqc.h:128
uint GetLOFHigh(void) const
Definition: diseqc.h:468
void SetRepeatCount(uint repeat)
Definition: diseqc.h:158
static dvbdev_lnb_t LNBTypeFromString(const QString &type)
Definition: diseqc.h:482
Rotor class.
Definition: diseqc.h:295
double GetHiSpeed(void) const
Definition: diseqc.h:320
virtual bool IsCommandNeeded(const DiSEqCDevSettings &, const DTVMultiplex &) const
Determines if this device or any child will be sending a command for the given configuration chain.
Definition: diseqc.h:172
uint GetLOFSwitch(void) const
Definition: diseqc.h:467
unsigned int uint
Definition: compat.h:140
dvbdev_switch_t GetType(void) const
Definition: diseqc.h:247
virtual void Reset(void)
Resets to the last known settings for this device.
Definition: diseqc.h:141
uint CreateFakeDiSEqCID(void)
Definition: diseqc.h:115
QMap< uint, DiSEqCDevTree * > cardid_to_diseqc_tree_t
Definition: diseqc.h:32
uint GetLOFLow(void) const
Definition: diseqc.h:469
dvbdev_lnb_t GetType(void) const
Definition: diseqc.h:466
dvbdev_rotor_t GetType(void) const
Definition: diseqc.h:318
DiSEqCDevDevice * GetSelectedChild(const DiSEqCDevSettings &) const override
Retrieves the selected child for this configuration, if any.
Definition: diseqc.h:414
static dvbdev_switch_t SwitchTypeFromString(const QString &type)
Definition: diseqc.h:265
bool IsCommandNeeded(const DiSEqCDevSettings &, const DTVMultiplex &) const override
Determines if this device or any child will be sending a command for the given configuration chain.
Definition: diseqc.h:406
Static-scoped locked tree list class.
Definition: diseqc.h:60
DiSEqCDevLNB(DiSEqCDevTree &tree, uint devid)
Definition: diseqc.h:443
virtual uint GetChildCount(void) const
Retrieves the proper number of children for this node.
Definition: diseqc.h:171
Unicable / SCR Class.
Definition: diseqc.h:375
uint GetNumPorts(void) const
Definition: diseqc.h:249
static QString LNBTypeToString(dvbdev_lnb_t type)
Definition: diseqc.h:479
QString GetDescription(void) const
Definition: diseqc.h:169
void Close(void)
Definition: diseqc.h:102
DiSEqCDevDevice * GetParent(void) const
Definition: diseqc.h:167
void SetFrequency(uint freq)
Definition: diseqc.h:396
LNB Class.
Definition: diseqc.h:440
void SetType(dvbdev_switch_t type)
Definition: diseqc.h:241
void SetDeviceType(dvbdev_t type)
Definition: diseqc.h:154
uint GetAddress(void) const
Definition: diseqc.h:248
bool IsPolarityInverted(void) const
Definition: diseqc.h:470
void Reset(void) override
Resets to the last known settings for this device.
Definition: diseqc.cpp:2121
QMap< uint, double > uint_to_dbl_t
Definition: diseqc.h:30
void SetOrdinal(uint ordinal)
Definition: diseqc.h:156
int GetPIN(void) const
Definition: diseqc.h:403
uint GetChildCount(void) const override
Retrieves the proper number of children for this node.
Definition: diseqc.h:404
DiSEqCDevDevice * GetChild(uint) override
Retrieves the nth child of this node.
Definition: diseqc.h:334
dvbdev_vec_t m_children
Definition: diseqc.h:290
static const uint kFirstFakeDiSEqCID
Definition: diseqc.h:130
DiSEqCDevDevice * GetChild(uint) override
Retrieves the nth child of this node.
Definition: diseqc.h:416
void SetDeviceID(uint devid) const
Definition: diseqc.h:197
void SetType(dvbdev_rotor_t type)
Definition: diseqc.h:310
void SetType(dvbdev_lnb_t type)
Definition: diseqc.h:459
void AddDeferredDelete(uint dev_id)
Definition: diseqc.h:114
DVB-S device tree class.
Definition: diseqc.h:73
Switch class, including tone, legacy and DiSEqC switches.
Definition: diseqc.h:216
uint GetFrequency(void) const
Definition: diseqc.h:402
QMap< double, uint > dbl_to_uint_t
Definition: diseqc.h:31
static dvbdev_t DevTypeFromString(const QString &type)
Definition: diseqc.h:187
Main DVB-S device interface.
Definition: diseqc.h:50
void SetLoSpeed(double speed)
Definition: diseqc.h:311