diff --git a/source/MAC/IEEE802_15_4/mac_mcps_sap.c b/source/MAC/IEEE802_15_4/mac_mcps_sap.c index ed6b02d0f17..862d70fe6fa 100644 --- a/source/MAC/IEEE802_15_4/mac_mcps_sap.c +++ b/source/MAC/IEEE802_15_4/mac_mcps_sap.c @@ -1836,9 +1836,15 @@ static int8_t mcps_pd_data_cca_trig(protocol_interface_rf_mac_setup_s *rf_ptr, m } mac_pd_sap_set_phy_tx_time(rf_ptr, buffer->tx_time, cca_enabled); if (mac_plme_cca_req(rf_ptr) != 0) { - if (buffer->fcf_dsn.frametype == MAC_FRAME_ACK) { + rf_ptr->mac_ack_tx_active = false; + // For Ack, stop the active TX process rf_ptr->macTxProcessActive = false; + // If MAC had TX process active before Ack transmission, + // the TX process has to be restarted in case the Ack transmission failed. + if (rf_ptr->active_pd_data_request) { + mac_csma_backoff_start(rf_ptr); + } return -1; } mac_csma_backoff_start(rf_ptr);