drivers: ieee802154: nrf5: Add support for failed rx notification
Thread implements couple of counters that require notification of failed frame reception. Implemented RX failed notification. Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
This commit is contained in:
parent
7e64fba9ed
commit
886cf7a9f3
2 changed files with 35 additions and 1 deletions
|
@ -630,7 +630,33 @@ void nrf_802154_received_timestamp_raw(uint8_t *data, int8_t power, uint8_t lqi,
|
|||
|
||||
void nrf_802154_receive_failed(nrf_802154_rx_error_t error)
|
||||
{
|
||||
enum ieee802154_rx_fail_reason reason;
|
||||
|
||||
switch (error) {
|
||||
case NRF_802154_RX_ERROR_INVALID_FRAME:
|
||||
case NRF_802154_RX_ERROR_DELAYED_TIMEOUT:
|
||||
reason = IEEE802154_RX_FAIL_NOT_RECEIVED;
|
||||
break;
|
||||
|
||||
case NRF_802154_RX_ERROR_INVALID_FCS:
|
||||
reason = IEEE802154_RX_FAIL_INVALID_FCS;
|
||||
break;
|
||||
|
||||
case NRF_802154_RX_ERROR_INVALID_DEST_ADDR:
|
||||
reason = IEEE802154_RX_FAIL_ADDR_FILTERED;
|
||||
break;
|
||||
|
||||
default:
|
||||
reason = IEEE802154_RX_FAIL_OTHER;
|
||||
break;
|
||||
}
|
||||
|
||||
nrf5_data.last_frame_ack_fpb = false;
|
||||
if (nrf5_data.event_handler) {
|
||||
nrf5_data.event_handler(net_if_get_device(nrf5_data.iface),
|
||||
IEEE802154_EVENT_RX_FAILED,
|
||||
(void *)&reason);
|
||||
}
|
||||
}
|
||||
|
||||
void nrf_802154_tx_ack_started(const uint8_t *data)
|
||||
|
|
|
@ -48,7 +48,15 @@ enum ieee802154_filter_type {
|
|||
};
|
||||
|
||||
enum ieee802154_event {
|
||||
IEEE802154_EVENT_TX_STARTED /* Data transmission started */
|
||||
IEEE802154_EVENT_TX_STARTED, /* Data transmission started */
|
||||
IEEE802154_EVENT_RX_FAILED /* Data reception failed */
|
||||
};
|
||||
|
||||
enum ieee802154_rx_fail_reason {
|
||||
IEEE802154_RX_FAIL_NOT_RECEIVED, /* Nothing received */
|
||||
IEEE802154_RX_FAIL_INVALID_FCS, /* Frame had invalid checksum */
|
||||
IEEE802154_RX_FAIL_ADDR_FILTERED, /* Address did not match */
|
||||
IEEE802154_RX_FAIL_OTHER /* General reason */
|
||||
};
|
||||
|
||||
typedef void (*energy_scan_done_cb_t)(const struct device *dev,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue