Skip to content

Commit

Permalink
Merge pull request ARMmbed#1843 from ARMmbed/address_reg_fix
Browse files Browse the repository at this point in the history
Call ws_secondary_parent_update inside primary set for reduce code size.
  • Loading branch information
Juha Heiskanen authored Oct 1, 2018
2 parents d6b4111 + 0b4aa78 commit f43e285
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
8 changes: 1 addition & 7 deletions source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2084,13 +2084,7 @@ void ws_primary_parent_update(protocol_interface_info_entry_t *interface, mac_ne
neighbor_info.ws_neighbor = ws_neighbor_class_entry_get(&interface->ws_info->neighbor_storage, neighbor->index);
ws_bootstrap_primary_parent_set(interface, &neighbor_info);

//Clear both address registration
ns_list_foreach(if_address_entry_t, address, &interface->ip_addresses) {
if (!addr_is_ipv6_link_local(address->address)) {
address->addr_reg_done = 0;
ws_address_registration_update(interface);
}
}
ws_secondary_parent_update(interface);
}
}

Expand Down
9 changes: 5 additions & 4 deletions source/6LoWPAN/ws/ws_llc_data_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,16 @@ static void ws_llc_mac_indication_cb(const mac_api_t* api, const mcps_data_ind_t
if (us_ie_inline) {
ws_neighbor_class_neighbor_unicast_schedule_set(neighbor_info.ws_neighbor, &us_ie);

if (neighbor_info.neighbor->link_role == PRIORITY_PARENT_NEIGHBOUR) {
// We have broadcast schedule set up set the broadcast parent schedule
ns_fhss_ws_set_parent(interface->ws_info->fhss_api, neighbor_info.neighbor->mac64, &neighbor_info.ws_neighbor->fhss_data.bc_timing_info);
}

}
//Update BT if it is part of message
ws_bt_ie_t ws_bt;
if (ws_wh_bt_read(ie_ext->headerIeList, ie_ext->headerIeListLength, &ws_bt)) {
ws_neighbor_class_neighbor_broadcast_time_info_update(neighbor_info.ws_neighbor, &ws_bt, data->timestamp);
if (neighbor_info.neighbor->link_role == PRIORITY_PARENT_NEIGHBOUR) {
// We have broadcast schedule set up set the broadcast parent schedule
ns_fhss_ws_set_parent(interface->ws_info->fhss_api, neighbor_info.neighbor->mac64, &neighbor_info.ws_neighbor->fhss_data.bc_timing_info);
}
}

//Refresh Neighbor if unicast
Expand Down
3 changes: 3 additions & 0 deletions source/Service_Libs/fhss/fhss_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
fhss_structure->ws->fhss_configuration.fhss_broadcast_interval = bc_timing_info->broadcast_interval;
fhss_set_txrx_slot_length(fhss_structure);
fhss_structure->ws->bc_slot = bc_timing_info->broadcast_slot + slots_since_reception;
if (fhss_structure->ws->fhss_configuration.ws_bc_channel_function == WS_TR51CF) {
fhss_structure->ws->bc_slot %= fhss_structure->number_of_channels;
}
platform_exit_critical();
//TODO: support multiple parents
fhss_structure->ws->parent_bc_info = bc_timing_info;
Expand Down

0 comments on commit f43e285

Please sign in to comment.