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