# Migration guide @tableofcontents This is a collection of snippets that highlight preferred API over the deprecated original API. ## isAckPayloadAvailable() > **Deprecated since v1.4.2** This function is equivalent to `RF24::available()`. Any use of `RF24::isAckPayloadAvailable()` is interchangeable with `RF24::available()`.
| Old | New (supported) |
|---|---|
| ```cpp if radio.isAckPayloadAvailable() { /* .. */ } ``` | ```cpp if radio.available() { /* .. */ } ``` |
| Old | New (supported) |
|---|---|
| ```cpp uint64_t address = 0xB3B4B5B6C2; radio.openReadingPipe(1, address); ``` | ```cpp uint8_t address[5] = {0xC2, 0xB6, 0xB5, 0xB4, 0xB3}; radio.openReadingPipe(1, address); ``` |
| Old | New (supported) |
|---|---|
| ```cpp bool rxFifoEmpty = radio.isFifo(false, true); ``` | ```cpp bool rxFifoEmpty = radio.isFifo(false) == RF24_FIFO_EMPTY; ``` |
| Old | New (supported) |
|---|---|
| ```cpp // IRQ pin only activated by "RX Data Ready" event radio.maskIRQ(1, 1, 0); // IRQ pin activated by "TX Data Sent" and TX Data Failed" events radio.maskIRQ(0, 0, 1); // IRQ pin activated by all events radio.maskIRQ(0, 0, 0); // IRQ pin disabled radio.maskIRQ(1, 1, 1); ``` | ```cpp // IRQ pin only activated by "RX Data Ready" event radio.setStatusFlags(RF24_RX_DR); // IRQ pin activated by "TX Data Sent" and TX Data Failed" events radio.setStatusFlags(RF24_TX_DS | RF24_TX_DF); // IRQ pin activated by all events radio.setStatusFlags(RF24_IRQ_ALL); // IRQ pin disabled radio.setStatusFlags(RF24_IRQ_NONE); // or equivalently radio.setStatusFlags(); ``` |
| Old | New (supported) |
|---|---|
| ```cpp bool tx_ds, tx_df, rx_dr; radio.whatHappened(tx_ds, tx_df, rx_dr); ``` | ```cpp uint8_t flags = radio.clearStatusFlags(); // or equivalently uint8_t flags = radio.clearStatusFlags(RF24_IRQ_ALL); // focus on the events you care about if (flags & RF24_TX_DS) { /* TX data sent */ } if (flags & RF24_TX_DF) { /* TX data failed to send */ } if (flags & RF24_RX_DR) { /* RX data is in the RX FIFO */ } // only clear the "TX Data Sent" and TX Data Failed" events radio.clearStatusFlags(RF24_TX_DS | RF24_TX_DF); // only clear the "RX Data Ready" event radio.clearStatusFlags(RF24_RX_DR); ``` |
| Old | New (supported) |
|---|---|
| ```cpp // set TX address (pipe 0) radio.openWritingPipe(tx_address); // set RX address (pipe 1) radio.openReadingPipe(1, rx_address); // idle radio using inactive TX mode radio.stopListening(); ``` | ```cpp // set TX address (pipe 0) radio.stopListening(tx_address); // enters inactive TX mode // set RX address (pipe 1) radio.openReadingPipe(1, rx_address); ``` |