IRremote
ir_NEC.hpp
Go to the documentation of this file.
1 /*
2  * ir_NEC.hpp
3  *
4  * Contains functions for receiving and sending NEC IR Protocol in "raw" and standard format with 16 or 8 bit address and 8 bit command
5  *
6  * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
7  *
8  ************************************************************************************
9  * MIT License
10  *
11  * Copyright (c) 2020-2023 Armin Joachimsmeyer
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a copy
14  * of this software and associated documentation files (the "Software"), to deal
15  * in the Software without restriction, including without limitation the rights
16  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17  * copies of the Software, and to permit persons to whom the Software is furnished
18  * to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included in all
21  * copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
24  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
25  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
27  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
28  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29  *
30  ************************************************************************************
31  */
32 #ifndef _IR_NEC_HPP
33 #define _IR_NEC_HPP
34 
35 #if defined(DEBUG) && !defined(LOCAL_DEBUG)
36 #define LOCAL_DEBUG // IR_DEBUG_PRINT is a real print function here. Add local debug output.
37 #else
38 //#define LOCAL_DEBUG // This enables debug output only for this file. IR_DEBUG_PRINT is still a void function here.
39 #endif
40 
44 //==============================================================================
45 // N N EEEEE CCCC
46 // NN N E C
47 // N N N EEE C
48 // N NN E C
49 // N N EEEEE CCCC
50 //==============================================================================
51 /*
52  Protocol=NEC Address=0x4 Command=0x8 Raw-Data=0xF708FB04 32 bits LSB first
53  +8950,-4450
54  + 600,- 500 + 650,- 500 + 600,-1650 + 600,- 550
55  + 600,- 500 + 600,- 500 + 650,- 500 + 600,- 500
56  + 650,-1650 + 600,-1600 + 650,- 500 + 600,-1650
57  + 600,-1650 + 600,-1650 + 600,-1600 + 650,-1600
58  + 650,- 500 + 600,- 550 + 600,- 500 + 600,-1650
59  + 600,- 550 + 600,- 500 + 600,- 550 + 600,- 500
60  + 600,-1650 + 600,-1650 + 600,-1650 + 600,- 550
61  + 600,-1650 + 600,-1650 + 600,-1650 + 600,-1600
62  + 650
63  Sum: 68000
64 
65  Protocol=NEC Address=0x8 Command=0x7 Repeat gap=40900us
66  rawData[4]:
67  -40900
68  +10450,-2250
69  + 700
70  Sum: 13400
71  */
72 // http://www.hifi-remote.com/wiki/index.php/NEC
73 // https://www.sbprojects.net/knowledge/ir/nec.php
74 // NEC: LSB first, <start bit><address:16> (or <address:8><inverted address:8>) <command:16><command:8><inverted command:8><stop bit>.
75 // ONKYO: like NEC but force to 16 independent address and 16 bit command bits: <start bit><address:16><command:16><stop bit>
76 // Standard NEC sends a special fixed repeat frame.
77 // NEC2: like NEC, but for repeat, the same full frame is sent after the 110 ms. I have a DVD remote with NEC2.
78 // NEC and NEC 2 only differ in the repeat frames, so the protocol can only be detected correctly after the first repeat.
79 // PIONEER (not implemented) is NEC2 with 40 kHz
80 //
81 // For Apple see https://en.wikipedia.org/wiki/Apple_Remote - <start bit><0x87EE:16><device ID:8><command:7><parity><stop bit> - not implemented!
82 // The parity is not implemented, so we get: <start bit><0x87EE:16><device ID:8><command:8><stop bit>
83 //
84 // IRP notation:
85 // IRP: NEC {38.0k,564}<1,-1|1,-3>(16,-8,D:8,S:8,F:8,~F:8,1,^108m,(16,-4,1,^108m)*) ==> "*" means send special repeat frames o ore more times
86 // IRP: NEC2 {38.0k,564}<1,-1|1,-3>(16,-8,D:8,S:8,F:8,~F:8,1,^108m)+ ==> "+" means send frame 1 or more times (special repeat is missing here!)
87 // Interpretation of IRP notation:
88 // {38.0k,564} ==> 38.0k -> Frequency , 564 -> unit in microseconds (we use 560), no "msb", so "lsb" is assumed
89 // <1,-1|1,-3> ==> Zero is 1 unit mark and space | One is 1 unit mark and 3 units space
90 // 16,-8 ==> Start bit durations
91 // D:8,S:8,F:8,~F:8 ==> D:8 -> 8 bit bitfield for Device, S:8 -> 8 bit bitfield for Subdevice, F:8 -> 8 bit bitfield for Function, ~F:8 -> 8 bit inverted bitfield for Function
92 // 1,^108m ==> 1 -> unit mark Stop bit, ^108m -> wait until 108 milliseconds after start of protocol (we use 110)
93 //
94 #define NEC_ADDRESS_BITS 16 // 16 bit address or 8 bit address and 8 bit inverted address
95 #define NEC_COMMAND_BITS 16 // Command and inverted command
96 
97 #define NEC_BITS (NEC_ADDRESS_BITS + NEC_COMMAND_BITS)
98 #define NEC_UNIT 560 // 21.28 periods of 38 kHz, 11.2 ticks TICKS_LOW = 8.358 TICKS_HIGH = 15.0
99 
100 #define NEC_HEADER_MARK (16 * NEC_UNIT) // 9000 | 180
101 #define NEC_HEADER_SPACE (8 * NEC_UNIT) // 4500 | 90
102 
103 #define NEC_BIT_MARK NEC_UNIT
104 #define NEC_ONE_SPACE (3 * NEC_UNIT) // 1690 | 33.8 TICKS_LOW = 25.07 TICKS_HIGH = 45.0
105 #define NEC_ZERO_SPACE NEC_UNIT
106 
107 #define NEC_REPEAT_HEADER_SPACE (4 * NEC_UNIT) // 2250
108 
109 #define NEC_AVERAGE_DURATION 62000 // NEC_HEADER_MARK + NEC_HEADER_SPACE + 32 * 2,5 * NEC_UNIT + NEC_UNIT // 2.5 because we assume more zeros than ones
110 #define NEC_MINIMAL_DURATION 49900 // NEC_HEADER_MARK + NEC_HEADER_SPACE + 32 * 2 * NEC_UNIT + NEC_UNIT // 2.5 because we assume more zeros than ones
111 #define NEC_REPEAT_DURATION (NEC_HEADER_MARK + NEC_REPEAT_HEADER_SPACE + NEC_BIT_MARK) // 12 ms
112 #define NEC_REPEAT_PERIOD 110000 // Commands are repeated every 110 ms (measured from start to start) for as long as the key on the remote control is held down.
113 #define NEC_REPEAT_DISTANCE (NEC_REPEAT_PERIOD - NEC_AVERAGE_DURATION) // 48 ms
114 #define NEC_MAXIMUM_REPEAT_DISTANCE (NEC_REPEAT_PERIOD - NEC_MINIMAL_DURATION + 10000) // 70 ms
115 
116 #define APPLE_ADDRESS 0x87EE
117 
122 
123 // Like NEC but repeats are full frames instead of special NEC repeats
126 
127 /************************************
128  * Start of send and decode functions
129  ************************************/
130 
136  enableIROut (NEC_KHZ); // 38 kHz
137  mark(NEC_HEADER_MARK); // + 9000
138  space(NEC_REPEAT_HEADER_SPACE); // - 2250
139  mark(NEC_BIT_MARK); // + 560
140 }
141 
147  IrSender.enableIROut(NEC_KHZ); // 38 kHz
148  IrSender.mark(NEC_HEADER_MARK); // + 9000
150  IrSender.mark(NEC_BIT_MARK); // + 560
151 }
152 
160 uint32_t IRsend::computeNECRawDataAndChecksum(uint16_t aAddress, uint16_t aCommand) {
161  LongUnion tRawData;
162 
163  // Address 16 bit LSB first
164  if ((aAddress & 0xFF00) == 0) {
165  // assume 8 bit address -> send 8 address bits and then 8 inverted address bits LSB first
166  tRawData.UByte.LowByte = aAddress;
167  tRawData.UByte.MidLowByte = ~tRawData.UByte.LowByte;
168  } else {
169  tRawData.UWord.LowWord = aAddress;
170  }
171 
172  // send 8 command bits and then 8 inverted command bits LSB first
173  tRawData.UByte.MidHighByte = aCommand;
174  tRawData.UByte.HighByte = ~aCommand;
175  return tRawData.ULong;
176 }
177 
183 void IRsend::sendNEC(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
185 }
186 
192 void IRsend::sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
194 }
195 
201 void IRsend::sendNEC2(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
203 }
204 
213 void IRsend::sendApple(uint8_t aDeviceId, uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
214  LongUnion tRawData;
215 
216  // Address 16 bit LSB first fixed value of 0x87EE
217  tRawData.UWord.LowWord = APPLE_ADDRESS;
218 
219  // send Apple code and then 8 command bits LSB first
220  tRawData.UByte.MidHighByte = aCommand;
221  tRawData.UByte.HighByte = aDeviceId; // e.g. 0xD7
222 
224 }
225 
231 void IRsend::sendNECRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats) {
233 }
234 
239  /*
240  * First check for right data length
241  * Next check start bit
242  * Next try the decode
243  */
244  // Check we have the right amount of data (68). The +4 is for initial gap, start bit mark and space + stop bit mark.
245  if (decodedIRData.rawlen != ((2 * NEC_BITS) + 4) && (decodedIRData.rawlen != 4)) {
246  IR_DEBUG_PRINT(F("NEC: "));
247  IR_DEBUG_PRINT(F("Data length="));
249  IR_DEBUG_PRINTLN(F(" is not 68 or 4"));
250  return false;
251  }
252 
253  // Check header "mark" this must be done for repeat and data
255  return false;
256  }
257 
258  // Check for repeat - here we have another header space length
259  if (decodedIRData.rawlen == 4) {
266  return true;
267  }
268  return false;
269  }
270 
271  // Check command header space
273 #if defined(LOCAL_DEBUG)
274  Serial.print(F("NEC: "));
275  Serial.println(F("Header space length is wrong"));
276 #endif
277  return false;
278  }
279 
280  // Try to decode as NEC protocol
282 #if defined(LOCAL_DEBUG)
283  Serial.print(F("NEC: "));
284  Serial.println(F("Decode failed"));
285 #endif
286  return false;
287  }
288 
289  // Success
290 // decodedIRData.flags = IRDATA_FLAGS_IS_LSB_FIRST; // Not required, since this is the start value
291  LongUnion tValue;
293  decodedIRData.command = tValue.UByte.MidHighByte; // 8 bit
294 
295 #if defined(DECODE_ONKYO)
296  // Here only Onkyo protocol is supported -> force 16 bit address and command decoding
297  decodedIRData.address = tValue.UWord.LowWord; // first 16 bit
299  decodedIRData.command = tValue.UWord.HighWord; // 16 bit command
300 #else
301  // Address
302  if (tValue.UWord.LowWord == APPLE_ADDRESS) {
303  /*
304  * Apple
305  */
308 
309  } else {
310  /*
311  * NEC LSB first, so first sent bit is also LSB of decodedIRData.decodedRawData
312  */
313  if (tValue.UByte.LowByte == (uint8_t)(~tValue.UByte.MidLowByte)) {
314  // standard 8 bit address NEC protocol
315  decodedIRData.address = tValue.UByte.LowByte; // first 8 bit
316  } else {
317  // extended NEC protocol
318  decodedIRData.address = tValue.UWord.LowWord; // first 16 bit
319  }
320  // Check for command if it is 8 bit NEC or 16 bit ONKYO
321  if (tValue.UByte.MidHighByte == (uint8_t)(~tValue.UByte.HighByte)) {
323  } else {
325  decodedIRData.command = tValue.UWord.HighWord; // 16 bit command
326  }
327  }
328 #endif
329 
331 
332  // check for NEC2 repeat, do not check for same content ;-)
337  }
338  return true;
339 }
340 
341 /*********************************************************************************
342  * Old deprecated functions, kept for backward compatibility to old 2.0 tutorials
343  *********************************************************************************/
344 
346  unsigned int offset = 1; // Index in to results; Skip first space.
347 
348 // Check header "mark"
349  if (!matchMark(aResults->rawbuf[offset], NEC_HEADER_MARK)) {
350  return false;
351  }
352  offset++;
353 
354 // Check for repeat
355  if ((aResults->rawlen == 4) && matchSpace(aResults->rawbuf[offset], NEC_REPEAT_HEADER_SPACE)
356  && matchMark(aResults->rawbuf[offset + 1], NEC_BIT_MARK)) {
357  aResults->bits = 0;
358  aResults->value = 0xFFFFFFFF;
361  return true;
362  }
363 
364  // Check we have the right amount of data (32). +4 for initial gap, start bit mark and space + stop bit mark
365  if (aResults->rawlen != (2 * NEC_BITS) + 4) {
366  IR_DEBUG_PRINT(F("NEC MSB: "));
367  IR_DEBUG_PRINT(F("Data length="));
368  IR_DEBUG_PRINT(aResults->rawlen);
369  IR_DEBUG_PRINTLN(F(" is not 68"));
370  return false;
371  }
372 
373 // Check header "space"
374  if (!matchSpace(aResults->rawbuf[offset], NEC_HEADER_SPACE)) {
375 #if defined(LOCAL_DEBUG)
376  Serial.print(F("NEC MSB: "));
377  Serial.println(F("Header space length is wrong"));
378 #endif
379  return false;
380  }
381  offset++;
382 
384 #if defined(LOCAL_DEBUG)
385  Serial.print(F("NEC MSB: "));
386  Serial.println(F("Decode failed"));
387 #endif
388  return false;
389  }
390 
391  // Stop bit
392  if (!matchMark(aResults->rawbuf[offset + (2 * NEC_BITS)], NEC_BIT_MARK)) {
393 #if defined(LOCAL_DEBUG)
394  Serial.print(F("NEC MSB: "));
395  Serial.println(F("Stop bit mark length is wrong"));
396 #endif
397  return false;
398  }
399 
400 // Success
401  aResults->value = decodedIRData.decodedRawData;
402  aResults->bits = NEC_BITS;
403  aResults->decode_type = NEC;
405 
406  return true;
407 }
408 
420 void IRsend::sendNECMSB(uint32_t data, uint8_t nbits, bool repeat) {
421  // Set IR carrier frequency
423 
424  if (data == 0xFFFFFFFF || repeat) {
425  sendNECRepeat();
426  return;
427  }
428 
429  // Header
432 
433  // Old version with MSB first Data + stop bit
435 }
436 
438 #if defined(LOCAL_DEBUG)
439 #undef LOCAL_DEBUG
440 #endif
441 #endif // _IR_NEC_HPP
IRData::address
uint16_t address
Decoded address, Distance protocol (tMarkTicksLong (if tMarkTicksLong == 0, then tMarkTicksShort) << ...
Definition: IRProtocol.h:110
MICROS_PER_TICK
#define MICROS_PER_TICK
microseconds per clock interrupt tick
Definition: IRremote.hpp:250
NEC_BITS
#define NEC_BITS
Definition: ir_NEC.hpp:97
LongUnion
Union to specify parts / manifestations of a 32 bit Long without casts and shifts.
Definition: LongUnion.h:59
decode_results
Results returned from old decoders !!!deprecated!!!
Definition: IRremoteInt.h:183
ONKYO
@ ONKYO
Definition: IRProtocol.h:51
decode_results::rawbuf
uint16_t * rawbuf
Definition: IRremoteInt.h:194
IRsend::sendApple
void sendApple(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Apple: Send NEC with fixed 16 bit Apple address 0x87EE.
Definition: ir_NEC.hpp:213
PROTOCOL_IS_MSB_FIRST
#define PROTOCOL_IS_MSB_FIRST
Definition: IRProtocol.h:147
IRsend::sendNECRaw
void sendNECRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Sends NEC protocol.
Definition: ir_NEC.hpp:231
IRrecv::lastDecodedProtocol
decode_type_t lastDecodedProtocol
Definition: IRremoteInt.h:361
IRData::numberOfBits
uint16_t numberOfBits
Number of bits received for data (address + command + parity) - to determine protocol length if diffe...
Definition: IRProtocol.h:119
IRsend::aNumberOfRepeats
void int_fast8_t aNumberOfRepeats
Definition: IRremoteInt.h:547
MICROS_IN_ONE_MILLI
#define MICROS_IN_ONE_MILLI
Definition: IRremote.hpp:255
LongUnion::UByte
struct LongUnion::@4 UByte
NEC2ProtocolConstants
struct PulseDistanceWidthProtocolConstants NEC2ProtocolConstants
Definition: ir_NEC.hpp:124
NEC_BIT_MARK
#define NEC_BIT_MARK
Definition: ir_NEC.hpp:103
IRsend::mark
void mark(uint16_t aMarkMicros)
Sends an IR mark for the specified number of microseconds.
Definition: IRSend.hpp:947
IRDATA_FLAGS_IS_REPEAT
#define IRDATA_FLAGS_IS_REPEAT
The gap between the preceding frame is as smaller than the maximum gap expected for a repeat....
Definition: IRProtocol.h:92
IRsend::sendPulseDistanceWidth
void sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
Sends PulseDistance frames and repeats.
Definition: IRSend.hpp:691
LongUnion::LowByte
uint8_t LowByte
Definition: LongUnion.h:61
LongUnion::HighByte
uint8_t HighByte
Definition: LongUnion.h:64
IRData::rawDataPtr
irparams_struct * rawDataPtr
Pointer of the raw timing data to be decoded. Mainly the OverflowFlag and the data buffer filled by r...
Definition: IRProtocol.h:131
decode_results::bits
uint8_t bits
Definition: IRremoteInt.h:189
decode_results::decode_type
decode_type_t decode_type
Definition: IRremoteInt.h:186
IRData::decodedRawData
IRRawDataType decodedRawData
Up to 32/64 bit decoded raw data, to be used for send functions.
Definition: IRProtocol.h:113
IRrecv::checkForRepeatSpaceTicksAndSetFlag
void checkForRepeatSpaceTicksAndSetFlag(uint16_t aMaximumRepeatSpaceTicks)
Definition: IRReceive.hpp:1150
IR_DEBUG_PRINT
#define IR_DEBUG_PRINT(...)
If DEBUG, print the arguments, otherwise do nothing.
Definition: IRremoteInt.h:161
LongUnion::LowWord
uint16_t LowWord
Definition: LongUnion.h:80
matchSpace
bool matchSpace(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
Definition: IRReceive.hpp:1227
NEC2
@ NEC2
Definition: IRProtocol.h:50
decode_results::value
uint32_t value
Definition: IRremoteInt.h:188
LongUnion::MidLowByte
uint8_t MidLowByte
Definition: LongUnion.h:62
PulseDistanceWidthProtocolConstants
Definition: IRProtocol.h:134
LongUnion::HighWord
uint16_t HighWord
Definition: LongUnion.h:81
NEC_ONE_SPACE
#define NEC_ONE_SPACE
Definition: ir_NEC.hpp:104
IRrecv::decodedIRData
IRData decodedIRData
Definition: IRremoteInt.h:358
IRData::flags
uint8_t flags
IRDATA_FLAGS_IS_REPEAT, IRDATA_FLAGS_WAS_OVERFLOW etc. See IRDATA_FLAGS_* definitions above.
Definition: IRProtocol.h:120
PROTOCOL_IS_LSB_FIRST
#define PROTOCOL_IS_LSB_FIRST
Definition: IRProtocol.h:148
IRDATA_FLAGS_IS_PROTOCOL_WITH_DIFFERENT_REPEAT
#define IRDATA_FLAGS_IS_PROTOCOL_WITH_DIFFERENT_REPEAT
Here we have a repeat of type NEC2 or SamsungLG.
Definition: IRProtocol.h:98
IRrecv::decodePulseDistanceWidthData
bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset=3)
Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.
Definition: IRReceive.hpp:954
IRsend::sendNECMSB
void sendNECMSB(uint32_t data, uint8_t nbits, bool repeat=false)
With Send sendNECMSB() you can send your old 32 bit codes.
Definition: ir_NEC.hpp:420
IRsend::sendNEC
void sendNEC(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
NEC Send frame and special repeats There is NO delay after the last sent repeat!
Definition: ir_NEC.hpp:183
IRData::command
uint16_t command
Decoded command, Distance protocol (tMarkTicksShort << 8) | tSpaceTicksShort.
Definition: IRProtocol.h:111
NEC
@ NEC
Definition: IRProtocol.h:49
APPLE
@ APPLE
Definition: IRProtocol.h:44
matchMark
bool matchMark(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for marks exceeded by demodulator hardware.
Definition: IRReceive.hpp:1193
NEC_KHZ
#define NEC_KHZ
Definition: IRProtocol.h:161
irparams_struct::rawbuf
IRRawbufType rawbuf[RAW_BUFFER_LENGTH]
raw data / tick counts per mark/space. With 8 bit we can only store up to 12.7 ms....
Definition: IRremoteInt.h:144
IRsend::computeNECRawDataAndChecksum
uint32_t computeNECRawDataAndChecksum(uint16_t aAddress, uint16_t aCommand)
Convert 16 bit address and 16 bit command to 32 bit NECRaw data If we get a command < 0x100,...
Definition: ir_NEC.hpp:160
LongUnion::ULong
uint32_t ULong
Definition: LongUnion.h:95
APPLE_ADDRESS
#define APPLE_ADDRESS
Definition: ir_NEC.hpp:116
IrSender
IRsend IrSender
Definition: IRSend.hpp:65
IRrecv::lastDecodedCommand
uint32_t lastDecodedCommand
Definition: IRremoteInt.h:363
IRDATA_FLAGS_IS_LSB_FIRST
#define IRDATA_FLAGS_IS_LSB_FIRST
Definition: IRProtocol.h:101
NEC_ZERO_SPACE
#define NEC_ZERO_SPACE
Definition: ir_NEC.hpp:105
NEC_HEADER_SPACE
#define NEC_HEADER_SPACE
Definition: ir_NEC.hpp:101
IRsend::space
static void space(uint16_t aSpaceMicros)
Sends an IR space for the specified number of microseconds.
Definition: IRSend.hpp:1148
NEC_REPEAT_HEADER_SPACE
#define NEC_REPEAT_HEADER_SPACE
Definition: ir_NEC.hpp:107
IRsend::sendNEC2
void sendNEC2(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
NEC2 Send frame !!! and repeat the frame for each requested repeat !!! There is NO delay after the la...
Definition: ir_NEC.hpp:201
IRData::rawlen
IRRawlenType rawlen
counter of entries in rawbuf of last received frame.
Definition: IRProtocol.h:128
IRrecv::decodeNECMSB
bool decodeNECMSB(decode_results *aResults)
Definition: ir_NEC.hpp:345
IRrecv::decodeNEC
bool decodeNEC()
Decodes also Onkyo and Apple.
Definition: ir_NEC.hpp:238
LongUnion::MidHighByte
uint8_t MidHighByte
Definition: LongUnion.h:63
IRsend::sendNECRepeat
void sendNECRepeat()
Send special NEC repeat frame Repeat commands should be sent in a 110 ms raster.
Definition: ir_NEC.hpp:135
NEC_REPEAT_PERIOD
#define NEC_REPEAT_PERIOD
Definition: ir_NEC.hpp:112
LongUnion::UWord
struct LongUnion::@6 UWord
IRsend::sendPulseDistanceWidthData
void sendPulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits)
Sends PulseDistance from data contained in parameter using ProtocolConstants structure for timing etc...
Definition: IRSend.hpp:812
IRrecv::lastDecodedAddress
uint32_t lastDecodedAddress
Definition: IRremoteInt.h:362
NEC_HEADER_MARK
#define NEC_HEADER_MARK
Definition: ir_NEC.hpp:100
IRsend::sendOnkyo
void sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
There is NO delay after the last sent repeat!
Definition: ir_NEC.hpp:192
NECProtocolConstants
struct PulseDistanceWidthProtocolConstants NECProtocolConstants
Definition: ir_NEC.hpp:118
IR_DEBUG_PRINTLN
#define IR_DEBUG_PRINTLN(...)
If DEBUG, print the arguments as a line, otherwise do nothing.
Definition: IRremoteInt.h:165
decode_results::rawlen
uint_fast8_t rawlen
Definition: IRremoteInt.h:195
IRData::protocol
decode_type_t protocol
UNKNOWN, NEC, SONY, RC5, PULSE_DISTANCE, ...
Definition: IRProtocol.h:109
IRsend::aCommand
void aCommand
Definition: IRremoteInt.h:610
IRsend::enableIROut
void enableIROut(uint_fast8_t aFrequencyKHz)
Enables IR output.
Definition: IRSend.hpp:1188
sendNECSpecialRepeat
void sendNECSpecialRepeat()
Static function variant of IRsend::sendNECRepeat For use in ProtocolConstants.
Definition: ir_NEC.hpp:146
NEC_MAXIMUM_REPEAT_DISTANCE
#define NEC_MAXIMUM_REPEAT_DISTANCE
Definition: ir_NEC.hpp:114