Skip to content

Commit d9e2ea6

Browse files
author
Jarkko Paso
committed
MAC: Fixed handling of the failed Ack transmission
1 parent f43e285 commit d9e2ea6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/MAC/IEEE802_15_4/mac_mcps_sap.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,9 +1836,15 @@ static int8_t mcps_pd_data_cca_trig(protocol_interface_rf_mac_setup_s *rf_ptr, m
18361836
}
18371837
mac_pd_sap_set_phy_tx_time(rf_ptr, buffer->tx_time, cca_enabled);
18381838
if (mac_plme_cca_req(rf_ptr) != 0) {
1839-
18401839
if (buffer->fcf_dsn.frametype == MAC_FRAME_ACK) {
1840+
rf_ptr->mac_ack_tx_active = false;
1841+
// For Ack, stop the active TX process
18411842
rf_ptr->macTxProcessActive = false;
1843+
// If MAC had TX process active before Ack transmission,
1844+
// the TX process has to be restarted in case the Ack transmission failed.
1845+
if (rf_ptr->active_pd_data_request) {
1846+
mac_csma_backoff_start(rf_ptr);
1847+
}
18421848
return -1;
18431849
}
18441850
mac_csma_backoff_start(rf_ptr);

0 commit comments

Comments
 (0)