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;
29 
30 typedef QMap<uint, double> uint_to_dbl_t;
31 typedef QMap<double, uint> dbl_to_uint_t;
32 typedef QMap<uint, DiSEqCDevTree*> cardid_to_diseqc_tree_t;
33 typedef vector<DiSEqCDevDevice*> dvbdev_vec_t;
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_input_id {1};
48 };
49 
50 class DiSEqCDev
51 {
52  public:
53  DiSEqCDevTree* FindTree(uint cardid);
54  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_trees_lock;
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_fd_frontend = -1; }
103  int GetFD(void) const { return m_fd_frontend; }
104 
105  // Sets
106  bool SetTone(bool on);
107  bool SetVoltage(uint voltage);
108 
109  // Gets
110  uint GetVoltage(void) const { return m_last_voltage; }
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_previous_fake_diseqcid++; }
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_fd_frontend {-1};
125  DiSEqCDevDevice *m_root {nullptr};
127  uint m_previous_fake_diseqcid {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_dev_type = 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, DiSEqCDevDevice*){return false; }
160 
161  // Gets
162  dvbdev_t GetDeviceType(void) const { return m_dev_type; }
163  uint GetDeviceID(void) const { return m_devid; }
164  bool IsRealDeviceID(void) const
165  { return !DiSEqCDevTree::IsFakeDiSEqCID(m_devid); }
166  DiSEqCDevDevice *GetParent(void) const { return m_parent; }
167  uint GetOrdinal(void) const { return m_ordinal; }
168  QString GetDescription(void) const { return m_desc; }
169  uint GetRepeatCount(void) const { return m_repeat; }
170  virtual uint GetChildCount(void) const { return 0; }
171  virtual bool IsCommandNeeded(
172  const DiSEqCDevSettings&, const DTVMultiplex&)
173  const { return false; }
174  virtual uint GetVoltage(
175  const DiSEqCDevSettings&, const DTVMultiplex&) const = 0;
176 
177  // Non-const Gets
178  DiSEqCDevDevice *FindDevice(uint dev_id);
180  const DiSEqCDevSettings&) const { return nullptr; }
181  virtual DiSEqCDevDevice *GetChild(uint) { return nullptr; }
182 
183  // Statics
184  static QString DevTypeToString(dvbdev_t type)
185  { return TableToString((uint)type, dvbdev_lookup); }
186  static dvbdev_t DevTypeFromString(const QString &type)
187  { return (dvbdev_t) TableFromString(type, dvbdev_lookup); }
188 
189  static DiSEqCDevDevice *CreateById( DiSEqCDevTree &tree,
190  uint devid);
191  static DiSEqCDevDevice *CreateByType(DiSEqCDevTree &tree,
192  dvbdev_t type,
193  uint dev_id = 0);
194 
195  protected:
196  void SetDeviceID(uint devid) const { m_devid = devid; }
197 
198  mutable uint m_devid;
199  dvbdev_t m_dev_type {kTypeLNB};
200  QString m_desc;
202  DiSEqCDevDevice *m_parent {nullptr};
203  uint m_ordinal {0};
204  uint m_repeat {1};
205 
206  typedef struct { QString name; uint value; } TypeTable;
207  static QString TableToString(uint type, const TypeTable *table);
208  static uint TableFromString(const QString &type,
209  const TypeTable *table);
210 
211  private:
212  static const TypeTable dvbdev_lookup[5];
213 };
214 
216 {
217  public:
218  DiSEqCDevSwitch(DiSEqCDevTree &tree, uint devid);
219  ~DiSEqCDevSwitch();
220 
221  // Commands
222  void Reset(void) override; // DiSEqCDevDevice
223  bool Execute(const DiSEqCDevSettings&, const DTVMultiplex&) override; // DiSEqCDevDevice
224  bool Load(void) override; // DiSEqCDevDevice
225  bool Store(void) const override; // DiSEqCDevDevice
226 
227  // Sets
229  {
230  kTypeTone = 0,
231  kTypeDiSEqCCommitted = 1,
232  kTypeDiSEqCUncommitted = 2,
233  kTypeLegacySW21 = 3,
234  kTypeLegacySW42 = 4,
235  kTypeLegacySW64 = 5,
236  kTypeVoltage = 6,
237  kTypeMiniDiSEqC = 7,
238  };
239  void SetType(dvbdev_switch_t type) { m_type = type; }
240  void SetAddress(uint address) { m_address = address; }
241  void SetNumPorts(uint num_ports);
242  bool SetChild(uint, DiSEqCDevDevice*) override; // DiSEqCDevDevice
243 
244  // Gets
245  dvbdev_switch_t GetType(void) const { return m_type; }
246  uint GetAddress(void) const { return m_address; }
247  uint GetNumPorts(void) const { return m_num_ports; }
248  bool ShouldSwitch(const DiSEqCDevSettings &settings,
249  const DTVMultiplex &tuning) const;
250  uint GetChildCount(void) const override; // DiSEqCDevDevice
251  bool IsCommandNeeded(const DiSEqCDevSettings&,
252  const DTVMultiplex&) const override; // DiSEqCDevDevice
253  uint GetVoltage(const DiSEqCDevSettings&,
254  const DTVMultiplex&) const override; // DiSEqCDevDevice
255 
256  // Non-const Gets
257  DiSEqCDevDevice *GetSelectedChild(const DiSEqCDevSettings&) const override; // DiSEqCDevDevice
258  DiSEqCDevDevice *GetChild(uint) override; // DiSEqCDevDevice
259 
260  // Statics
262  { return TableToString((uint)type, SwitchTypeTable); }
264  { return (dvbdev_switch_t) TableFromString(type, SwitchTypeTable); }
265 
266 
267  protected:
268  bool ExecuteLegacy(
269  const DiSEqCDevSettings&, const DTVMultiplex&, uint pos);
270  bool ExecuteTone(
271  const DiSEqCDevSettings&, const DTVMultiplex&, uint pos);
272  bool ExecuteVoltage(
273  const DiSEqCDevSettings&, const DTVMultiplex&, uint pos);
274  bool ExecuteMiniDiSEqC(
275  const DiSEqCDevSettings&, const DTVMultiplex&, uint pos);
276  bool ExecuteDiseqc(
277  const DiSEqCDevSettings&, const DTVMultiplex&, uint pos);
278 
279  int GetPosition( const DiSEqCDevSettings&) const;
280 
281  private:
282  dvbdev_switch_t m_type {kTypeTone};
283  uint m_address {0x10}; //DISEQC_ADR_SW_ALL
284  uint m_num_ports {2};
285  uint m_last_pos {(uint)-1};
286  uint m_last_high_band {(uint)-1};
287  uint m_last_horizontal {(uint)-1};
289 
290  static const TypeTable SwitchTypeTable[9];
291 };
292 
294 {
295  public:
297  : DiSEqCDevDevice(tree, devid) { DiSEqCDevRotor::Reset(); }
298  ~DiSEqCDevRotor();
299 
300  // Commands
301  void Reset(void) override; // DiSEqCDevDevice
302  bool Execute(const DiSEqCDevSettings&, const DTVMultiplex&) override; // DiSEqCDevDevice
303  bool Load(void) override; // DiSEqCDevDevice
304  bool Store(void) const override; // DiSEqCDevDevice
305 
306  // Sets
307  enum dvbdev_rotor_t { kTypeDiSEqC_1_2 = 0, kTypeDiSEqC_1_3 = 1, };
308  void SetType(dvbdev_rotor_t type) { m_type = type; }
309  void SetLoSpeed(double speed) { m_speed_lo = speed; }
310  void SetHiSpeed(double speed) { m_speed_hi = speed; }
311  void SetPosMap(const uint_to_dbl_t &posmap);
312  bool SetChild(uint ordinal, DiSEqCDevDevice* device) override; // DiSEqCDevDevice
313  void RotationComplete(void) const;
314 
315  // Gets
316  dvbdev_rotor_t GetType(void) const { return m_type; }
317  double GetLoSpeed(void) const { return m_speed_lo; }
318  double GetHiSpeed(void) const { return m_speed_hi; }
319  uint_to_dbl_t GetPosMap(void) const;
320  double GetProgress(void) const;
321  bool IsPositionKnown(void) const;
322  uint GetChildCount(void) const override // DiSEqCDevDevice
323  { return 1; }
324  bool IsCommandNeeded(const DiSEqCDevSettings&,
325  const DTVMultiplex&) const override; // DiSEqCDevDevice
326  bool IsMoving(const DiSEqCDevSettings&) const;
327  uint GetVoltage(const DiSEqCDevSettings&,
328  const DTVMultiplex&) const override; // DiSEqCDevDevice
329 
330  // Non-const Gets
331  DiSEqCDevDevice *GetSelectedChild(const DiSEqCDevSettings&) const override; // DiSEqCDevDevice
332  DiSEqCDevDevice *GetChild(uint) override // DiSEqCDevDevice
333  { return m_child; }
334 
335  // Statics
337  { return TableToString((uint)type, RotorTypeTable); }
338  static dvbdev_rotor_t RotorTypeFromString(const QString &type)
339  { return (dvbdev_rotor_t) TableFromString(type, RotorTypeTable); }
340 
341  protected:
342  bool ExecuteRotor(const DiSEqCDevSettings&, const DTVMultiplex&,
343  double angle);
344  bool ExecuteUSALS(const DiSEqCDevSettings&, const DTVMultiplex&,
345  double angle);
346  void StartRotorPositionTracking(double azimuth);
347 
348  double CalculateAzimuth(double angle) const;
349  double GetApproxAzimuth(void) const;
350 
351  private:
352  // configuration
353  dvbdev_rotor_t m_type {kTypeDiSEqC_1_3};
354  double m_speed_hi {2.5};
355  double m_speed_lo {1.9};
357  DiSEqCDevDevice *m_child {nullptr};
358 
359  // state
360  double m_last_position {0.0};
361  double m_desired_azimuth {0.0};
362  bool m_reset {true};
363 
364  // rotor position tracking state
365  mutable double m_move_time {0.0};
366  mutable bool m_last_pos_known {false};
367  mutable double m_last_azimuth {0.0};
368 
369  // statics
370  static const TypeTable RotorTypeTable[3];
371 };
372 
374 {
375  public:
377  : DiSEqCDevDevice(tree, devid) { DiSEqCDevSCR::Reset(); }
378  ~DiSEqCDevSCR();
379 
380  // Commands
381  void Reset(void) override; // DiSEqCDevDevice
382  bool Execute(const DiSEqCDevSettings&, const DTVMultiplex&) override; // DiSEqCDevDevice
383  bool PowerOff(void) const;
384  bool Load(void) override; // DiSEqCDevDevice
385  bool Store(void) const override; // DiSEqCDevDevice
386 
387  // Sets
389  {
390  kTypeScrPosA = 0,
391  kTypeScrPosB = 1,
392  };
393  void SetUserBand(uint userband) { m_scr_userband = userband; }
394  void SetFrequency(uint freq) { m_scr_frequency = freq; }
395  void SetPIN(int pin) { m_scr_pin = pin; }
396  bool SetChild(uint ordinal, DiSEqCDevDevice* device) override; // DiSEqCDevDevice
397 
398  // Gets
399  uint GetUserBand(void) const { return m_scr_userband; }
400  uint GetFrequency(void) const { return m_scr_frequency; }
401  int GetPIN(void) const { return m_scr_pin; }
402  uint GetChildCount(void) const override // DiSEqCDevDevice
403  { return 1; }
405  const DTVMultiplex&) const override // DiSEqCDevDevice
406  { return false; }
407  uint GetVoltage(const DiSEqCDevSettings&,
408  const DTVMultiplex&) const override; // DiSEqCDevDevice
409  uint32_t GetIntermediateFrequency(const uint32_t frequency) const;
410 
411  // Non-const Gets
412  DiSEqCDevDevice *GetSelectedChild(const DiSEqCDevSettings&) const override // DiSEqCDevDevice
413  { return m_child; }
414  DiSEqCDevDevice *GetChild(uint) override // DiSEqCDevDevice
415  { return m_child; }
416 
417  // statics
418  static QString SCRPositionToString(dvbdev_pos_t pos)
419  { return TableToString((uint)pos, SCRPositionTable); }
420 
421  static dvbdev_pos_t SCRPositionFromString(const QString &pos)
422  { return (dvbdev_pos_t) TableFromString(pos, SCRPositionTable); }
423 
424  protected:
425  bool SendCommand(uint cmd, uint repeats, uint data_len = 0,
426  unsigned char *data = nullptr) const;
427 
428  private:
429  uint m_scr_userband {0}; /* 0-7 */
430  uint m_scr_frequency {1400};
431  int m_scr_pin {-1}; /* 0-255, -1=disabled */
432 
433  DiSEqCDevDevice *m_child {nullptr};
434 
435  static const TypeTable SCRPositionTable[3];
436 };
437 
439 {
440  public:
442  : DiSEqCDevDevice(tree, devid) { DiSEqCDevLNB::Reset(); }
443 
444  // Commands
445  bool Execute(const DiSEqCDevSettings&, const DTVMultiplex&) override; // DiSEqCDevDevice
446  bool Load(void) override; // DiSEqCDevDevice
447  bool Store(void) const override; // DiSEqCDevDevice
448 
449  // Sets
451  {
452  kTypeFixed = 0,
453  kTypeVoltageControl = 1,
454  kTypeVoltageAndToneControl = 2,
455  kTypeBandstacked = 3,
456  };
457  void SetType(dvbdev_lnb_t type) { m_type = type; }
458  void SetLOFSwitch(uint lof_switch) { m_lof_switch = lof_switch; }
459  void SetLOFHigh( uint lof_hi) { m_lof_hi = lof_hi; }
460  void SetLOFLow( uint lof_lo) { m_lof_lo = lof_lo; }
461  void SetPolarityInverted(bool inv) { m_pol_inv = inv; }
462 
463  // Gets
464  dvbdev_lnb_t GetType(void) const { return m_type; }
465  uint GetLOFSwitch(void) const { return m_lof_switch; }
466  uint GetLOFHigh(void) const { return m_lof_hi; }
467  uint GetLOFLow(void) const { return m_lof_lo; }
468  bool IsPolarityInverted(void) const { return m_pol_inv; }
469  bool IsHighBand(const DTVMultiplex&) const;
470  bool IsHorizontal(const DTVMultiplex&) const;
471  uint32_t GetIntermediateFrequency(const DiSEqCDevSettings& settings,
472  const DTVMultiplex &tuning) const;
473  uint GetVoltage(const DiSEqCDevSettings&,
474  const DTVMultiplex&) const override; // DiSEqCDevDevice
475 
476  // statics
478  { return TableToString((uint)type, LNBTypeTable); }
479 
480  static dvbdev_lnb_t LNBTypeFromString(const QString &type)
481  { return (dvbdev_lnb_t) TableFromString(type, LNBTypeTable); }
482 
483  private:
484  dvbdev_lnb_t m_type {kTypeVoltageAndToneControl};
485  uint m_lof_switch {11700000};
486  uint m_lof_hi {10600000};
487  uint m_lof_lo { 9750000};
491  bool m_pol_inv {false};
492 
493  static const TypeTable LNBTypeTable[5];
494 };
495 
496 #endif // _DISEQC_H_
uint GetUserBand(void) const
Definition: diseqc.h:399
QMutex m_trees_lock
Definition: diseqc.h:70
cardid_to_diseqc_tree_t m_trees
Definition: diseqc.h:69
void SetPolarityInverted(bool inv)
Definition: diseqc.h:461
DiSEqCDevTree & m_tree
Definition: diseqc.h:201
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:200
uint GetDeviceID(void) const
Definition: diseqc.h:163
void SetDescription(const QString &desc)
Definition: diseqc.h:157
QMap< double, uint > dbl_to_uint_t
Definition: diseqc.h:31
void SetAddress(uint address)
Definition: diseqc.h:240
bool IsRealDeviceID(void) const
Definition: diseqc.h:164
void SetPIN(int pin)
Definition: diseqc.h:395
static QString SCRPositionToString(dvbdev_pos_t pos)
Definition: diseqc.h:418
uint m_devid
Definition: diseqc.h:198
virtual DiSEqCDevDevice * GetChild(uint)
Retrieves the nth child of this node.
Definition: diseqc.h:181
static QString SwitchTypeToString(dvbdev_switch_t type)
Definition: diseqc.h:261
void SetUserBand(uint userband)
Definition: diseqc.h:393
void SetLOFHigh(uint lof_hi)
Definition: diseqc.h:459
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:376
dbl_to_uint_t m_posmap
Definition: diseqc.h:356
unsigned int uint
Definition: compat.h:140
uint32_t freq[4]
Definition: element.c:44
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:296
void SetLOFSwitch(uint lof_switch)
Definition: diseqc.h:458
uint GetRepeatCount(void) const
Definition: diseqc.h:169
dvbdev_t GetDeviceType(void) const
Definition: diseqc.h:162
static QString DevTypeToString(dvbdev_t type)
Definition: diseqc.h:184
DiSEqCDevTree()
Definition: diseqc.h:76
static QString RotorTypeToString(dvbdev_rotor_t type)
Definition: diseqc.h:336
static bool IsFakeDiSEqCID(uint id)
Definition: diseqc.h:117
vector< DiSEqCDevDevice * > dvbdev_vec_t
Definition: diseqc.h:33
DiSEqCDevDevice(DiSEqCDevTree &tree, uint devid)
Definition: diseqc.h:136
uint GetOrdinal(void) const
Definition: diseqc.h:167
Represents a node in a DVB-S device network.
Definition: diseqc.h:133
QMap< uint, double > uint_to_dbl_t
Definition: diseqc.h:28
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:179
uint GetChildCount(void) const override
Retrieves the proper number of children for this node.
Definition: diseqc.h:322
void SetHiSpeed(double speed)
Definition: diseqc.h:310
int GetFD(void) const
Definition: diseqc.h:103
static dvbdev_rotor_t RotorTypeFromString(const QString &type)
Definition: diseqc.h:338
void SetLOFLow(uint lof_lo)
Definition: diseqc.h:460
static dvbdev_pos_t SCRPositionFromString(const QString &pos)
Definition: diseqc.h:421
double GetLoSpeed(void) const
Definition: diseqc.h:317
void Reset(void) override
Resets to the last known settings for this device.
Definition: diseqc.cpp:1757
vector< uint > m_delete
Definition: diseqc.h:128
uint GetLOFHigh(void) const
Definition: diseqc.h:466
void SetRepeatCount(uint repeat)
Definition: diseqc.h:158
static dvbdev_lnb_t LNBTypeFromString(const QString &type)
Definition: diseqc.h:480
Rotor class.
Definition: diseqc.h:293
double GetHiSpeed(void) const
Definition: diseqc.h:318
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:171
uint GetLOFSwitch(void) const
Definition: diseqc.h:465
const char * name
Definition: ParseText.cpp:328
dvbdev_switch_t GetType(void) const
Definition: diseqc.h:245
virtual void Reset(void)
Resets to the last known settings for this device.
Definition: diseqc.h:141
uint CreateFakeDiSEqCID(void)
Definition: diseqc.h:115
uint GetLOFLow(void) const
Definition: diseqc.h:467
dvbdev_lnb_t GetType(void) const
Definition: diseqc.h:464
dvbdev_rotor_t GetType(void) const
Definition: diseqc.h:316
DiSEqCDevDevice * GetSelectedChild(const DiSEqCDevSettings &) const override
Retrieves the selected child for this configuration, if any.
Definition: diseqc.h:412
static dvbdev_switch_t SwitchTypeFromString(const QString &type)
Definition: diseqc.h:263
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:404
Static-scoped locked tree list class.
Definition: diseqc.h:60
DiSEqCDevLNB(DiSEqCDevTree &tree, uint devid)
Definition: diseqc.h:441
virtual uint GetChildCount(void) const
Retrieves the proper number of children for this node.
Definition: diseqc.h:170
Unicable / SCR Class.
Definition: diseqc.h:373
uint GetNumPorts(void) const
Definition: diseqc.h:247
static QString LNBTypeToString(dvbdev_lnb_t type)
Definition: diseqc.h:477
QString GetDescription(void) const
Definition: diseqc.h:168
void Close(void)
Definition: diseqc.h:102
DiSEqCDevDevice * GetParent(void) const
Definition: diseqc.h:166
void SetFrequency(uint freq)
Definition: diseqc.h:394
LNB Class.
Definition: diseqc.h:438
void SetType(dvbdev_switch_t type)
Definition: diseqc.h:239
void SetDeviceType(dvbdev_t type)
Definition: diseqc.h:154
uint GetAddress(void) const
Definition: diseqc.h:246
bool IsPolarityInverted(void) const
Definition: diseqc.h:468
void Reset(void) override
Resets to the last known settings for this device.
Definition: diseqc.cpp:2129
QMap< uint, DiSEqCDevTree * > cardid_to_diseqc_tree_t
Definition: diseqc.h:32
void SetOrdinal(uint ordinal)
Definition: diseqc.h:156
int GetPIN(void) const
Definition: diseqc.h:401
uint GetChildCount(void) const override
Retrieves the proper number of children for this node.
Definition: diseqc.h:402
DiSEqCDevDevice * GetChild(uint) override
Retrieves the nth child of this node.
Definition: diseqc.h:332
dvbdev_vec_t m_children
Definition: diseqc.h:288
static const uint kFirstFakeDiSEqCID
Definition: diseqc.h:130
DiSEqCDevDevice * GetChild(uint) override
Retrieves the nth child of this node.
Definition: diseqc.h:414
uint m_last_voltage
Definition: diseqc.h:126
void SetDeviceID(uint devid) const
Definition: diseqc.h:196
void SetType(dvbdev_rotor_t type)
Definition: diseqc.h:308
void SetType(dvbdev_lnb_t type)
Definition: diseqc.h:457
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:215
uint GetFrequency(void) const
Definition: diseqc.h:400
static dvbdev_t DevTypeFromString(const QString &type)
Definition: diseqc.h:186
Main DVB-S device interface.
Definition: diseqc.h:50
void SetLoSpeed(double speed)
Definition: diseqc.h:309