sys/net/iee802154/radio: add IEEE802154_RADIO_INDICATION_CRC_ERROR
This commit is contained in:
parent
daf5a7d6b4
commit
fe1e16cdc7
@ -348,8 +348,10 @@ void cc2538_irq_handler(void)
|
||||
cc2538_rf_dev.cb(&cc2538_rf_dev, IEEE802154_RADIO_INDICATION_RX_DONE);
|
||||
}
|
||||
else {
|
||||
/* Disable RX while the frame has not been processed */
|
||||
RFCORE_XREG_RXMASKCLR = 0xFF;
|
||||
/* CRC failed; discard packet */
|
||||
RFCORE_SFR_RFST = ISFLUSHRX;
|
||||
cc2538_rf_dev.cb(&cc2538_rf_dev, IEEE802154_RADIO_INDICATION_CRC_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -391,11 +393,12 @@ static bool _get_cap(ieee802154_dev_t *dev, ieee802154_rf_caps_t cap)
|
||||
(void) dev;
|
||||
switch (cap) {
|
||||
case IEEE802154_CAP_24_GHZ:
|
||||
case IEEE802154_CAP_AUTO_CSMA:
|
||||
case IEEE802154_CAP_IRQ_CRC_ERROR:
|
||||
case IEEE802154_CAP_IRQ_TX_DONE:
|
||||
case IEEE802154_CAP_IRQ_CCA_DONE:
|
||||
case IEEE802154_CAP_IRQ_RX_START:
|
||||
case IEEE802154_CAP_IRQ_TX_START:
|
||||
case IEEE802154_CAP_AUTO_CSMA:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
||||
@ -544,7 +544,7 @@ void isr_radio(void)
|
||||
}
|
||||
else {
|
||||
DEBUG("[nrf802154] CRC fail.\n");
|
||||
NRF_RADIO->TASKS_START = 1;
|
||||
dev->cb(dev, IEEE802154_RADIO_INDICATION_CRC_ERROR);
|
||||
}
|
||||
break;
|
||||
case STATE_ACK:
|
||||
@ -645,6 +645,7 @@ static bool _get_cap(ieee802154_dev_t *dev, ieee802154_rf_caps_t cap)
|
||||
(void) dev;
|
||||
switch (cap) {
|
||||
case IEEE802154_CAP_24_GHZ:
|
||||
case IEEE802154_CAP_IRQ_CRC_ERROR:
|
||||
case IEEE802154_CAP_IRQ_RX_START:
|
||||
case IEEE802154_CAP_IRQ_TX_START:
|
||||
case IEEE802154_CAP_IRQ_TX_DONE:
|
||||
|
||||
@ -92,6 +92,10 @@ typedef enum {
|
||||
* @brief the device support the IEEE802.15.4 Sub GHz band
|
||||
*/
|
||||
IEEE802154_CAP_SUB_GHZ,
|
||||
/**
|
||||
* @brief the device reports reception off frames with invalid CRC.
|
||||
*/
|
||||
IEEE802154_CAP_IRQ_CRC_ERROR,
|
||||
/**
|
||||
* @brief the device reports when the transmission is done
|
||||
*/
|
||||
@ -190,6 +194,18 @@ typedef enum {
|
||||
*/
|
||||
IEEE802154_RADIO_INDICATION_RX_START,
|
||||
|
||||
/**
|
||||
* @brief the transceiver received a frame with an invalid crc.
|
||||
*
|
||||
* The transceiver might not stay in @ref IEEE802154_TRX_STATE_RX_ON
|
||||
* after receiving an invalid CRC. Therefore the upper layer must
|
||||
* set the transceiver state (@ref ieee802154_radio_ops::request_set_trx_state).
|
||||
* e.g.: @ref IEEE802154_TRX_STATE_TRX_OFF or @ref IEEE802154_TRX_STATE_TX_ON
|
||||
* to stop listening or @ref IEEE802154_TRX_STATE_RX_ON to keep
|
||||
* listening.
|
||||
*/
|
||||
IEEE802154_RADIO_INDICATION_CRC_ERROR,
|
||||
|
||||
/**
|
||||
* @brief the transceiver sent out a valid SFD
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user