vdr  1.7.31
diseqc.h
Go to the documentation of this file.
1 /*
2  * diseqc.h: DiSEqC handling
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: diseqc.h 2.5 2011/09/17 13:15:17 kls Exp $
8  */
9 
10 #ifndef __DISEQC_H
11 #define __DISEQC_H
12 
13 #include "config.h"
14 #include "thread.h"
15 
16 class cScr : public cListObject {
17 private:
18  int devices;
19  int channel;
20  uint userBand;
21  int pin;
22  bool used;
23 public:
24  cScr(void);
25  bool Parse(const char *s);
26  int Devices(void) const { return devices; }
27  int Channel(void) const { return channel; }
28  uint UserBand(void) const { return userBand; }
29  int Pin(void) const { return pin; }
30  bool Used(void) const { return used; }
31  void SetUsed(bool Used) { used = Used; }
32  };
33 
34 class cScrs : public cConfig<cScr> {
35 private:
37 public:
38  cScr *GetUnused(int Device);
39  };
40 
41 extern cScrs Scrs;
42 
43 class cDiseqc : public cListObject {
44 public:
55  };
56  enum { MaxDiseqcCodes = 6 };
57 private:
58  int devices;
59  int source;
60  int slof;
62  int lof;
63  mutable int scrBank;
64  char *commands;
65  bool parsing;
66  uint SetScrFrequency(uint SatFrequency, const cScr *Scr, uint8_t *Codes) const;
67  int SetScrPin(const cScr *Scr, uint8_t *Codes) const;
68  const char *Wait(const char *s) const;
69  const char *GetScrBank(const char *s) const;
70  const char *GetCodes(const char *s, uchar *Codes = NULL, uint8_t *MaxCodes = NULL) const;
71 public:
72  cDiseqc(void);
73  ~cDiseqc();
74  bool Parse(const char *s);
75  eDiseqcActions Execute(const char **CurrentAction, uchar *Codes, uint8_t *MaxCodes, const cScr *Scr, uint *Frequency) const;
91  int Devices(void) const { return devices; }
92  int Source(void) const { return source; }
93  int Slof(void) const { return slof; }
94  char Polarization(void) const { return polarization; }
95  int Lof(void) const { return lof; }
96  bool IsScr() const { return scrBank >= 0; }
97  const char *Commands(void) const { return commands; }
98  };
99 
100 class cDiseqcs : public cConfig<cDiseqc> {
101 public:
102  const cDiseqc *Get(int Device, int Source, int Frequency, char Polarization, const cScr **Scr) const;
110  };
111 
112 extern cDiseqcs Diseqcs;
113 
114 #endif //__DISEQC_H