@@ -2052,6 +2052,19 @@ int ws_bootstrap_aro_failure(protocol_interface_info_entry_t *cur, const uint8_t
2052
2052
return 0 ;
2053
2053
}
2054
2054
2055
+ static int ws_bootstrap_set_domain_rf_config (protocol_interface_info_entry_t * cur )
2056
+ {
2057
+ phy_rf_channel_configuration_s rf_configs ;
2058
+ rf_configs .channel_0_center_frequency = (uint32_t )cur -> ws_info -> hopping_schdule .ch0_freq * 100000 ;
2059
+ rf_configs .channel_spacing = ws_decode_channel_spacing (cur -> ws_info -> hopping_schdule .channel_spacing );
2060
+ rf_configs .datarate = ws_get_datarate_using_operating_mode (cur -> ws_info -> hopping_schdule .operating_mode );
2061
+ rf_configs .modulation_index = ws_get_modulation_index_using_operating_mode (cur -> ws_info -> hopping_schdule .operating_mode );
2062
+ rf_configs .modulation = M_2FSK ;
2063
+ rf_configs .number_of_channels = cur -> ws_info -> hopping_schdule .number_of_channels ;
2064
+ ws_bootstrap_set_rf_config (cur , rf_configs );
2065
+ return 0 ;
2066
+ }
2067
+
2055
2068
static void ws_bootstrap_mac_activate (protocol_interface_info_entry_t * cur , uint16_t channel , uint16_t panid , bool coordinator )
2056
2069
{
2057
2070
mlme_start_t start_req ;
@@ -2484,6 +2497,7 @@ static void ws_bootstrap_network_discovery_configure(protocol_interface_info_ent
2484
2497
cur -> ws_info -> network_pan_id = 0xffff ;
2485
2498
2486
2499
ws_common_regulatory_domain_config (cur , & cur -> ws_info -> hopping_schdule );
2500
+ ws_bootstrap_set_domain_rf_config (cur );
2487
2501
ws_fhss_configure (cur , true);
2488
2502
2489
2503
//Set Network names, Pan information configure, hopping schedule & GTKHash
@@ -2909,12 +2923,18 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
2909
2923
if (cur -> bootsrap_mode == ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER ) {
2910
2924
tr_info ("Border router start network" );
2911
2925
2926
+
2912
2927
if (!ws_bbr_ready_to_start (cur )) {
2913
2928
// Wi-SUN not started yet we wait for Border router permission
2914
2929
ws_bootstrap_state_change (cur , ER_WAIT_RESTART );
2915
2930
cur -> nwk_nd_re_scan_count = randLIB_get_random_in_range (40 , 100 );
2916
2931
return ;
2917
2932
}
2933
+ // Clear Old information from stack
2934
+
2935
+ ws_nud_table_reset (cur );
2936
+ ws_bootstrap_neighbor_list_clean (cur );
2937
+ ws_bootstrap_ip_stack_reset (cur );
2918
2938
ws_pae_controller_auth_init (cur );
2919
2939
2920
2940
// Randomize fixed channels. Only used if channel plan is fixed.
@@ -2937,9 +2957,10 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
2937
2957
ws_bbr_pan_version_increase (cur );
2938
2958
2939
2959
// Set default parameters for FHSS when starting a discovery
2960
+ ws_common_regulatory_domain_config (cur , & cur -> ws_info -> hopping_schdule );
2940
2961
ws_fhss_border_router_configure (cur );
2962
+ ws_bootstrap_set_domain_rf_config (cur );
2941
2963
ws_bootstrap_fhss_activate (cur );
2942
- ws_bootstrap_event_operation_start (cur );
2943
2964
2944
2965
uint8_t ll_addr [16 ];
2945
2966
addr_interface_get_ll_address (cur , ll_addr , 1 );
@@ -2958,6 +2979,8 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
2958
2979
2959
2980
// Set PAE port to 10254 and authenticator relay to 10253 (and to own ll address)
2960
2981
ws_pae_controller_authenticator_start (cur , PAE_AUTH_SOCKET_PORT , ll_addr , EAPOL_RELAY_SOCKET_PORT );
2982
+
2983
+ ws_bootstrap_event_operation_start (cur );
2961
2984
break ;
2962
2985
}
2963
2986
ws_pae_controller_supp_init (cur );
0 commit comments