4 #include "pirprotocol.h"
5 #include "pirrx51hardware.h"
8 // The SIRC protocol is Sony's system for transmitting information via
9 // infrared light. As with the very popular "NEC" protocol, binary data is
10 // encoded by varying the amount of time each bit is held: a zero is held for
11 // a short span of time, a one lasts a little bit longer.
13 // Currently, there seem to be three types of SIRC commands; 12 bit, 15 bit,
14 // and 20 bit. In each type, it appears the last seven bits specify the
15 // command, and the rest specify the device being addressed. (The bits are
16 // passed in reverse order in the actual IR stream.)
18 // The marvelous thing about the Sony Infrared Remote Control protocol is just
19 // how simple and easy it is; just a header pulse, the command, the address,
20 // and a trailer pulse. The terrible thing about the protocol is that Sony
21 // has given up on following their own rules. Sony devices today regularly
22 // support commands from a variety of addresses, making the whole concept of
23 // the "address" kind of meaningless. :( I can see why the LIRC guys would
24 // give up and just encode the raw IR bits, rather than wade into this mess...
27 class SIRCProtocol: public PIRProtocol
35 void startSendingCommand(
36 unsigned int threadableID,
40 unsigned int zeroPulse;
41 unsigned int zeroSpace;
42 unsigned int onePulse;
43 unsigned int oneSpace;
45 unsigned int headerPulse;
46 unsigned int headerSpace;
48 int generateStandardCommand(
49 const CommandSequence &bits,
50 PIRRX51Hardware &device);
53 const CommandSequence &bits,
54 PIRRX51Hardware &device);
57 #endif // SIRCPROTOCOL_H