Skip to content

Commit

Permalink
FHSS and Mac extension enable update.
Browse files Browse the repository at this point in the history
Return error if FHSS or mac extension are enabled and RF driver
extensions are not supported.
  • Loading branch information
Juha Heiskanen authored and juhhei01 committed Apr 27, 2018
1 parent 4859f16 commit e803974
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/MAC/IEEE802_15_4/sw_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ int ns_sw_mac_fhss_register(mac_api_t *mac_api, fhss_api_t *fhss_api)
if (!mac_setup) {
return -2;
}

if (!mac_setup->rf_csma_extension_supported) {
return -2;
}

// Assign FHSS API
mac_setup->fhss_api = fhss_api;
// Pass MAC functions to FHSS
Expand Down Expand Up @@ -235,8 +240,13 @@ static int8_t ns_sw_mac_api_enable_mcps_ext(mac_api_t *api, mcps_data_indication
if(api != mac_store.mac_api ){
return -1;
}

mac_api_t *cur = mac_store.mac_api;

if (!mac_store.setup->rf_csma_extension_supported) {
return -1;
}

cur->data_conf_ext_cb = data_cnf_cb;
cur->data_ind_ext_cb = data_ind_cb;
if (data_cnf_cb && data_ind_cb) {
Expand Down

0 comments on commit e803974

Please sign in to comment.