MCPcopy Create free account
hub / github.com/BruceDevices/firmware / sendRC6Command

Function sendRC6Command

src/modules/ir/custom_ir.cpp:395–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395void sendRC6Command(String address, String command, bool hideDefaultUI) {
396 IRsend irsend(bruceConfigPins.irTx, true); // Set the GPIO to be used to sending the message.
397 irsend.begin();
398 if (!hideDefaultUI) { displayTextLine("Sending.."); }
399 address.replace(" ", "");
400 command.replace(" ", "");
401 uint32_t addressValue = strtoul(address.substring(0, 2).c_str(), nullptr, 16);
402 uint32_t commandValue = strtoul(command.substring(0, 2).c_str(), nullptr, 16);
403 uint64_t data = irsend.encodeRC6(addressValue, commandValue);
404
405 irsend.sendRC6(data, 20);
406
407 if (bruceConfigPins.irTxRepeats > 0) {
408 for (uint8_t i = 1; i <= bruceConfigPins.irTxRepeats; i++) { irsend.sendRC6(data, 20); }
409 }
410
411 Serial.println(
412 "Sent RC6 Command" + (bruceConfigPins.irTxRepeats > 0
413 ? " (1 initial + " + String(bruceConfigPins.irTxRepeats) + " repeats)"
414 : "")
415 );
416 digitalWrite(bruceConfigPins.irTx, LED_OFF);
417}
418
419void sendSamsungCommand(String address, String command, bool hideDefaultUI) {
420 IRsend irsend(bruceConfigPins.irTx); // Set the GPIO to be used to sending the message.

Callers 1

sendIRCommandFunction · 0.85

Calls 3

displayTextLineFunction · 0.85
beginMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected