IRremote
ir_Samsung.hpp
Go to the documentation of this file.
1 /*
2  * ir_Samsung.hpp
3  *
4  * Contains functions for receiving and sending Samsung IR Protocol in "raw" and standard format with 16 bit address and 16 or 32 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) 2017-2025 Darryl Smith, 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 CONSAMSUNGTION WITH THE SOFTWARE
28  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29  *
30  ************************************************************************************
31  */
32 #ifndef _IR_SAMSUNG_HPP
33 #define _IR_SAMSUNG_HPP
34 
35 #if defined(DEBUG)
36 #define LOCAL_DEBUG
37 #else
38 //#define LOCAL_DEBUG // This enables debug output only for this file
39 #endif
40 
44 //==============================================================================
45 // SSSS AAA MMM SSSS U U N N GGGG
46 // S A A M M M S U U NN N G
47 // SSS AAAAA M M M SSS U U N N N G GG
48 // S A A M M S U U N NN G G
49 // SSSS A A M M SSSS UUU N N GGG
50 //==============================================================================
51 /*
52  * Address=0xFFF1 Command=0x76 Raw-Data=0x8976FFF1
53  +4500,-4400
54  + 600,-1600 + 650,- 500 + 600,- 500 + 650,- 500
55  + 600,-1650 + 600,-1600 + 650,-1600 + 600,-1650
56  + 600,-1600 + 600,-1650 + 600,-1650 + 600,-1600
57  + 600,-1650 + 600,-1650 + 600,-1600 + 600,-1650
58  + 600,- 500 + 650,-1600 + 600,-1650 + 600,- 500
59  + 650,-1600 + 600,-1650 + 600,-1650 + 600,- 500
60  + 600,-1650 + 600,- 500 + 600,- 550 + 600,-1600
61  + 600,- 550 + 600,- 550 + 550,- 550 + 600,-1650
62  + 550
63  Sum: 68750
64  */
65 /*
66  * Samsung repeat frame can be the original frame again or a special short repeat frame,
67  * then we call the protocol SamsungLG. They differ only in the handling of repeat,
68  * so we can not decide for the first frame which protocol is used.
69  */
70 // see http://www.hifi-remote.com/wiki/index.php?title=DecodeIR#Samsung
71 // https://www.mikrocontroller.net/articles/IRMP_-_english#SAMSUNG32
72 // https://www.mikrocontroller.net/articles/IRMP_-_english#SAMSUNG48
73 // LSB first, 1 start bit + 16 bit address + 16 or 32 bit data + 1 stop bit.
74 // Here https://forum.arduino.cc/t/klimaanlage-per-ir-steuern/1051381/10 the address (0xB24D) is also 8 bits and then 8 inverted bits
75 //
76 // Here https://github.com/flipperdevices/flipperzero-firmware/blob/master/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c#L18
77 // Address is 8 bit + same 8 bit if command is 8 bit and ~8 bit.
78 //
79 // So we assume 8 bit address, if command is 8 bit and ~8 bit!
80 //
81 // IRP notation: {38k,5553}<1,-1|1,-3>(8,-8,D:8,S:8,F:8,~F:8,1,^110)+ ==> 8 bit + 8 bit inverted data - Samsung32
82 // IRP notation: {38k,5553}<1,-1|1,-3>(8,-8,D:8,S:8,F:16,1,^110)+ ==> 16 bit data - still Samsung32
83 // IRP notation: {38k,5553}<1,-1|1,-3>(8,-8,D:8,S:8,F:8,~F:8,G:8,~G:8,1,^110)+ ==> 2 x (8 bit + 8 bit inverted data) - Samsung48
84 //
85 #define SAMSUNG_ADDRESS_BITS 16
86 #define SAMSUNG_COMMAND16_BITS 16
87 #define SAMSUNG_COMMAND32_BITS 32
88 #define SAMSUNG_BITS (SAMSUNG_ADDRESS_BITS + SAMSUNG_COMMAND16_BITS)
89 #define SAMSUNG48_BITS (SAMSUNG_ADDRESS_BITS + SAMSUNG_COMMAND32_BITS)
90 
91 // except SAMSUNG_HEADER_MARK, values are like NEC
92 #define SAMSUNG_UNIT 560 // 21.28 periods of 38 kHz, 11.2 ticks TICKS_LOW = 8.358 TICKS_HIGH = 15.0
93 #define SAMSUNG_HEADER_MARK (8 * SAMSUNG_UNIT) // 4500 | 180 periods
94 #define SAMSUNG_HEADER_SPACE (8 * SAMSUNG_UNIT) // 4500
95 #define SAMSUNG_BIT_MARK SAMSUNG_UNIT
96 #define SAMSUNG_ONE_SPACE (3 * SAMSUNG_UNIT) // 1690 | 33.8 TICKS_LOW = 25.07 TICKS_HIGH = 45.0
97 #define SAMSUNG_ZERO_SPACE SAMSUNG_UNIT
98 
99 #define SAMSUNG_AVERAGE_DURATION 55000 // SAMSUNG_HEADER_MARK + SAMSUNG_HEADER_SPACE + 32 * 2,5 * SAMSUNG_UNIT + SAMSUNG_UNIT // 2.5 because we assume more zeros than ones
100 #define SAMSUNG_REPEAT_DURATION (SAMSUNG_HEADER_MARK + SAMSUNG_HEADER_SPACE + SAMSUNG_BIT_MARK + SAMSUNG_ZERO_SPACE + SAMSUNG_BIT_MARK)
101 #define SAMSUNG_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.
102 #define SAMSUNG_MAXIMUM_REPEAT_DISTANCE (SAMSUNG_REPEAT_PERIOD + (SAMSUNG_REPEAT_PERIOD / 4)) // 137000 - Just a guess
103 
104 // 19 byte RAM
105 struct PulseDistanceWidthProtocolConstants const SamsungProtocolConstants PROGMEM = {SAMSUNG, SAMSUNG_KHZ, SAMSUNG_HEADER_MARK,
108 
109 struct PulseDistanceWidthProtocolConstants const SamsungLGProtocolConstants PROGMEM = {SAMSUNGLG, SAMSUNG_KHZ, SAMSUNG_HEADER_MARK,
112 /************************************
113  * Start of send and decode functions
114  ************************************/
115 
122  enableIROut (SAMSUNG_KHZ); // 38 kHz
123  mark(SAMSUNG_HEADER_MARK); // + 4500
124  space(SAMSUNG_HEADER_SPACE); // - 4500
125  mark(SAMSUNG_BIT_MARK); // + 560
126  space(SAMSUNG_ZERO_SPACE); // - 560
127  mark(SAMSUNG_BIT_MARK); // + 560
128 }
129 
136  IrSender.enableIROut(SAMSUNG_KHZ); // 38 kHz
137  IrSender.mark(SAMSUNG_HEADER_MARK); // + 4500
139  IrSender.mark(SAMSUNG_BIT_MARK); // + 560
141  IrSender.mark(SAMSUNG_BIT_MARK); // + 560
142 }
143 
144 /*
145  * Sent e.g. by an LG 6711R1P071A remote
146  * @param aAddress 16 bit address. If < 0x100, i.e. only 8 bit, then a (standard) 16 bit address <8_bit_address><8_bit_address> is generated.
147  * @param aNumberOfRepeats If < 0 then only a special repeat frame will be sent
148  */
149 void IRsend::sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
150  if (aNumberOfRepeats < 0) {
152  return;
153  }
154 
155  // send 16 bit address and 8 command bits and then 8 inverted command bits LSB first
156  LongUnion tRawData;
157  tRawData.UWord.LowWord = aAddress;
158  if (aAddress < 0x100) { // This disables the sending of an (non standard?) 16 bit address with upper byte = 0 like 0x0014.
159  tRawData.UByte.MidLowByte = aAddress; // here we have 8 bit address which must be duplicated
160  }
161  tRawData.UByte.MidHighByte = aCommand;
162  tRawData.UByte.HighByte = ~aCommand;
163 
164  sendPulseDistanceWidth_P(&SamsungLGProtocolConstants, tRawData.ULong, SAMSUNG_BITS, aNumberOfRepeats);
165 }
166 
175 void IRsend::sendSamsung(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
176 
177  LongUnion tSendValue;
178  if (aAddress < 0x100) {
179  // This makes it flipper IRDB compatible:
180  // https://github.com/flipperdevices/flipperzero-firmware/blob/master/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c#L18
181  // Duplicate address byte, if address is only 8 bit
182  tSendValue.UBytes[1] = aAddress;
183  tSendValue.UBytes[0] = aAddress;
184  } else {
185  tSendValue.UWords[0] = aAddress;
186  }
187 
188  if (aCommand < 0x100) {
189  // Send 8 command bits and then 8 inverted command bits LSB first
190  tSendValue.UBytes[2] = aCommand;
191  tSendValue.UBytes[3] = ~aCommand;
192 
193  } else {
194  // Send 16 command bits
195  tSendValue.UWords[1] = aCommand;
196  }
197 
198  sendPulseDistanceWidth_P(&SamsungProtocolConstants, tSendValue.ULong, SAMSUNG_BITS, aNumberOfRepeats);
199 }
200 
206 void IRsend::sendSamsung16BitAddressAnd8BitCommand(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
207 
208  LongUnion tSendValue;
209  // send 16 bit address
210  tSendValue.UWords[0] = aAddress;
211  // Send 8 command bits and then 8 inverted command bits LSB first
212  tSendValue.UBytes[2] = aCommand;
213  tSendValue.UBytes[3] = ~aCommand;
214 
215  sendPulseDistanceWidth_P(&SamsungProtocolConstants, tSendValue.ULong, SAMSUNG_BITS, aNumberOfRepeats);
216 }
217 
223 void IRsend::sendSamsung16BitAddressAndCommand(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
224 
225  LongUnion tSendValue;
226  // send 16 bit address
227  tSendValue.UWords[0] = aAddress;
228  // Send 16 command bits
229  tSendValue.UWords[1] = aCommand;
230 
231  sendPulseDistanceWidth_P(&SamsungProtocolConstants, tSendValue.ULong, SAMSUNG_BITS, aNumberOfRepeats);
232 }
237 void IRsend::sendSamsung48(uint16_t aAddress, uint32_t aCommand, int_fast8_t aNumberOfRepeats) {
238 
239  // send 16 bit address and 2 x ( 8 command bits and then 8 inverted command bits) LSB first
240 #if __INT_WIDTH__ < 32
241  uint32_t tRawSamsungData[2]; // prepare 2 long for Samsung48
242 
243  LongUnion tSendValue;
244  tSendValue.UWords[0] = aAddress;
245  tSendValue.UBytes[2] = aCommand;
246  tSendValue.UBytes[3] = ~aCommand;
247  uint8_t tUpper8BitsOfCommand = aCommand >> 8;
248  tRawSamsungData[1] = tUpper8BitsOfCommand | (~tUpper8BitsOfCommand) << 8;
249  tRawSamsungData[0] = tSendValue.ULong;
250 
251  sendPulseDistanceWidthFromArray_P(&SamsungProtocolConstants, &tRawSamsungData[0], SAMSUNG48_BITS, aNumberOfRepeats);
252 #else
253  LongLongUnion tSendValue;
254  tSendValue.UWords[0] = aAddress;
255  if (aCommand < 0x10000) {
256  tSendValue.UBytes[2] = aCommand;
257  tSendValue.UBytes[3] = ~aCommand;
258  uint8_t tUpper8BitsOfCommand = aCommand >> 8;
259  tSendValue.UBytes[4] = tUpper8BitsOfCommand;
260  tSendValue.UBytes[5] = ~tUpper8BitsOfCommand;
261  } else {
262  tSendValue.ULongLong = aAddress | aCommand << 16;
263  }
264  sendPulseDistanceWidth_P(&SamsungProtocolConstants, tSendValue.ULongLong, SAMSUNG48_BITS, aNumberOfRepeats);
265 #endif
266 }
267 
268 /*
269  * We cannot decode frames with 8 command bits and then 8 inverted command bits LSB and 16 bit address,
270  * because in this case we always assume 8 bit address.
271  * This is, because we did not see 8 bit command and real 16 bit address in the wild.
272  */
274 
275  // Check we have enough data (68). The +4 is for initial gap, start bit mark and space + stop bit mark
276  if (decodedIRData.rawlen != ((2 * SAMSUNG_BITS) + 4) && decodedIRData.rawlen != ((2 * SAMSUNG48_BITS) + 4)
277  && (decodedIRData.rawlen != 6)) {
278  IR_DEBUG_PRINT(F("Samsung: "));
279  IR_DEBUG_PRINT(F("Data length="));
281  IR_DEBUG_PRINTLN(F(" is not 6 or 68 or 100"));
282  return false;
283  }
284 
285  if (!checkHeader_P(&SamsungProtocolConstants)) {
286  return false;
287  }
288 
289  // Check for SansungLG style repeat
290  if (decodedIRData.rawlen == 6) {
295  return true;
296  }
297 
298  /*
299  * Decode first 32 bits
300  */
301  decodePulseDistanceWidthData_P(&SamsungProtocolConstants, SAMSUNG_BITS, 3);
302  LongUnion tValue;
305 
306  if (decodedIRData.rawlen == (2 * SAMSUNG48_BITS) + 4) {
307  /*
308  * Samsung48
309  */
310  // decode additional 16 bit
312  3 + (2 * SAMSUNG_BITS));
313 
314  /*
315  * LSB data is already in tValue.UWord.HighWord!
316  * Put latest (MSB) bits in LowWord, LSB first would have them expect in HighWord so keep this in mind for decoding below
317  */
318  tValue.UWord.LowWord = decodedIRData.decodedRawData; // We have only 16 bit in decodedRawData here
319 #if __INT_WIDTH__ >= 32
320  // workaround until complete refactoring for 64 bit
321  decodedIRData.decodedRawData = (decodedIRData.decodedRawData << 32)| tValue.UWord.HighWord << 16 | decodedIRData.address; // store all 48 bits in decodedRawData
322 #endif
323 
324  /*
325  * Check parity of 32 bit command
326  */
327  // receive 2 * (8 bits then 8 inverted bits) LSB first
328  if (tValue.UByte.MidHighByte != (uint8_t)(~tValue.UByte.HighByte)
329  && tValue.UByte.LowByte != (uint8_t)(~tValue.UByte.MidLowByte)) {
331  }
332 
333  decodedIRData.command = tValue.UByte.LowByte << 8 | tValue.UByte.MidHighByte; // low and high word are swapped here, so fetch it this way
336 
337  } else {
338  /*
339  * Samsung32
340  */
341  if (tValue.UByte.MidHighByte == (uint8_t)(~tValue.UByte.HighByte)) {
342  // 8 bit command protocol -> assume 8 bit address
343  decodedIRData.command = tValue.UByte.MidHighByte; // first 8 bit
344  }
345 
346  if (tValue.UByte.MidLowByte == tValue.UByte.LowByte) {
347  decodedIRData.address = tValue.UByte.LowByte; // assume LowByte == MidLowByte as seen for a LG HX906 A/V Receive E8172C2C
348  } else {
349  // 16 bit command protocol, address is filled above with the 16 bit value
350  decodedIRData.command = tValue.UWord.HighWord; // first 16 bit
351  }
352 
355  }
356 
357  // check for repeat
359 
360  return true;
361 }
362 
363 // Old version with MSB first
365  unsigned int offset = 1; // Skip first space
366 
367  // Initial mark
368  if (!matchMark(aResults->rawbuf[offset], SAMSUNG_HEADER_MARK)) {
369  return false;
370  }
371  offset++;
372 
373  // Check for repeat -- like a NEC repeat
374  if ((aResults->rawlen == 4) && matchSpace(aResults->rawbuf[offset], 2250)
375  && matchMark(aResults->rawbuf[offset + 1], SAMSUNG_BIT_MARK)) {
376  aResults->bits = 0;
377  aResults->value = 0xFFFFFFFF;
380  return true;
381  }
382  if (aResults->rawlen < (2 * SAMSUNG_BITS) + 4) {
383  return false;
384  }
385 
386  // Initial space
387  if (!matchSpace(aResults->rawbuf[offset], SAMSUNG_HEADER_SPACE)) {
388  return false;
389  }
390  offset++;
391 
393 
394  aResults->value = decodedIRData.decodedRawData;
395  aResults->bits = SAMSUNG_BITS;
396  aResults->decode_type = SAMSUNG;
398  return true;
399 }
400 
401 // Old version with MSB first
402 void IRsend::sendSamsungMSB(unsigned long data, int nbits) {
403  // Set IR carrier frequency
405 
406  // Header
409 
410  // Old version with MSB first Data + stop bit
413 }
414 void IRsend::sendSAMSUNG(unsigned long data, int nbits) {
415  sendSamsungMSB(data, nbits);
416 }
417 
419 #if defined(LOCAL_DEBUG)
420 #undef LOCAL_DEBUG
421 #endif
422 #endif // _IR_SAMSUNG_HPP
IRData::address
uint16_t address
Decoded address, Distance protocol (tMarkTicksLong (if tMarkTicksLong == 0, then tMarkTicksShort) << ...
Definition: IRremoteInt.h:152
LongLongUnion::UBytes
uint8_t UBytes[8]
Definition: LongUnion.h:138
MICROS_PER_TICK
#define MICROS_PER_TICK
microseconds per clock interrupt tick
Definition: IRremote.hpp:207
LongUnion
Union to specify parts / manifestations of a 32 bit Long without casts and shifts.
Definition: LongUnion.h:59
SAMSUNG_HEADER_SPACE
#define SAMSUNG_HEADER_SPACE
Definition: ir_Samsung.hpp:94
decode_results
Results returned from old decoders !!!deprecated!!!
Definition: IRremoteInt.h:208
decode_results::rawbuf
uint16_t * rawbuf
Definition: IRremoteInt.h:219
IRrecv::decodePulseDistanceWidthData
void decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset=3)
Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.
Definition: IRReceive.hpp:1081
IRsend::sendSamsungMSB
void sendSamsungMSB(unsigned long data, int nbits)
Definition: ir_Samsung.hpp:402
PROTOCOL_IS_MSB_FIRST
#define PROTOCOL_IS_MSB_FIRST
Definition: IRProtocol.h:178
IRData::numberOfBits
uint16_t numberOfBits
Number of bits received for data (address + command + parity) - to determine protocol length if diffe...
Definition: IRremoteInt.h:161
IRsend::aNumberOfRepeats
void int_fast8_t aNumberOfRepeats
Definition: IRremoteInt.h:538
IRrecv::decodePulseDistanceWidthData_P
void decodePulseDistanceWidthData_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset=3)
Definition: IRReceive.hpp:1117
MICROS_IN_ONE_MILLI
#define MICROS_IN_ONE_MILLI
Definition: IRremote.hpp:212
IRrecv::checkHeader_P
bool checkHeader_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM)
Definition: IRReceive.hpp:1309
LongUnion::UByte
struct LongUnion::@4 UByte
PROTOCOL_IS_PULSE_DISTANCE
#define PROTOCOL_IS_PULSE_DISTANCE
Definition: IRProtocol.h:173
IRsend::sendPulseDistanceWidth_P
void sendPulseDistanceWidth_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, IRRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
Definition: IRSend.hpp:1075
IRsend::mark
void mark(uint16_t aMarkMicros)
Sends an IR mark for the specified number of microseconds.
Definition: IRSend.hpp:1153
IRsend::sendSamsungLGRepeat
void sendSamsungLGRepeat()
Send repeat Repeat commands should be sent in a 110 ms raster.
Definition: ir_Samsung.hpp:121
IRsend::sendSamsung48
void sendSamsung48(uint16_t aAddress, uint32_t aCommand, int_fast8_t aNumberOfRepeats)
Here we send Samsung48 We send 2 x (8 bit command and then ~command)
Definition: ir_Samsung.hpp:237
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:147
LongUnion::UBytes
uint8_t UBytes[4]
Definition: LongUnion.h:91
SAMSUNG
@ SAMSUNG
Definition: IRProtocol.h:114
LongUnion::LowByte
uint8_t LowByte
Definition: LongUnion.h:61
LongUnion::HighByte
uint8_t HighByte
Definition: LongUnion.h:64
decode_results::bits
uint8_t bits
Definition: IRremoteInt.h:214
decode_results::decode_type
decode_type_t decode_type
Definition: IRremoteInt.h:211
IRData::decodedRawData
IRRawDataType decodedRawData
Up to 32/64 bit decoded raw data, to be used for send<protocol>Raw functions.
Definition: IRremoteInt.h:155
IRrecv::checkForRepeatSpaceTicksAndSetFlag
void checkForRepeatSpaceTicksAndSetFlag(uint16_t aMaximumRepeatSpaceTicks)
Definition: IRReceive.hpp:1333
IR_DEBUG_PRINT
#define IR_DEBUG_PRINT(...)
If DEBUG, print the arguments, otherwise do nothing.
Definition: IRremoteInt.h:186
PROGMEM
struct PulseDistanceWidthProtocolConstants const SamsungProtocolConstants PROGMEM
Definition: ir_Samsung.hpp:105
LongUnion::LowWord
uint16_t LowWord
Definition: LongUnion.h:80
SAMSUNG_BITS
#define SAMSUNG_BITS
Definition: ir_Samsung.hpp:88
matchSpace
bool matchSpace(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
Definition: IRReceive.hpp:1459
LongLongUnion
Union to specify parts / manifestations of a 64 bit LongLong without casts and shifts.
Definition: LongUnion.h:107
IRsend::sendSamsung
void sendSamsung(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Here we send Samsung32 If we get a command < 0x100, we send command and then ~command If we get an ad...
Definition: ir_Samsung.hpp:175
IRDATA_FLAGS_PARITY_FAILED
#define IRDATA_FLAGS_PARITY_FAILED
The current (autorepeat) frame violated parity check.
Definition: IRProtocol.h:149
decode_results::value
uint32_t value
Definition: IRremoteInt.h:213
LongUnion::MidLowByte
uint8_t MidLowByte
Definition: LongUnion.h:62
IRrecv::decodeSAMSUNG
bool decodeSAMSUNG(decode_results *aResults)
Definition: ir_Samsung.hpp:364
PulseDistanceWidthProtocolConstants
Definition: IRProtocol.h:161
LongUnion::HighWord
uint16_t HighWord
Definition: LongUnion.h:81
IRrecv::decodedIRData
IRData decodedIRData
Definition: IRremoteInt.h:409
SAMSUNG_KHZ
#define SAMSUNG_KHZ
Definition: IRProtocol.h:194
IRsend::sendSamsung16BitAddressAndCommand
void sendSamsung16BitAddressAndCommand(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Maybe no one needs it in the wild...
Definition: ir_Samsung.hpp:223
IRrecv::decodeSamsung
bool decodeSamsung()
Definition: ir_Samsung.hpp:273
IRData::flags
uint8_t flags
IRDATA_FLAGS_IS_REPEAT, IRDATA_FLAGS_WAS_OVERFLOW etc. See IRDATA_FLAGS_* definitions above.
Definition: IRremoteInt.h:162
IRsend::sendSamsungLG
void sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_Samsung.hpp:149
PROTOCOL_IS_LSB_FIRST
#define PROTOCOL_IS_LSB_FIRST
Definition: IRProtocol.h:179
SAMSUNG_BIT_MARK
#define SAMSUNG_BIT_MARK
Definition: ir_Samsung.hpp:95
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:153
sendSamsungLGSpecialRepeat
void sendSamsungLGSpecialRepeat()
Like above, but implemented as a static function Used for sending special repeat frame.
Definition: ir_Samsung.hpp:135
IRData::command
uint16_t command
Decoded command, Distance protocol (tMarkTicksShort << 8) | tSpaceTicksShort.
Definition: IRremoteInt.h:153
SAMSUNG_MAXIMUM_REPEAT_DISTANCE
#define SAMSUNG_MAXIMUM_REPEAT_DISTANCE
Definition: ir_Samsung.hpp:102
SAMSUNG_COMMAND16_BITS
#define SAMSUNG_COMMAND16_BITS
Definition: ir_Samsung.hpp:86
SAMSUNG_ZERO_SPACE
#define SAMSUNG_ZERO_SPACE
Definition: ir_Samsung.hpp:97
matchMark
bool matchMark(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for marks exceeded by demodulator hardware.
Definition: IRReceive.hpp:1411
LongUnion::ULong
uint32_t ULong
Definition: LongUnion.h:95
IRsend::sendPulseDistanceWidthFromArray_P
void sendPulseDistanceWidthFromArray_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
Definition: IRSend.hpp:1056
IRrecv::lastDecodedCommand
uint16_t lastDecodedCommand
Definition: IRremoteInt.h:414
IrSender
IRsend IrSender
Definition: IRSend.hpp:69
SAMSUNG48_BITS
#define SAMSUNG48_BITS
Definition: ir_Samsung.hpp:89
IRsend::sendSamsung16BitAddressAnd8BitCommand
void sendSamsung16BitAddressAnd8BitCommand(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Maybe no one needs it in the wild...
Definition: ir_Samsung.hpp:206
IRDATA_FLAGS_IS_LSB_FIRST
#define IRDATA_FLAGS_IS_LSB_FIRST
Definition: IRProtocol.h:156
LongLongUnion::UWords
uint16_t UWords[4]
Definition: LongUnion.h:140
LongLongUnion::ULongLong
uint64_t ULongLong
Definition: LongUnion.h:142
SAMSUNG_REPEAT_PERIOD
#define SAMSUNG_REPEAT_PERIOD
Definition: ir_Samsung.hpp:101
SAMSUNG_HEADER_MARK
#define SAMSUNG_HEADER_MARK
Definition: ir_Samsung.hpp:93
IRsend::space
static void space(uint16_t aSpaceMicros)
Sends an IR space for the specified number of microseconds.
Definition: IRSend.hpp:1364
SAMSUNG_COMMAND32_BITS
#define SAMSUNG_COMMAND32_BITS
Definition: ir_Samsung.hpp:87
SAMSUNG_ONE_SPACE
#define SAMSUNG_ONE_SPACE
Definition: ir_Samsung.hpp:96
IRData::rawlen
IRRawlenType rawlen
Counter of entries in rawbuf of last received frame.
Definition: IRremoteInt.h:170
LongUnion::MidHighByte
uint8_t MidHighByte
Definition: LongUnion.h:63
LongUnion::UWords
uint16_t UWords[2]
Definition: LongUnion.h:93
IRsend::sendSAMSUNG
void sendSAMSUNG(unsigned long data, int nbits)
Definition: ir_Samsung.hpp:414
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:578
IR_DEBUG_PRINTLN
#define IR_DEBUG_PRINTLN(...)
If DEBUG, print the arguments as a line, otherwise do nothing.
Definition: IRremoteInt.h:190
SAMSUNGLG
@ SAMSUNGLG
Definition: IRProtocol.h:115
decode_results::rawlen
uint_fast8_t rawlen
Definition: IRremoteInt.h:220
IRData::protocol
decode_type_t protocol
UNKNOWN, NEC, SONY, RC5, PULSE_DISTANCE, ...
Definition: IRremoteInt.h:151
SAMSUNG48
@ SAMSUNG48
Definition: IRProtocol.h:116
IRrecv::lastDecodedAddress
uint16_t lastDecodedAddress
Definition: IRremoteInt.h:413
IRsend::aCommand
void aCommand
Definition: IRremoteInt.h:688
IRsend::enableIROut
void enableIROut(uint_fast8_t aFrequencyKHz)
Enables IR output.
Definition: IRSend.hpp:1404