diff --git a/cpu/nrf52/radio/nrf802154/nrf802154_radio.c b/cpu/nrf52/radio/nrf802154/nrf802154_radio.c index 4eb926a727..1debb71af4 100644 --- a/cpu/nrf52/radio/nrf802154/nrf802154_radio.c +++ b/cpu/nrf52/radio/nrf802154/nrf802154_radio.c @@ -124,6 +124,11 @@ static bool _l2filter(uint8_t *mhr) int addr_len = ieee802154_get_dst(mhr, dst_addr, &dst_pan); + if ((mhr[0] & IEEE802154_FCF_TYPE_MASK) == IEEE802154_FCF_TYPE_BEACON) { + if ((memcmp(&nrf802154_pan_id, pan_bcast, 2) == 0)) { + return true; + } + } /* filter PAN ID */ /* Will only work on little endian platform (all?) */ @@ -197,7 +202,7 @@ static int _request_op(ieee802154_dev_t *dev, ieee802154_hal_op_t op, void *ctx) (void) dev; int res = -EBUSY; - int state; + int state = STATE_IDLE; switch (op) { case IEEE802154_HAL_OP_TRANSMIT: @@ -265,6 +270,10 @@ static int _confirm_op(ieee802154_dev_t *dev, ieee802154_hal_op_t op, void *ctx) state = STATE_IDLE; enable_shorts = true; + if (info) { + info->status = (_state == STATE_CCA_BUSY) ? TX_STATUS_MEDIUM_BUSY : TX_STATUS_SUCCESS; + } + break; case IEEE802154_HAL_OP_SET_RX: eagain = (radio_state == RADIO_STATE_STATE_RxRu); @@ -291,10 +300,6 @@ static int _confirm_op(ieee802154_dev_t *dev, ieee802154_hal_op_t op, void *ctx) _state = state; - if (info) { - info->status = (_state == STATE_CCA_BUSY) ? TX_STATUS_MEDIUM_BUSY : TX_STATUS_SUCCESS; - } - if (enable_shorts) { NRF_RADIO->SHORTS = DEFAULT_SHORTS; DEBUG("[nrf802154] TX Finished\n");