Skip to content

Commit c776eaa

Browse files
authored
Merge pull request #3987 from karsev/thread_link_config_update
thread link configuration bypass flag in mesh-api
2 parents a514216 + 8862ede commit c776eaa

File tree

6 files changed

+72
-251
lines changed

6 files changed

+72
-251
lines changed

features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/mbed_lib.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"6lowpan-nd-sec-level": 5,
1313
"6lowpan-nd-device-type": "NET_6LOWPAN_ROUTER",
1414
"thread-pskd": "\"abcdefghijklmno\"",
15+
"thread-use-static-link-config": true,
1516
"thread-config-channel-mask": "0x7fff800",
1617
"thread-config-channel-page": 0,
1718
"thread-config-channel": 22,

features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/source/ethernet_tasklet.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "net_interface.h"
2121
#include "ip6string.h" //ip6tos
2222
#include "nsdynmemLIB.h"
23-
#include "include/static_config.h"
2423
#include "include/mesh_system.h"
2524
#include "ns_event_loop.h"
2625
#include "mesh_interface_types.h"

features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/source/include/static_config.h

Lines changed: 0 additions & 177 deletions
This file was deleted.

features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/source/mesh_system.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@
2121
#include "randLIB.h"
2222
#include "platform/arm_hal_timer.h"
2323
#include "ns_hal_init.h"
24-
#include "include/static_config.h"
2524
#include "include/mesh_system.h"
2625
// For tracing we need to define flag, have include and define group
2726
#define HAVE_DEBUG 1
2827
#include "ns_trace.h"
2928
#define TRACE_GROUP "m6-mesh-system"
3029

3130
/* Heap for NanoStack */
32-
static uint8_t app_stack_heap[MBED_MESH_API_HEAP_SIZE + 1];
31+
static uint8_t app_stack_heap[MBED_CONF_MBED_MESH_API_HEAP_SIZE + 1];
3332
static bool mesh_initialized = false;
3433

3534
/*
@@ -56,7 +55,7 @@ static void mesh_system_heap_error_handler(heap_fail_t event)
5655
void mesh_system_init(void)
5756
{
5857
if (mesh_initialized == false) {
59-
ns_hal_init(app_stack_heap, MBED_MESH_API_HEAP_SIZE,
58+
ns_hal_init(app_stack_heap, MBED_CONF_MBED_MESH_API_HEAP_SIZE,
6059
mesh_system_heap_error_handler, NULL);
6160
eventOS_scheduler_mutex_wait();
6261
net_init_core();

features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/source/nd_tasklet.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "ip6string.h" //ip6tos
2222
#include "nsdynmemLIB.h"
2323
#include "include/nd_tasklet.h"
24-
#include "include/static_config.h"
2524
#include "include/mesh_system.h"
2625
#include "ns_event_loop.h"
2726

@@ -87,15 +86,15 @@ void nd_tasklet_trace_bootstrap_info(void);
8786

8887
static void initialize_channel_list(void)
8988
{
90-
uint32_t channel = MBED_MESH_API_6LOWPAN_ND_CHANNEL;
89+
uint32_t channel = MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL;
9190

9291
const int_fast8_t word_index = channel / 32;
9392
const int_fast8_t bit_index = channel % 32;
9493

9594
memset(&tasklet_data_ptr->channel_list, 0, sizeof(tasklet_data_ptr->channel_list));
9695

97-
tasklet_data_ptr->channel_list.channel_page = (channel_page_e)MBED_MESH_API_6LOWPAN_ND_CHANNEL_PAGE;
98-
tasklet_data_ptr->channel_list.channel_mask[0] = MBED_MESH_API_6LOWPAN_ND_CHANNEL_MASK;
96+
tasklet_data_ptr->channel_list.channel_page = (channel_page_e)MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL_PAGE;
97+
tasklet_data_ptr->channel_list.channel_mask[0] = MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL_MASK;
9998

10099
if (channel > 0) {
101100
memset(&tasklet_data_ptr->channel_list.channel_mask, 0, sizeof(tasklet_data_ptr->channel_list.channel_mask));
@@ -233,13 +232,13 @@ void nd_tasklet_configure_and_connect_to_network(void)
233232
tasklet_data_ptr->network_interface_id, tasklet_data_ptr->mode,
234233
NET_6LOWPAN_ND_WITH_MLE);
235234

236-
sec_mode = STR(MBED_MESH_API_6LOWPAN_ND_SECURITY_MODE);
235+
sec_mode = STR(MBED_CONF_MBED_MESH_API_6LOWPAN_ND_SECURITY_MODE);
237236

238237
if (strcmp(sec_mode, "PSK") == 0) {
239238
tr_debug("Using PSK security mode.");
240239
tasklet_data_ptr->sec_mode = NET_SEC_MODE_PSK_LINK_SECURITY;
241-
tasklet_data_ptr->psk_sec_info.key_id = MBED_MESH_API_6LOWPAN_ND_PSK_KEY_ID;
242-
memcpy(tasklet_data_ptr->psk_sec_info.security_key, (const uint8_t[16])MBED_MESH_API_6LOWPAN_ND_PSK_KEY, 16);
240+
tasklet_data_ptr->psk_sec_info.key_id = MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PSK_KEY_ID;
241+
memcpy(tasklet_data_ptr->psk_sec_info.security_key, (const uint8_t[16])MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PSK_KEY, 16);
243242
} else {
244243
tr_debug("Link-layer security NOT enabled.");
245244
tasklet_data_ptr->sec_mode = NET_SEC_MODE_NO_LINK_SECURITY;
@@ -249,7 +248,7 @@ void nd_tasklet_configure_and_connect_to_network(void)
249248
arm_nwk_link_layer_security_mode(
250249
tasklet_data_ptr->network_interface_id,
251250
tasklet_data_ptr->sec_mode,
252-
MBED_MESH_API_6LOWPAN_ND_SEC_LEVEL,
251+
MBED_CONF_MBED_MESH_API_6LOWPAN_ND_SEC_LEVEL,
253252
&tasklet_data_ptr->psk_sec_info);
254253

255254
// configure scan parameters
@@ -264,7 +263,7 @@ void nd_tasklet_configure_and_connect_to_network(void)
264263

265264
arm_nwk_6lowpan_link_panid_filter_for_nwk_scan(
266265
tasklet_data_ptr->network_interface_id,
267-
MBED_MESH_API_6LOWPAN_ND_PANID_FILTER);
266+
MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PANID_FILTER);
268267

269268
status = arm_nwk_interface_up(tasklet_data_ptr->network_interface_id);
270269
if (status >= 0) {

0 commit comments

Comments
 (0)