| 393 | } |
| 394 | |
| 395 | void 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 | |
| 419 | void sendSamsungCommand(String address, String command, bool hideDefaultUI) { |
| 420 | IRsend irsend(bruceConfigPins.irTx); // Set the GPIO to be used to sending the message. |
no test coverage detected