Advanced Settings Panel
[pierogi] / protocols / sharpprotocol.h
1 #ifndef SHARPPROTOCOL_H
2 #define SHARPPROTOCOL_H
3
4 #include "spaceprotocol.h"
5
6 class PIRRX51Hardware;
7
8 //
9 // Sharp has its own protocol.  It is "space-encoded", like the popular NEC
10 // protocol (i.e., a 1 takes longer to transmit than a 0), but differs in
11 // several ways.  Most notably, the entire command section of the pulse
12 // train is inverted for each odd-numbered repetition.  Also, there is no
13 // header pulse.
14 //
15
16 class SharpProtocol: public SpaceProtocol
17 {
18 public:
19   SharpProtocol(
20     QObject *guiObject,
21     unsigned int index,
22     bool expBit);
23
24 public slots:
25   void startSendingCommand(
26     unsigned int threadableID,
27     PIRKeyName command);
28
29 private:
30   // An "expansion bit".  Not sure what this is, but Sharp seems to leave it
31   // at 1, and Denon usually sets it to 0.
32   bool expansionBit;
33
34   int generateStandardCommand(
35     const PIRKeyBits &pkb,
36     PIRRX51Hardware &device);
37
38   int generateToggledCommand(
39     const PIRKeyBits &pkb,
40     PIRRX51Hardware &device);
41 };
42
43 #endif // SHARPPROTOCOL_H