Skip to content

Commit b9187da

Browse files
author
Mika Tervonen
committed
Randomize fixed channel when making new parent selection
1 parent 34d0339 commit b9187da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2807,6 +2807,10 @@ void ws_bootstrap_network_scan_process(protocol_interface_info_entry_t *cur)
28072807
selected_parent_ptr = ws_bootstrap_candidate_parent_get_best(cur);
28082808

28092809
if (!selected_parent_ptr) {
2810+
// Configure LLC for network discovery
2811+
ws_bootstrap_network_discovery_configure(cur);
2812+
// randomize new channel and start MAC
2813+
ws_bootstrap_fhss_activate(cur);
28102814
// Next check will be after one trickle
28112815
cur->bootsrap_state_machine_cnt += cur->ws_info->trickle_params_pan_discovery.Imin + randLIB_get_8bit() % 50;
28122816
tr_info("Making parent selection in %u s", (cur->bootsrap_state_machine_cnt / 10));
@@ -2825,9 +2829,6 @@ void ws_bootstrap_network_scan_process(protocol_interface_info_entry_t *cur)
28252829
//Remove Neighbour and set Link setup back
28262830
ns_list_remove(&cur->ws_info->parent_list_reserved, selected_parent_ptr);
28272831
ns_list_add_to_end(&cur->ws_info->parent_list_free, selected_parent_ptr);
2828-
// Configure LLC for network discovery
2829-
ws_bootstrap_network_discovery_configure(cur);
2830-
ws_bootstrap_fhss_activate(cur);
28312832
goto select_best_candidate;
28322833
}
28332834

0 commit comments

Comments
 (0)