Skip to content

Commit be0aa9c

Browse files
author
Juha Heiskanen
authored
Merge pull request ARMmbed#1786 from ARMmbed/iotthd-2695
Added support for FHSS returned error's
2 parents 1a9acbd + 42122b7 commit be0aa9c

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

source/MAC/IEEE802_15_4/mac_defines.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ typedef enum mac_event_t {
3737
MAC_TIMER_ACK,
3838
MAC_TIMER_CCA,
3939
MAC_TX_FAIL,
40-
MAC_TX_TIMEOUT
40+
MAC_TX_TIMEOUT,
41+
MAC_UNKNOWN_DESTINATION,
4142
} mac_event_t;
4243

4344
typedef enum mac_tx_status_type_t {

source/MAC/IEEE802_15_4/mac_mcps_sap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,8 @@ static void mac_common_data_confirmation_handle (protocol_interface_rf_mac_setup
13591359
//Enable Radio
13601360
mac_mlme_mac_radio_enable(rf_mac_setup);
13611361
buf->status = MLME_TRANSACTION_EXPIRED;
1362+
} else if (m_event == MAC_UNKNOWN_DESTINATION) {
1363+
buf->status = MLME_UNAVAILABLE_KEY;
13621364
}
13631365
}
13641366
}

source/MAC/IEEE802_15_4/mac_pd_sap.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ void mac_pd_sap_state_machine(protocol_interface_rf_mac_setup_s *rf_mac_setup)
254254
if (tx_handle_retval == -3) {
255255
mac_tx_done_state_set(rf_mac_setup, MAC_CCA_FAIL);
256256
return;
257+
} else if (tx_handle_retval == -2) {
258+
mac_tx_done_state_set(rf_mac_setup, MAC_UNKNOWN_DESTINATION);
259+
return;
257260
}
258261
}
259262
if (mac_plme_cca_req(rf_mac_setup) != 0) {
@@ -361,6 +364,9 @@ static int8_t mac_data_interface_tx_done_cb(protocol_interface_rf_mac_setup_s *r
361364
if (tx_handle_retval == -3) {
362365
mac_tx_done_state_set(rf_ptr, MAC_CCA_FAIL);
363366
return -3;
367+
} else if (tx_handle_retval == -2) {
368+
mac_tx_done_state_set(rf_ptr, MAC_UNKNOWN_DESTINATION);
369+
return -2;
364370
}
365371
}
366372
}

source/MAC/IEEE802_15_4/sw_mac.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,7 @@ static int8_t sw_mac_net_phy_tx_done(int8_t driver_id, uint8_t tx_handle, phy_li
587587
phy_msg.message.mac15_4_pd_sap_confirm.cca_retry = cca_retry;
588588
phy_msg.message.mac15_4_pd_sap_confirm.tx_retry = tx_retry;
589589

590-
mac_pd_sap_data_cb(driver->phy_sap_identifier, &phy_msg);
591-
return 0;
590+
return mac_pd_sap_data_cb(driver->phy_sap_identifier, &phy_msg);
592591
}
593592

594593
static void bc_enable_timer_cb(int8_t timer_id, uint16_t slots)

0 commit comments

Comments
 (0)