Skip to content

Commit e19de33

Browse files
author
Jarkko Paso
committed
FHSS: WS to use Direct Hash channel function
- Not final implementation.
1 parent fb99776 commit e19de33

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
#include "fhss_api.h"
2020
#include "fhss_config.h"
2121
#include "fhss_common.h"
22+
#include "channel_functions.h"
23+
#include "ns_trace.h"
24+
25+
#define TRACE_GROUP "fhss"
26+
27+
// Enable this flag to use channel traces
28+
#define FHSS_CHANNEL_DEBUG
2229

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

3441
void fhss_ws_update_channel_callback(fhss_structure_t *fhss_structure)
3542
{
36-
43+
uint8_t mac_address[8];
44+
fhss_structure->callbacks.read_mac_address(fhss_structure->fhss_api, mac_address);
45+
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);
46+
fhss_structure->uc_channel_index++;
47+
#ifdef FHSS_CHANNEL_DEBUG
48+
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);
49+
#endif /*FHSS_CHANNEL_DEBUG*/
50+
fhss_structure->callbacks.change_channel(fhss_structure->fhss_api, next_channel);
3751
}

sources.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ SRCS += \
9393
source/Service_Libs/fhss/fhss.c \
9494
source/Service_Libs/fhss/fhss_ws.c \
9595
source/Service_Libs/fhss/fhss_common.c \
96+
source/Service_Libs/fhss/channel_functions.c \
9697
source/Service_Libs/fhss/channel_list.c \
9798
source/Service_Libs/fnv_hash/fnv_hash.c \
9899
source/Service_Libs/mle_service/mle_service.c \

0 commit comments

Comments
 (0)