Advanced Settings Panel
[pierogi] / protocols / necprotocol.h
1 #ifndef NECPROTOCOL_H
2 #define NECPROTOCOL_H
3
4 #include "spaceprotocol.h"
5
6 class PIRRX51Hardware;
7
8 //
9 // The "NEC" Protocol is, more or less, followed by the majority of
10 // remotes defined in the LIRC config files, which means it is probably
11 // followed by most of the remotes out there.
12 //
13
14 //
15 // There exist two well-defined NEC protocols: "standard" and "extended".  The
16 // extended form sacrifices some redundancy to increase the size of the
17 // address data.
18 //
19 // Also, NEC has two types of repeat -- a "short repeat", sending only the
20 // header value, and a full repetition of the command pulse train.
21 //
22
23 class NECProtocol: public SpaceProtocol
24 {
25 public:
26   NECProtocol(
27     QObject *guiObject,
28     unsigned int index,
29     bool extNEC,
30     bool srtRep);
31
32 public slots:
33   void startSendingCommand(
34     unsigned int threadableID,
35     PIRKeyName command);
36
37 private:
38   unsigned int repeatPulse;
39   unsigned int repeatSpace;
40
41   bool isExtendedNEC;
42   bool isShortRepeat;
43
44   int generateStandardCommand(
45     const PIRKeyBits &bits,
46     PIRRX51Hardware &device);
47
48   int generateRepeatCommand(
49     PIRRX51Hardware &device);
50 };
51
52 #endif // NECPROTOCOL_H