@@ -383,7 +383,9 @@ static int8_t ws_fhss_set_defaults(protocol_interface_info_entry_t *cur, fhss_ws
383383 fhss_configuration -> ws_bc_channel_function = cur -> ws_info -> fhss_bc_channel_function ;
384384 fhss_configuration -> fhss_bc_dwell_interval = cur -> ws_info -> fhss_bc_dwell_interval ;
385385 fhss_configuration -> fhss_broadcast_interval = cur -> ws_info -> fhss_bc_interval ;
386- fhss_configuration -> unicast_fixed_channel = cur -> ws_info -> fhss_uc_fixed_channel ;
386+ if (cur -> ws_info -> fhss_uc_fixed_channel != 0xffff ) {
387+ fhss_configuration -> unicast_fixed_channel = cur -> ws_info -> fhss_uc_fixed_channel ;
388+ }
387389 fhss_configuration -> broadcast_fixed_channel = cur -> ws_info -> fhss_bc_fixed_channel ;
388390 ws_generate_channel_list (fhss_configuration -> channel_mask , cur -> ws_info -> hopping_schdule .number_of_channels , cur -> ws_info -> hopping_schdule .regulatory_domain );
389391
@@ -490,7 +492,7 @@ static void ws_bootstrap_primary_parent_set(struct protocol_interface_info_entry
490492 fhss_configuration .broadcast_fixed_channel = cur -> ws_info -> fhss_bc_fixed_channel ;
491493
492494 }
493- fhss_configuration . unicast_fixed_channel = cur -> ws_info -> fhss_uc_fixed_channel ;
495+
494496 ns_fhss_ws_configuration_set (cur -> ws_info -> fhss_api , & fhss_configuration );
495497
496498 // We have broadcast schedule set up set the broadcast parent schedule
@@ -1448,6 +1450,14 @@ static void ws_set_fhss_hop(protocol_interface_info_entry_t *cur)
14481450 ns_fhss_ws_set_hop_count (cur -> ws_info -> fhss_api , own_hop );
14491451}
14501452
1453+ static void ws_address_registration_update (protocol_interface_info_entry_t * interface )
1454+ {
1455+ if (!interface -> ws_info -> address_registration_event_active ) {
1456+ interface -> ws_info -> address_registration_event_active = true;
1457+ tr_info ("RPL parent update ... register ARO" );
1458+ ws_bootsrap_event_trig (WS_ADDRESS_ADDED , interface -> bootStrapId , ARM_LIB_LOW_PRIORITY_EVENT , NULL );
1459+ }
1460+ }
14511461
14521462static void ws_bootstrap_rpl_callback (rpl_event_t event , void * handle )
14531463{
@@ -1472,8 +1482,7 @@ static void ws_bootstrap_rpl_callback(rpl_event_t event, void *handle)
14721482 */
14731483
14741484 } else if (event == RPL_EVENT_DAO_PARENT_SWITCH ) {
1475- tr_info ("RPL parent update ... register ARO" );
1476- ws_bootsrap_event_trig (WS_ADDRESS_ADDED , cur -> bootStrapId , ARM_LIB_LOW_PRIORITY_EVENT , NULL );
1485+ ws_address_registration_update (cur );
14771486 }
14781487 cur -> ws_info -> rpl_state = event ;
14791488 tr_info ("RPL event %d" , event );
@@ -1861,6 +1870,7 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
18611870 ws_bootstrap_state_change (cur , ER_BOOTSRAP_DONE );
18621871 break ;
18631872 case WS_ADDRESS_ADDED :
1873+ cur -> ws_info -> address_registration_event_active = false;
18641874 if (!ws_bootstrap_address_registration_ongoing (cur )) {
18651875 rpl_control_register_address (cur , (if_address_entry_t * ) event -> data_ptr );
18661876 }
@@ -2052,6 +2062,26 @@ void ws_primary_parent_update(protocol_interface_info_entry_t *interface, mac_ne
20522062 neighbor_info .neighbor = neighbor ;
20532063 neighbor_info .ws_neighbor = ws_neighbor_class_entry_get (& interface -> ws_info -> neighbor_storage , neighbor -> index );
20542064 ws_bootstrap_primary_parent_set (interface , & neighbor_info );
2065+
2066+ //Clear both address registration
2067+ ns_list_foreach (if_address_entry_t , address , & interface -> ip_addresses ) {
2068+ if (!addr_is_ipv6_link_local (address -> address )) {
2069+ address -> addr_reg_done = 0 ;
2070+ ws_address_registration_update (interface );
2071+ }
2072+ }
2073+ }
2074+ }
2075+
2076+ void ws_secondary_parent_update (protocol_interface_info_entry_t * interface )
2077+ {
2078+ if (interface -> ws_info ) {
2079+ ns_list_foreach (if_address_entry_t , address , & interface -> ip_addresses ) {
2080+ if (!addr_is_ipv6_link_local (address -> address )) {
2081+ address -> addr_reg_done = 0 ;
2082+ ws_address_registration_update (interface );
2083+ }
2084+ }
20552085 }
20562086}
20572087
0 commit comments