Possible Uninstall Fix, plus cleanup, more keysets
[pierogi] / protocols / rc5protocol.h
1 #ifndef RC5PROTOCOL_H
2 #define RC5PROTOCOL_H
3
4 #include "pirprotocol.h"
5
6 class PIRRX51Hardware;
7
8 //
9 // The RC5 protocol is not as widespread as the NEC protocol, but still
10 // somewhat popular.  Philips, the inventor, uses it extensively.
11 //
12
13 class RC5Protocol: public PIRProtocol
14 {
15 public:
16   // For standard RC5, the control portion will be passed in as
17   // a seven-bit value:
18   RC5Protocol(
19     QObject *guiObject,
20     unsigned int index,
21     unsigned int sevenBitControl);
22
23   // For extended RC5, each key must contain the entire 13 bits.
24   RC5Protocol(
25     QObject *guiObject,
26     unsigned int index);
27
28 public slots:
29   void startSendingCommand(
30     unsigned int threadableID,
31     PIRKeyName command);
32
33 protected:
34   unsigned int biphaseUnit;
35
36 private:
37   int pushControlBits(
38     PIRRX51Hardware &device);
39
40   int pushKeyCommandBits(
41     const PIRKeyBits &pkb,
42     PIRRX51Hardware &device);
43
44   int pushNonStandardRC5(
45     const PIRKeyBits &bits,
46     PIRRX51Hardware &device);
47
48   int pushBit(
49     bool bitValue,
50     PIRRX51Hardware &device);
51
52   unsigned int buffer;
53   int keypressCount;
54
55   // Only one of the following can be true, but both can be false:
56   bool bufferContainsSpace;
57   bool bufferContainsPulse;
58 };
59
60 #endif // RC5PROTOCOL_H