1 #ifndef SHARPPROTOCOL_H
2 #define SHARPPROTOCOL_H
4 #include "pirprotocol.h"
5 #include "pirrx51hardware.h"
8 // Sharp has its own protocol. It is "space-encoded", like the popular NEC
9 // protocol (i.e., a 1 takes longer to transmit than a 0), but differs in
10 // several ways. Most notably, the entire command section of the pulse
11 // train is inverted for each odd-numbered repetition. Also, there is no
15 class SharpProtocol: public PIRProtocol
24 void startSendingCommand(
25 unsigned int threadableID,
29 // First, define what is used to represent 0 and 1:
30 unsigned int zeroPulse;
31 unsigned int zeroSpace;
32 unsigned int onePulse;
33 unsigned int oneSpace;
35 // A tailing on-request, not followed by a specific off time:
36 unsigned int trailerPulse;
38 // An "expansion bit". Not sure what this is, but Sharp seems to leave it
39 // at 1, and Denon usually sets it to 0.
42 int generateStandardCommand(
43 const CommandSequence &bits,
44 PIRRX51Hardware &device);
46 int generateToggledCommand(
47 const CommandSequence &bits,
48 PIRRX51Hardware &device);
51 CommandSequence::const_reverse_iterator i,
52 CommandSequence::const_reverse_iterator end,
53 PIRRX51Hardware &device);
56 CommandSequence::const_reverse_iterator i,
57 CommandSequence::const_reverse_iterator end,
58 PIRRX51Hardware &device);
61 #endif // SHARPPROTOCOL_H