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