Skip to content

Commit

Permalink
MAC: Fixed handling of the failed Ack transmission
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Oct 2, 2018
1 parent f43e285 commit d9e2ea6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/MAC/IEEE802_15_4/mac_mcps_sap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d9e2ea6

Please sign in to comment.