Skip to content

Commit

Permalink
FHSS: WS to use Direct Hash channel function
Browse files Browse the repository at this point in the history
- Not final implementation.
  • Loading branch information
Jarkko Paso committed Jan 24, 2018
1 parent fb99776 commit e19de33
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion source/Service_Libs/fhss/fhss_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
#include "fhss_api.h"
#include "fhss_config.h"
#include "fhss_common.h"
#include "channel_functions.h"
#include "ns_trace.h"

#define TRACE_GROUP "fhss"

// Enable this flag to use channel traces
#define FHSS_CHANNEL_DEBUG

int fhss_ws_handle_state_set(fhss_structure_t *fhss_structure, fhss_states fhss_state)
{
Expand All @@ -33,5 +40,12 @@ void fhss_ws_superframe_callback(fhss_structure_t *fhss_structure)

void fhss_ws_update_channel_callback(fhss_structure_t *fhss_structure)
{

uint8_t mac_address[8];
fhss_structure->callbacks.read_mac_address(fhss_structure->fhss_api, mac_address);
int32_t next_channel = fhss_structure->rx_channel = dh1cf_get_uc_channel_index(fhss_structure->uc_channel_index, mac_address, fhss_structure->number_of_channels);
fhss_structure->uc_channel_index++;
#ifdef FHSS_CHANNEL_DEBUG
tr_info("%"PRIu32" UC %u %u", fhss_structure->platform_functions.fhss_get_timestamp(fhss_structure->fhss_api), fhss_structure->uc_channel_index-1, next_channel);
#endif /*FHSS_CHANNEL_DEBUG*/
fhss_structure->callbacks.change_channel(fhss_structure->fhss_api, next_channel);
}
1 change: 1 addition & 0 deletions sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ SRCS += \
source/Service_Libs/fhss/fhss.c \
source/Service_Libs/fhss/fhss_ws.c \
source/Service_Libs/fhss/fhss_common.c \
source/Service_Libs/fhss/channel_functions.c \
source/Service_Libs/fhss/channel_list.c \
source/Service_Libs/fnv_hash/fnv_hash.c \
source/Service_Libs/mle_service/mle_service.c \
Expand Down

0 comments on commit e19de33

Please sign in to comment.