Skip to content

Commit a2ef56a

Browse files
author
Juha Heiskanen
committed
wi-sun update:
Added BT info check for synch to parent. Removed parent set after Advertisment scan. Change-Id: Ia493eb64a6fcecf75c667a66e84fd9718c0aa90c
1 parent ca9fd4f commit a2ef56a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,12 @@ static int8_t ws_fhss_enable(protocol_interface_info_entry_t *cur)
451451
*/
452452
static void ws_bootstrap_primary_parent_set(struct protocol_interface_info_entry *cur, llc_neighbour_req_t *neighbor_info)
453453
{
454+
if (neighbor_info->ws_neighbor->fhss_data.bc_timing_info.broadcast_dwell_interval == 0 ||
455+
neighbor_info->ws_neighbor->fhss_data.bc_timing_info.broadcast_interval == 0) {
456+
tr_debug("Parent synch fail by missing BT information");
457+
return;
458+
}
459+
454460

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

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

477481
// Update LLC to follow updated fhss settings
478482
ws_bootstrap_llc_hopping_update(cur,&fhss_configuration);
@@ -1840,7 +1844,7 @@ void ws_bootstrap_network_scan_process(protocol_interface_info_entry_t *cur)
18401844
return;
18411845
}
18421846

1843-
ws_bootstrap_primary_parent_set(cur, &neighbor_info);
1847+
//ws_bootstrap_primary_parent_set(cur, &neighbor_info);
18441848
ws_bootstrap_network_information_learn(cur);
18451849
ws_bootstrap_fhss_activate(cur);
18461850
ws_bootstrap_event_authentication_start(cur);

0 commit comments

Comments
 (0)