Skip to content

Commit 586eca8

Browse files
edmontcarlescufi
authored andcommitted
drivers: ieee802154: nrf5: add IEEE802154_RX_ON_WHEN_IDLE capability
Add `IEEE802154_RX_ON_WHEN_IDLE` capability. Signed-off-by: Eduardo Montoya <[email protected]>
1 parent 780b128 commit 586eca8

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

drivers/ieee802154/ieee802154_nrf5.c

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ static void nrf5_get_capabilities_at_boot(void)
236236
((caps & NRF_802154_CAPABILITY_DELAYED_TX) ? IEEE802154_HW_TXTIME : 0UL) |
237237
((caps & NRF_802154_CAPABILITY_DELAYED_RX) ? IEEE802154_HW_RXTIME : 0UL) |
238238
IEEE802154_HW_SLEEP_TO_TX |
239+
IEEE802154_RX_ON_WHEN_IDLE |
239240
((caps & NRF_802154_CAPABILITY_SECURITY) ? IEEE802154_HW_TX_SEC : 0UL)
240241
#if defined(CONFIG_IEEE802154_NRF5_MULTIPLE_CCA)
241242
| IEEE802154_OPENTHREAD_HW_MULTIPLE_CCA
@@ -987,6 +988,10 @@ static int nrf5_configure(const struct device *dev,
987988
break;
988989
#endif /* CONFIG_IEEE802154_NRF5_MULTIPLE_CCA */
989990

991+
case IEEE802154_CONFIG_RX_ON_WHEN_IDLE:
992+
nrf_802154_rx_on_when_idle_set(config->rx_on_when_idle);
993+
break;
994+
990995
default:
991996
return -EINVAL;
992997
}
@@ -1064,20 +1069,8 @@ void nrf_802154_receive_failed(nrf_802154_rx_error_t error, uint32_t id)
10641069
const struct device *dev = nrf5_get_device();
10651070

10661071
#if defined(CONFIG_IEEE802154_CSL_ENDPOINT)
1067-
if (id == DRX_SLOT_RX) {
1068-
__ASSERT_NO_MSG(nrf5_data.event_handler);
1069-
#if !defined(CONFIG_IEEE802154_CSL_DEBUG)
1070-
/* When CSL debug option is used we intentionally avoid notifying the higher layer
1071-
* about the finalization of a DRX slot, so that the radio stays in receive state
1072-
* for receiving "out of slot" frames.
1073-
* As a side effect, regular failure notifications would be reported with the
1074-
* incorrect ID.
1075-
*/
1076-
nrf5_data.event_handler(dev, IEEE802154_EVENT_RX_OFF, NULL);
1077-
#endif
1078-
if (error == NRF_802154_RX_ERROR_DELAYED_TIMEOUT) {
1079-
return;
1080-
}
1072+
if (id == DRX_SLOT_RX && error == NRF_802154_RX_ERROR_DELAYED_TIMEOUT) {
1073+
return;
10811074
}
10821075
#else
10831076
ARG_UNUSED(id);

0 commit comments

Comments
 (0)