drivers: ieee802154: Add more error codes to nrf5 driver tx
Add separate error codes in tx function for busy channel error and ACK-related errors. Signed-off-by: Maciej Fabia <maciej.fabia@nordicsemi.no>
This commit is contained in:
parent
ccea4d3258
commit
06b44b12c7
1 changed files with 13 additions and 2 deletions
|
@ -414,14 +414,25 @@ static int nrf5_tx(const struct device *dev,
|
||||||
|
|
||||||
LOG_DBG("Result: %d", nrf5_data.tx_result);
|
LOG_DBG("Result: %d", nrf5_data.tx_result);
|
||||||
|
|
||||||
if (nrf5_radio->tx_result == NRF_802154_TX_ERROR_NONE) {
|
switch (nrf5_radio->tx_result) {
|
||||||
|
case NRF_802154_TX_ERROR_NONE:
|
||||||
if (nrf5_radio->ack_frame.psdu == NULL) {
|
if (nrf5_radio->ack_frame.psdu == NULL) {
|
||||||
/* No ACK was requested. */
|
/* No ACK was requested. */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle ACK packet. */
|
/* Handle ACK packet. */
|
||||||
return handle_ack(nrf5_radio);
|
return handle_ack(nrf5_radio);
|
||||||
|
case NRF_802154_TX_ERROR_NO_MEM:
|
||||||
|
return -ENOBUFS;
|
||||||
|
case NRF_802154_TX_ERROR_BUSY_CHANNEL:
|
||||||
|
return -EBUSY;
|
||||||
|
case NRF_802154_TX_ERROR_INVALID_ACK:
|
||||||
|
case NRF_802154_TX_ERROR_NO_ACK:
|
||||||
|
return -ENOMSG;
|
||||||
|
case NRF_802154_TX_ERROR_ABORTED:
|
||||||
|
case NRF_802154_TX_ERROR_TIMESLOT_DENIED:
|
||||||
|
case NRF_802154_TX_ERROR_TIMESLOT_ENDED:
|
||||||
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue