Improved to "half-way usable" (version 0.5)
[pierogi] / jvcprotocol.h
1 #ifndef JVCPROTOCOL_H
2 #define JVCPROTOCOL_H
3
4 #include "pirprotocol.h"
5 #include "pirrx51hardware.h"
6
7 //
8 // JVC has its own protocol, similar in some ways to the popular NEC protocol.
9 // The main differences are that the address and command segments are not
10 // sent with an inverted copy, and that repeats are implemented by sending
11 // the body without a header, rather than a header without a body.
12 //
13
14 class JVCProtocol: public PIRProtocol
15 {
16 public:
17   JVCProtocol(
18     QObject *guiObject,
19     unsigned int index);
20
21 public slots:
22   void startSendingCommand(
23     unsigned int threadableID,
24     PIRKeyName command);
25
26 private:
27   unsigned int zeroPulse;
28   unsigned int zeroSpace;
29   unsigned int onePulse;
30   unsigned int oneSpace;
31
32   unsigned int headerPulse;
33   unsigned int headerSpace;
34
35   unsigned int trailerPulse;
36
37   int generateStandardCommand(
38     const CommandSequence &bits,
39     PIRRX51Hardware &device);
40
41   int generateHeadlessCommand(
42     const CommandSequence &bits,
43     PIRRX51Hardware &device);
44
45   int pushReverseBits(
46     const CommandSequence &bits,
47     PIRRX51Hardware &device);
48 };
49
50 #endif // JVCPROTOCOL_H