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

Function sendRC5Command

src/modules/ir/custom_ir.cpp:375–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373}
374
375void sendRC5Command(String address, String command, bool hideDefaultUI) {
376 IRsend irsend(bruceConfigPins.irTx, true); // Set the GPIO to be used to sending the message.
377 irsend.begin();
378 if (!hideDefaultUI) { displayTextLine("Sending.."); }
379 uint8_t addressValue = strtoul(address.substring(0, 2).c_str(), nullptr, 16);
380 uint8_t commandValue = strtoul(command.substring(0, 2).c_str(), nullptr, 16);
381 uint16_t data = irsend.encodeRC5(addressValue, commandValue);
382 irsend.sendRC5(data, 13);
383
384 if (bruceConfigPins.irTxRepeats > 0) {
385 for (uint8_t i = 1; i <= bruceConfigPins.irTxRepeats; i++) { irsend.sendRC5(data, 13); }
386 }
387 Serial.println(
388 "Sent RC5 Command" + (bruceConfigPins.irTxRepeats > 0
389 ? " (1 initial + " + String(bruceConfigPins.irTxRepeats) + " repeats)"
390 : "")
391 );
392 digitalWrite(bruceConfigPins.irTx, LED_OFF);
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.

Callers 1

sendIRCommandFunction · 0.85

Calls 3

displayTextLineFunction · 0.85
beginMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected