Skip to content

Commit

Permalink
wi-sun update:
Browse files Browse the repository at this point in the history
Added BT info check for synch to parent.

Removed parent set after Advertisment scan.

Change-Id: Ia493eb64a6fcecf75c667a66e84fd9718c0aa90c
  • Loading branch information
Juha Heiskanen committed Sep 19, 2018
1 parent ca9fd4f commit a2ef56a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,12 @@ static int8_t ws_fhss_enable(protocol_interface_info_entry_t *cur)
*/
static void ws_bootstrap_primary_parent_set(struct protocol_interface_info_entry *cur, llc_neighbour_req_t *neighbor_info)
{
if (neighbor_info->ws_neighbor->fhss_data.bc_timing_info.broadcast_dwell_interval == 0 ||
neighbor_info->ws_neighbor->fhss_data.bc_timing_info.broadcast_interval == 0) {
tr_debug("Parent synch fail by missing BT information");
return;
}


fhss_ws_configuration_t fhss_configuration;
memcpy(&fhss_configuration, ns_fhss_ws_configuration_get(cur->ws_info->fhss_api), sizeof(fhss_ws_configuration_t));
Expand All @@ -469,10 +475,8 @@ static void ws_bootstrap_primary_parent_set(struct protocol_interface_info_entry
fhss_configuration.broadcast_fixed_channel = cur->ws_info->fhss_bc_fixed_channel;
ns_fhss_ws_configuration_set(cur->ws_info->fhss_api, &fhss_configuration);

if (fhss_configuration.fhss_bc_dwell_interval && fhss_configuration.fhss_broadcast_interval) {
// We have broadcast schedule set up set the broadcast parent schedule
ns_fhss_ws_set_parent(cur->ws_info->fhss_api, neighbor_info->neighbor->mac64, &neighbor_info->ws_neighbor->fhss_data.bc_timing_info);
}
// We have broadcast schedule set up set the broadcast parent schedule
ns_fhss_ws_set_parent(cur->ws_info->fhss_api, neighbor_info->neighbor->mac64, &neighbor_info->ws_neighbor->fhss_data.bc_timing_info);

// Update LLC to follow updated fhss settings
ws_bootstrap_llc_hopping_update(cur,&fhss_configuration);
Expand Down Expand Up @@ -1840,7 +1844,7 @@ void ws_bootstrap_network_scan_process(protocol_interface_info_entry_t *cur)
return;
}

ws_bootstrap_primary_parent_set(cur, &neighbor_info);
//ws_bootstrap_primary_parent_set(cur, &neighbor_info);
ws_bootstrap_network_information_learn(cur);
ws_bootstrap_fhss_activate(cur);
ws_bootstrap_event_authentication_start(cur);
Expand Down

0 comments on commit a2ef56a

Please sign in to comment.