Skip to content

Commit

Permalink
CCA RETRY and and TX reretry clear calculation when FHSS re-send pack…
Browse files Browse the repository at this point in the history
…et at new channel.

Change-Id: I022ddd75637518318b4bca3a6a6cd730c2c9de2b
  • Loading branch information
Juha Heiskanen committed Apr 11, 2019
1 parent c7235f8 commit a21bede
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions source/MAC/IEEE802_15_4/mac_mcps_sap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,13 +1423,20 @@ static void mcps_data_confirm_handle(protocol_interface_rf_mac_setup_s *rf_ptr,
// FHSS checks if this failed buffer needs to be pushed back to TX queue and retransmitted
if ((rf_ptr->mac_tx_result == MAC_TX_FAIL) || (rf_ptr->mac_tx_result == MAC_CCA_FAIL)) {
if (rf_ptr->fhss_api->data_tx_fail(rf_ptr->fhss_api, buffer->msduHandle, mac_convert_frame_type_to_fhss(buffer->fcf_dsn.frametype)) == true) {

if (rf_ptr->mac_tx_result == MAC_TX_FAIL) {
buffer->fhss_retry_count += 1 + rf_ptr->mac_tx_status.retry;
} else {
buffer->fhss_retry_count += rf_ptr->mac_tx_status.retry;
}
buffer->fhss_cca_retry_count += rf_ptr->mac_tx_status.cca_cnt;
mcps_sap_pd_req_queue_write(rf_ptr, buffer);
return;
}
}
}
confirm.cca_retries = rf_ptr->mac_tx_status.cca_cnt;
confirm.tx_retries = rf_ptr->mac_tx_status.retry;
confirm.cca_retries = rf_ptr->mac_tx_status.cca_cnt + buffer->fhss_cca_retry_count;
confirm.tx_retries = rf_ptr->mac_tx_status.retry + buffer->fhss_retry_count;
mac_common_data_confirmation_handle(rf_ptr, buffer);
confirm.msduHandle = buffer->msduHandle;
confirm.status = buffer->status;
Expand Down
2 changes: 2 additions & 0 deletions source/MAC/IEEE802_15_4/mac_mcps_sap.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ typedef struct mac_pre_build_frame {
uint8_t status;
uint8_t asynch_channel;
uint8_t csma_periods_left;
uint8_t fhss_retry_count;
uint8_t fhss_cca_retry_count;
uint32_t tx_time;
bool upper_layer_request;
bool mac_allocated_payload_ptr: 1;
Expand Down

0 comments on commit a21bede

Please sign in to comment.