4 #include "pirprotocol.h"
8 // The "NEC" Protocol is, more or less, followed by the majority of
9 // remotes defined in the LIRC config files, which means it is probably
10 // followed by most of the remotes out there.
12 // Remotes using this protocol seem to use a frequency of 38000 Hz, lead off
13 // each command with a signal that should be unique to the manufacturer,
14 // and mostly define 0s and 1s by the length of time between pulses...
17 class NECProtocol: public PIRProtocol
20 // An NEC protocol will always have differing times for "zero" and "one".
21 // Also, all protocols have some space set between commands. However,
22 // some protocols specify a fixed delay between the end of one
23 // command and the start of the next, and others specify each command be
24 // started at a precise interval (so the spacing between the end of one
25 // and the start of another may vary).
33 unsigned int gapSpace,
55 void setRepeatNeedsHeader(
59 void startSendingCommand(
60 unsigned int threadableID,
64 // First, define what is used to represent 0 and 1:
65 unsigned int zeroPulse;
66 unsigned int zeroSpace;
67 unsigned int onePulse;
68 unsigned int oneSpace;
70 // A tailing on-request, not followed by a specific off time:
71 unsigned int trailerPulse;
74 // Each remote key has a unique command sequence:
75 // KeyCommandMap commands;
77 // Some administrative data that most NEC Protocol remotes have:
78 unsigned int headerPulse;
79 unsigned int headerSpace;
82 // More administrative data wrapped around the actual command:
83 CommandSequence preData;
84 CommandSequence postData;
86 // A pulse that means "repeat the last command":
87 unsigned int repeatPulse;
88 unsigned int repeatSpace;
90 bool repeatNeedsHeader; // Put the header ahead of the repeat pulse
92 int generateStandardCommand(
93 const CommandSequence &bits,
96 int generateRepeatCommand(
100 const CommandSequence &bits,
104 #endif // NECPROTOCOL_H