diff --git a/source/Service_Libs/fhss/fhss_ws.c b/source/Service_Libs/fhss/fhss_ws.c index d8b7505f24e..33fa61c2c5d 100644 --- a/source/Service_Libs/fhss/fhss_ws.c +++ b/source/Service_Libs/fhss/fhss_ws.c @@ -33,6 +33,8 @@ // Enable this flag to use channel traces #define FHSS_CHANNEL_DEBUG +static void fhss_ws_update_uc_channel_callback(fhss_structure_t *fhss_structure); + fhss_structure_t *fhss_ws_enable(fhss_api_t *fhss_api, const fhss_ws_configuration_t *fhss_configuration, const fhss_timer_t *fhss_timer) { if (!fhss_api || !fhss_configuration || !fhss_timer) { @@ -111,6 +113,14 @@ static int fhss_ws_handle_state_set(fhss_structure_t *fhss_structure, fhss_state { (void) pan_id; if (fhss_state == FHSS_SYNCHRONIZED) { + uint32_t fhss_broadcast_interval = fhss_structure->fhss_conf.fhss_ws_configuration.fhss_broadcast_interval; + uint8_t fhss_bc_dwell_interval = fhss_structure->fhss_conf.fhss_ws_configuration.fhss_bc_dwell_interval; + // Start broadcast schedule when BC intervals are known + if (fhss_broadcast_interval && fhss_bc_dwell_interval) { + fhss_broadcast_handler(fhss_structure->fhss_api, 0); + } + // Start unicast schedule + fhss_ws_update_uc_channel_callback(fhss_structure); fhss_start_timer(fhss_structure, fhss_structure->fhss_conf.fhss_ws_configuration.fhss_uc_dwell_interval*1000, fhss_superframe_handler); }