MCPcopy Create free account
hub / github.com/Arduino-IRremote/Arduino-IRremote / decodeSAMSUNG

Method decodeSAMSUNG

src/ir_Samsung.hpp:361–396  ·  view source on GitHub ↗

Old version with MSB first

Source from the content-addressed store, hash-verified

359
360// Old version with MSB first
361bool IRrecv::decodeSAMSUNG(decode_results *aResults) {
362 unsigned int offset = 1; // Skip first space
363
364 // Initial mark
365 if (!matchMark(aResults->rawbuf[offset], SAMSUNG_HEADER_MARK)) {
366 return false;
367 }
368 offset++;
369
370 // Check for repeat -- like a NEC repeat
371 if ((aResults->rawlen == 4) && matchSpace(aResults->rawbuf[offset], 2250)
372 && matchMark(aResults->rawbuf[offset + 1], SAMSUNG_BIT_MARK)) {
373 aResults->bits = 0;
374 aResults->value = 0xFFFFFFFF;
375 decodedIRData.flags = IRDATA_FLAGS_IS_REPEAT;
376 decodedIRData.protocol = SAMSUNG;
377 return true;
378 }
379 if (aResults->rawlen < (2 * SAMSUNG_BITS) + 4) {
380 return false;
381 }
382
383 // Initial space
384 if (!matchSpace(aResults->rawbuf[offset], SAMSUNG_HEADER_SPACE)) {
385 return false;
386 }
387 offset++;
388
389 decodePulseDistanceWidthData(SAMSUNG_BITS, offset, SAMSUNG_BIT_MARK, SAMSUNG_ONE_SPACE, 0, PROTOCOL_IS_MSB_FIRST);
390
391 aResults->value = decodedIRData.decodedRawData;
392 aResults->bits = SAMSUNG_BITS;
393 aResults->decode_type = SAMSUNG;
394 decodedIRData.protocol = SAMSUNG;
395 return true;
396}
397
398// Old version with MSB first
399void IRsend::sendSamsungMSB(unsigned long data, int nbits) {

Callers

nothing calls this directly

Calls 2

matchMarkFunction · 0.85
matchSpaceFunction · 0.85

Tested by

no test coverage detected