Skip to content

Commit

Permalink
Parent Broadcast synch fix and TR51CF slot define fix
Browse files Browse the repository at this point in the history
Fixed Broadcast slot calculation if we keep timing info over 1 second at queue

Fixed Parent synch after receiving BT-IE info.

Change-Id: Ia493380778ea20f5121d374a8afada7bcf9a7874
  • Loading branch information
Juha Heiskanen committed Oct 1, 2018
1 parent 1f4625e commit 0b4aa78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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 0b4aa78

Please sign in to comment.