Missed one file
[pierogi] / protocols / sircprotocol.h
1 #ifndef SIRCPROTOCOL_H
2 #define SIRCPROTOCOL_H
3
4 #include "spaceprotocol.h"
5
6 class PIRRX51Hardware;
7
8 //
9 // The SIRC protocol is Sony's system for transmitting information via
10 // infrared light.  As with the very popular "NEC" protocol, binary data is
11 // encoded by varying the amount of time each bit is held: a zero is held for
12 // a short span of time, a one lasts a little bit longer.
13 //
14 // Currently, there seem to be three types of SIRC commands; 12 bit, 15 bit,
15 // and 20 bit.  In each type, it appears the last seven bits specify the
16 // command, and the rest specify the device being addressed.  (The bits are
17 // passed in reverse order in the actual IR stream.)
18 //
19 // The marvelous thing about the Sony Infrared Remote Control protocol is just
20 // how simple and easy it is; just a header pulse, the command, the address,
21 // and a trailer pulse.  The terrible thing about the protocol is that Sony
22 // has given up on following their own rules.  Sony devices today regularly
23 // support commands from a variety of addresses, making the whole concept of
24 // the "address" kind of meaningless. :(  I can see why the LIRC guys would
25 // give up and just encode the raw IR bits, rather than wade into this mess...
26 //
27
28 class SIRCProtocol: public SpaceProtocol
29 {
30 public:
31   SIRCProtocol(
32     QObject *guiObject,
33     unsigned int index);
34
35 public slots:
36   void startSendingCommand(
37     unsigned int threadableID,
38     PIRKeyName command);
39
40 private:
41   int generateStandardCommand(
42     const PIRKeyBits &pkb,
43     PIRRX51Hardware &device);
44 };
45
46 #endif // SIRCPROTOCOL_H