Keyset Memory Management Bugfix
[pierogi] / protocols / nokia32protocol.h
1 #ifndef NOKIA32PROTOCOL_H
2 #define NOKIA32PROTOCOL_H
3
4 #include "spaceprotocol.h"
5
6 class PIRRX51Hardware;
7
8 //
9 // The Nokia32 protocol is a somewhat unusual 32-bit protocol.  It encodes
10 // pairs of bits rather than individual bits.
11 //
12
13 class Nokia32Protocol: public PIRProtocol
14 {
15 public:
16   Nokia32Protocol(
17     QObject *guiObject,
18     unsigned int index);
19
20 public slots:
21   void startSendingCommand(
22     unsigned int threadableID,
23     PIRKeyName command);
24
25 private:
26   int generateStandardCommand(
27     const PIRKeyBits &bits,
28     PIRRX51Hardware &device);
29
30   int pushBits(
31     const CommandSequence &bits,
32     PIRRX51Hardware &rx51device);
33
34   int pushToggleAndBits(
35     const CommandSequence &bits,
36     PIRRX51Hardware &rx51device);
37
38   int pushDoubleBit(
39     bool firstBit,
40     bool secondBit,
41     PIRRX51Hardware &rx51device);
42
43   unsigned int zeroPulse;
44   unsigned int zeroSpace;
45   unsigned int onePulse;
46   unsigned int oneSpace;
47   unsigned int twoPulse;
48   unsigned int twoSpace;
49   unsigned int threePulse;
50   unsigned int threeSpace;
51
52   unsigned int headerPulse;
53   unsigned int headerSpace;
54
55   unsigned int trailerPulse;
56
57   unsigned int keypressCount;
58 };
59
60 #endif // NOKIA32PROTOCOL_H