From bcffa5f18441e7d60651fe105359ef39876b4bbc Mon Sep 17 00:00:00 2001 From: Jarkko Paso Date: Tue, 16 Oct 2018 10:28:21 +0300 Subject: [PATCH] FHSS: Fixed setting parent synch --- source/Service_Libs/fhss/fhss_ws.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/Service_Libs/fhss/fhss_ws.c b/source/Service_Libs/fhss/fhss_ws.c index f49042f3a28..8e91a790b0e 100644 --- a/source/Service_Libs/fhss/fhss_ws.c +++ b/source/Service_Libs/fhss/fhss_ws.c @@ -689,6 +689,9 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8], fhss_stop_timer(fhss_structure, fhss_broadcast_handler); uint32_t time_from_reception_ms = divide_integer(fhss_structure->callbacks.read_timestamp(fhss_structure->fhss_api) - bc_timing_info->bt_rx_timestamp, 1000); uint32_t true_bc_interval_offset = (bc_timing_info->broadcast_interval_offset + time_from_reception_ms) % bc_timing_info->broadcast_interval; + if (true_bc_interval_offset >= bc_timing_info->broadcast_dwell_interval) { + fhss_structure->ws->is_on_bc_channel = false; + } uint32_t timeout = ((bc_timing_info->broadcast_interval-true_bc_interval_offset)*1000); if (fhss_structure->ws->is_on_bc_channel) {