Skip to content

Commit

Permalink
Merge pull request ARMmbed#1786 from ARMmbed/iotthd-2695
Browse files Browse the repository at this point in the history
Added support for FHSS returned error's
  • Loading branch information
Juha Heiskanen authored Aug 16, 2018
2 parents 1a9acbd + 42122b7 commit be0aa9c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion source/MAC/IEEE802_15_4/mac_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ typedef enum mac_event_t {
MAC_TIMER_ACK,
MAC_TIMER_CCA,
MAC_TX_FAIL,
MAC_TX_TIMEOUT
MAC_TX_TIMEOUT,
MAC_UNKNOWN_DESTINATION,
} mac_event_t;

typedef enum mac_tx_status_type_t {
Expand Down
2 changes: 2 additions & 0 deletions source/MAC/IEEE802_15_4/mac_mcps_sap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,8 @@ static void mac_common_data_confirmation_handle (protocol_interface_rf_mac_setup
//Enable Radio
mac_mlme_mac_radio_enable(rf_mac_setup);
buf->status = MLME_TRANSACTION_EXPIRED;
} else if (m_event == MAC_UNKNOWN_DESTINATION) {
buf->status = MLME_UNAVAILABLE_KEY;
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions source/MAC/IEEE802_15_4/mac_pd_sap.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ void mac_pd_sap_state_machine(protocol_interface_rf_mac_setup_s *rf_mac_setup)
if (tx_handle_retval == -3) {
mac_tx_done_state_set(rf_mac_setup, MAC_CCA_FAIL);
return;
} else if (tx_handle_retval == -2) {
mac_tx_done_state_set(rf_mac_setup, MAC_UNKNOWN_DESTINATION);
return;
}
}
if (mac_plme_cca_req(rf_mac_setup) != 0) {
Expand Down Expand Up @@ -361,6 +364,9 @@ static int8_t mac_data_interface_tx_done_cb(protocol_interface_rf_mac_setup_s *r
if (tx_handle_retval == -3) {
mac_tx_done_state_set(rf_ptr, MAC_CCA_FAIL);
return -3;
} else if (tx_handle_retval == -2) {
mac_tx_done_state_set(rf_ptr, MAC_UNKNOWN_DESTINATION);
return -2;
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions source/MAC/IEEE802_15_4/sw_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,7 @@ static int8_t sw_mac_net_phy_tx_done(int8_t driver_id, uint8_t tx_handle, phy_li
phy_msg.message.mac15_4_pd_sap_confirm.cca_retry = cca_retry;
phy_msg.message.mac15_4_pd_sap_confirm.tx_retry = tx_retry;

mac_pd_sap_data_cb(driver->phy_sap_identifier, &phy_msg);
return 0;
return mac_pd_sap_data_cb(driver->phy_sap_identifier, &phy_msg);
}

static void bc_enable_timer_cb(int8_t timer_id, uint16_t slots)
Expand Down

0 comments on commit be0aa9c

Please sign in to comment.