Skip to content

Commit f43e285

Browse files
author
Juha Heiskanen
authored
Merge pull request ARMmbed#1843 from ARMmbed/address_reg_fix
Call ws_secondary_parent_update inside primary set for reduce code size.
2 parents d6b4111 + 0b4aa78 commit f43e285

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,13 +2084,7 @@ void ws_primary_parent_update(protocol_interface_info_entry_t *interface, mac_ne
20842084
neighbor_info.ws_neighbor = ws_neighbor_class_entry_get(&interface->ws_info->neighbor_storage, neighbor->index);
20852085
ws_bootstrap_primary_parent_set(interface, &neighbor_info);
20862086

2087-
//Clear both address registration
2088-
ns_list_foreach(if_address_entry_t, address, &interface->ip_addresses) {
2089-
if (!addr_is_ipv6_link_local(address->address)) {
2090-
address->addr_reg_done = 0;
2091-
ws_address_registration_update(interface);
2092-
}
2093-
}
2087+
ws_secondary_parent_update(interface);
20942088
}
20952089
}
20962090

source/6LoWPAN/ws/ws_llc_data_service.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,15 +521,16 @@ static void ws_llc_mac_indication_cb(const mac_api_t* api, const mcps_data_ind_t
521521
if (us_ie_inline) {
522522
ws_neighbor_class_neighbor_unicast_schedule_set(neighbor_info.ws_neighbor, &us_ie);
523523

524-
if (neighbor_info.neighbor->link_role == PRIORITY_PARENT_NEIGHBOUR) {
525-
// We have broadcast schedule set up set the broadcast parent schedule
526-
ns_fhss_ws_set_parent(interface->ws_info->fhss_api, neighbor_info.neighbor->mac64, &neighbor_info.ws_neighbor->fhss_data.bc_timing_info);
527-
}
524+
528525
}
529526
//Update BT if it is part of message
530527
ws_bt_ie_t ws_bt;
531528
if (ws_wh_bt_read(ie_ext->headerIeList, ie_ext->headerIeListLength, &ws_bt)) {
532529
ws_neighbor_class_neighbor_broadcast_time_info_update(neighbor_info.ws_neighbor, &ws_bt, data->timestamp);
530+
if (neighbor_info.neighbor->link_role == PRIORITY_PARENT_NEIGHBOUR) {
531+
// We have broadcast schedule set up set the broadcast parent schedule
532+
ns_fhss_ws_set_parent(interface->ws_info->fhss_api, neighbor_info.neighbor->mac64, &neighbor_info.ws_neighbor->fhss_data.bc_timing_info);
533+
}
533534
}
534535

535536
//Refresh Neighbor if unicast

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,9 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
682682
fhss_structure->ws->fhss_configuration.fhss_broadcast_interval = bc_timing_info->broadcast_interval;
683683
fhss_set_txrx_slot_length(fhss_structure);
684684
fhss_structure->ws->bc_slot = bc_timing_info->broadcast_slot + slots_since_reception;
685+
if (fhss_structure->ws->fhss_configuration.ws_bc_channel_function == WS_TR51CF) {
686+
fhss_structure->ws->bc_slot %= fhss_structure->number_of_channels;
687+
}
685688
platform_exit_critical();
686689
//TODO: support multiple parents
687690
fhss_structure->ws->parent_bc_info = bc_timing_info;

0 commit comments

Comments
 (0)