Skip to content

Commit 9c17815

Browse files
modules: openthread: Fix setting Channel on the deivce.
OT channel was beeing set in nRF5 radio diver, whereas after finishing transmission it got back to the default value because it was not saved in the OT radio implementation. Signed-off-by: Arkadiusz Balys <[email protected]>
1 parent 7e0665c commit 9c17815

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/openthread/platform/radio_nrf5.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ static int nrf5_set_channel(uint16_t channel)
297297
}
298298

299299
nrf_802154_channel_set(channel);
300+
nrf5_data.channel = channel;
300301

301302
LOG_DBG("set channel %u", channel);
302303

@@ -787,9 +788,9 @@ static otError transmit_frame(otInstance *aInstance)
787788

788789
if ((nrf5_data.capabilities & OT_RADIO_CAPS_TRANSMIT_TIMING) &&
789790
(nrf5_data.tx.frame.mInfo.mTxInfo.mTxDelay != 0)) {
790-
#if !defined(CONFIG_NRF5_SELECTIVE_TXCHANNEL)
791+
791792
nrf5_set_channel(nrf5_data.tx.frame.mChannel);
792-
#endif
793+
793794
if (!nrf5_tx_at(&nrf5_data.tx.frame, nrf5_data.tx.psdu)) {
794795
LOG_WRN("TX AT failed");
795796
nrf5_data.tx.result = OT_ERROR_ABORT;
@@ -1894,8 +1895,9 @@ static otError nrf5_tx_error_to_ot_error(nrf_802154_tx_error_t error)
18941895
case NRF_802154_TX_ERROR_TIMESLOT_ENDED:
18951896
case NRF_802154_TX_ERROR_TIMESLOT_DENIED:
18961897
return OT_ERROR_CHANNEL_ACCESS_FAILURE;
1897-
case NRF_802154_TX_ERROR_INVALID_ACK:
18981898
case NRF_802154_TX_ERROR_NO_MEM:
1899+
return OT_ERROR_NO_BUFS;
1900+
case NRF_802154_TX_ERROR_INVALID_ACK:
18991901
case NRF_802154_TX_ERROR_NO_ACK:
19001902
return OT_ERROR_NO_ACK;
19011903
case NRF_802154_TX_ERROR_ABORTED:

0 commit comments

Comments
 (0)