Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 7d4a2f8

Browse files
author
Jarkko Paso
committed
FHSS: Start broadcast schedule when bc intervals are known
1 parent e55ec8a commit 7d4a2f8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
// Enable this flag to use channel traces
3434
#define FHSS_CHANNEL_DEBUG
3535

36+
static void fhss_ws_update_uc_channel_callback(fhss_structure_t *fhss_structure);
37+
3638
fhss_structure_t *fhss_ws_enable(fhss_api_t *fhss_api, const fhss_ws_configuration_t *fhss_configuration, const fhss_timer_t *fhss_timer)
3739
{
3840
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
111113
{
112114
(void) pan_id;
113115
if (fhss_state == FHSS_SYNCHRONIZED) {
116+
uint32_t fhss_broadcast_interval = fhss_structure->fhss_conf.fhss_ws_configuration.fhss_broadcast_interval;
117+
uint8_t fhss_bc_dwell_interval = fhss_structure->fhss_conf.fhss_ws_configuration.fhss_bc_dwell_interval;
118+
// Start broadcast schedule when BC intervals are known
119+
if (fhss_broadcast_interval && fhss_bc_dwell_interval) {
120+
fhss_broadcast_handler(fhss_structure->fhss_api, 0);
121+
}
122+
// Start unicast schedule
123+
fhss_ws_update_uc_channel_callback(fhss_structure);
114124
fhss_start_timer(fhss_structure, fhss_structure->fhss_conf.fhss_ws_configuration.fhss_uc_dwell_interval*1000, fhss_superframe_handler);
115125
}
116126

0 commit comments

Comments
 (0)