@@ -383,7 +383,9 @@ static int8_t ws_fhss_set_defaults(protocol_interface_info_entry_t *cur, fhss_ws
383
383
fhss_configuration -> ws_bc_channel_function = cur -> ws_info -> fhss_bc_channel_function ;
384
384
fhss_configuration -> fhss_bc_dwell_interval = cur -> ws_info -> fhss_bc_dwell_interval ;
385
385
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
+ }
387
389
fhss_configuration -> broadcast_fixed_channel = cur -> ws_info -> fhss_bc_fixed_channel ;
388
390
ws_generate_channel_list (fhss_configuration -> channel_mask , cur -> ws_info -> hopping_schdule .number_of_channels , cur -> ws_info -> hopping_schdule .regulatory_domain );
389
391
@@ -490,7 +492,7 @@ static void ws_bootstrap_primary_parent_set(struct protocol_interface_info_entry
490
492
fhss_configuration .broadcast_fixed_channel = cur -> ws_info -> fhss_bc_fixed_channel ;
491
493
492
494
}
493
- fhss_configuration . unicast_fixed_channel = cur -> ws_info -> fhss_uc_fixed_channel ;
495
+
494
496
ns_fhss_ws_configuration_set (cur -> ws_info -> fhss_api , & fhss_configuration );
495
497
496
498
// 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)
1448
1450
ns_fhss_ws_set_hop_count (cur -> ws_info -> fhss_api , own_hop );
1449
1451
}
1450
1452
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
+ }
1451
1461
1452
1462
static void ws_bootstrap_rpl_callback (rpl_event_t event , void * handle )
1453
1463
{
@@ -1472,8 +1482,7 @@ static void ws_bootstrap_rpl_callback(rpl_event_t event, void *handle)
1472
1482
*/
1473
1483
1474
1484
} 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 );
1477
1486
}
1478
1487
cur -> ws_info -> rpl_state = event ;
1479
1488
tr_info ("RPL event %d" , event );
@@ -1861,6 +1870,7 @@ static void ws_bootstrap_event_handler(arm_event_s *event)
1861
1870
ws_bootstrap_state_change (cur , ER_BOOTSRAP_DONE );
1862
1871
break ;
1863
1872
case WS_ADDRESS_ADDED :
1873
+ cur -> ws_info -> address_registration_event_active = false;
1864
1874
if (!ws_bootstrap_address_registration_ongoing (cur )) {
1865
1875
rpl_control_register_address (cur , (if_address_entry_t * ) event -> data_ptr );
1866
1876
}
@@ -2052,6 +2062,26 @@ void ws_primary_parent_update(protocol_interface_info_entry_t *interface, mac_ne
2052
2062
neighbor_info .neighbor = neighbor ;
2053
2063
neighbor_info .ws_neighbor = ws_neighbor_class_entry_get (& interface -> ws_info -> neighbor_storage , neighbor -> index );
2054
2064
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
+ }
2055
2085
}
2056
2086
}
2057
2087
0 commit comments