@@ -1088,6 +1088,7 @@ static void ws_bootstrap_start_configuration_learn(protocol_interface_info_entry
1088
1088
// Clear all temporary information
1089
1089
ws_bootstrap_ip_stack_reset (cur );
1090
1090
1091
+ cur -> ws_info -> pas_requests = 0 ;
1091
1092
// Reset advertisement solicit trickle to start discovering network
1092
1093
trickle_start (& cur -> ws_info -> trickle_pan_config_solicit , & trickle_params_pan_discovery );
1093
1094
trickle_inconsistent_heard (& cur -> ws_info -> trickle_pan_config_solicit , & trickle_params_pan_discovery );
@@ -1163,7 +1164,9 @@ static uint16_t ws_bootstrap_route_cost_calculate(protocol_interface_info_entry_
1163
1164
// Find selected parent from RPL
1164
1165
1165
1166
struct rpl_instance * best_instance = NULL ;
1166
-
1167
+ if (!cur -> rpl_domain ) {
1168
+ return 0xffff ;
1169
+ }
1167
1170
ns_list_foreach (struct rpl_instance , instance , & cur -> rpl_domain -> instances ) {
1168
1171
best_instance = instance ;
1169
1172
// Select best grounded and lowest rank? But there should be only one really
@@ -1300,7 +1303,6 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
1300
1303
ws_bootstrap_ip_stack_activate (cur );
1301
1304
ws_bootstrap_rpl_activate (cur );
1302
1305
ws_bootstrap_network_start (cur );
1303
- ws_bootstrap_advertise_start (cur );
1304
1306
// Wait for RPL start
1305
1307
if (cur -> bootsrap_mode == ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER ) {
1306
1308
ws_bootstrap_event_routing_ready (cur );
@@ -1311,6 +1313,7 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
1311
1313
break ;
1312
1314
case WS_ROUTING_READY :
1313
1315
tr_info ("Routing ready" );
1316
+ ws_bootstrap_advertise_start (cur );
1314
1317
ws_bootstrap_state_change (cur , ER_BOOTSRAP_DONE );
1315
1318
break ;
1316
1319
case WS_ADDRESS_ADDED :
@@ -1449,7 +1452,13 @@ void ws_bootstrap_seconds_timer(protocol_interface_info_entry_t *cur, uint32_t s
1449
1452
}
1450
1453
if (trickle_timer (& cur -> ws_info -> trickle_pan_config_solicit , & trickle_params_pan_discovery , seconds )) {
1451
1454
// send PAN Configuration solicit
1455
+ if (cur -> ws_info -> pas_requests > PCS_MAX ) {
1456
+ // if MAX PCS sent restart discovery
1457
+ ws_bootstrap_event_discovery_start (cur );
1458
+ return ;
1459
+ }
1452
1460
tr_info ("Send PAN configuration Solicit" );
1461
+ cur -> ws_info -> pas_requests ++ ;
1453
1462
ws_bootstrap_pan_config_solicit (cur );
1454
1463
}
1455
1464
if (trickle_timer (& cur -> ws_info -> trickle_pan_advertisement , & trickle_params_pan_discovery , seconds )) {
0 commit comments