Skip to content

Commit 1a51717

Browse files
committed
update setting channel
Signed-off-by: Adrian Gielniewski <[email protected]>
1 parent 4ca493a commit 1a51717

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/openthread/platform/radio_nrf5.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,6 @@ static bool nrf5_tx(otRadioFrame *frame, uint8_t *payload, bool cca)
607607
.use_metadata_value = true,
608608
.power = get_transmit_power_for_channel(frame->mChannel),
609609
},
610-
.tx_channel = {.use_metadata_value = true, .channel = frame->mChannel},
611610
};
612611

613612
return nrf_802154_transmit_raw(payload, &metadata);
@@ -627,12 +626,10 @@ static bool nrf5_tx_csma_ca(otRadioFrame *frame, uint8_t *payload)
627626
.use_metadata_value = true,
628627
.power = get_transmit_power_for_channel(frame->mChannel),
629628
},
630-
.tx_channel = {.use_metadata_value = true, .channel = frame->mChannel},
631629

632630
};
633631

634632
nrf_802154_csma_ca_max_backoffs_set(frame->mInfo.mTxInfo.mMaxCsmaBackoffs);
635-
636633
return nrf_802154_transmit_csma_ca_raw(payload, &metadata);
637634
}
638635
#endif
@@ -719,17 +716,22 @@ static otError transmit_frame(otInstance *aInstance)
719716

720717
if ((nrf5_data.capabilities & OT_RADIO_CAPS_TRANSMIT_TIMING) &&
721718
(nrf5_data.tx.frame.mInfo.mTxInfo.mTxDelay != 0)) {
719+
#if !defined(CONFIG_NRF5_SELECTIVE_TXCHANNEL)
720+
nrf5_set_channel(nrf5_data.tx.frame.mChannel);
721+
#endif
722722
if (!nrf5_tx_at(&nrf5_data.tx.frame, nrf5_data.tx.psdu)) {
723723
LOG_ERR("TX at failed");
724724
return OT_ERROR_INVALID_STATE;
725725
}
726726
} else if (nrf5_data.tx.frame.mInfo.mTxInfo.mCsmaCaEnabled) {
727+
nrf5_set_channel(nrf5_data.tx.frame.mChannel);
727728
if (nrf5_data.capabilities & OT_RADIO_CAPS_CSMA_BACKOFF) {
728729
result = nrf5_tx_csma_ca(&nrf5_data.tx.frame, nrf5_data.tx.psdu);
729730
} else {
730731
result = nrf5_tx(&nrf5_data.tx.frame, nrf5_data.tx.psdu, true);
731732
}
732733
} else {
734+
nrf5_set_channel(nrf5_data.tx.frame.mChannel);
733735
result = nrf5_tx(&nrf5_data.tx.frame, nrf5_data.tx.psdu, false);
734736
}
735737

0 commit comments

Comments
 (0)