net: openthread: Add support for HW CSMA CA
Forward CSMA CA capability to OpenThread and use CSMA CA enabled transfer if supported. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
369109b4b2
commit
108820aafb
1 changed files with 17 additions and 3 deletions
|
@ -189,9 +189,18 @@ void platformRadioProcess(otInstance *aInstance)
|
|||
radio_api->set_txpower(radio_dev, tx_power);
|
||||
|
||||
if (sTransmitFrame.mInfo.mTxInfo.mCsmaCaEnabled) {
|
||||
if (radio_api->cca(radio_dev) ||
|
||||
radio_api->tx(radio_dev, IEEE802154_TX_MODE_DIRECT,
|
||||
tx_pkt, tx_payload)) {
|
||||
if (radio_api->get_capabilities(radio_dev) &
|
||||
IEEE802154_HW_CSMA) {
|
||||
if (radio_api->tx(radio_dev,
|
||||
IEEE802154_TX_MODE_CSMA_CA,
|
||||
tx_pkt, tx_payload) != 0) {
|
||||
result =
|
||||
OT_ERROR_CHANNEL_ACCESS_FAILURE;
|
||||
}
|
||||
} else if (radio_api->cca(radio_dev) != 0 ||
|
||||
radio_api->tx(radio_dev,
|
||||
IEEE802154_TX_MODE_DIRECT,
|
||||
tx_pkt, tx_payload) != 0) {
|
||||
result = OT_ERROR_CHANNEL_ACCESS_FAILURE;
|
||||
}
|
||||
} else {
|
||||
|
@ -422,6 +431,11 @@ otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
|||
caps |= OT_RADIO_CAPS_ENERGY_SCAN;
|
||||
}
|
||||
|
||||
if (radio_caps & IEEE802154_HW_CSMA) {
|
||||
caps |= OT_RADIO_CAPS_CSMA_BACKOFF |
|
||||
OT_RADIO_CAPS_TRANSMIT_RETRIES;
|
||||
}
|
||||
|
||||
return caps;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue