Skip to content

Commit

Permalink
FHSS: Added BSI in ws configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Feb 9, 2018
1 parent 7d4a2f8 commit 77c851a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions nanostack/fhss_config.h
Expand Up @@ -86,6 +86,9 @@ typedef struct fhss_ws_configuration
/** WS channel function. */
fhss_ws_channel_functions ws_channel_function;

/** Broadcast schedule identifier. */
uint16_t bsi;

/** Unicast dwell interval. Range: 15-250 milliseconds. */
uint8_t fhss_uc_dwell_interval;

Expand Down
6 changes: 2 additions & 4 deletions source/Service_Libs/fhss/fhss_ws.c
Expand Up @@ -63,14 +63,12 @@ static void fhss_ws_update_bc_channel(fhss_structure_t *fhss_structure)
if (fhss_structure->ws->channel_function == WS_FIXED_CHANNEL) {

} else if (fhss_structure->ws->channel_function == WS_TR51CF) {
// TODO: Second parameter is BSI which needs to be implemented in FHSS configurations
next_channel = tr51_get_bc_channel_index(fhss_structure->ws->bc_slot, 0xffff, fhss_structure->number_of_channels);
next_channel = tr51_get_bc_channel_index(fhss_structure->ws->bc_slot, fhss_structure->fhss_conf.fhss_ws_configuration.bsi, fhss_structure->number_of_channels);
if (++fhss_structure->ws->bc_slot == fhss_structure->number_of_channels) {
fhss_structure->ws->bc_slot = 0;
}
} else if (fhss_structure->ws->channel_function == WS_DH1CF) {
// TODO: Second parameter is BSI which needs to be implemented in FHSS configurations
next_channel = dh1cf_get_bc_channel_index(fhss_structure->ws->bc_slot, 0xffff, fhss_structure->number_of_channels);
next_channel = dh1cf_get_bc_channel_index(fhss_structure->ws->bc_slot, fhss_structure->fhss_conf.fhss_ws_configuration.bsi, fhss_structure->number_of_channels);
fhss_structure->ws->bc_slot++;
} else if (fhss_structure->ws->channel_function == WS_VENDOR_DEF_CF) {
//TODO: Callback to get channel schedule from application
Expand Down

0 comments on commit 77c851a

Please sign in to comment.