mirror of https://github.com/ARMmbed/mbed-os.git
-useless static_config.h removed
parent
b2b106c431
commit
8862edefad
|
@ -20,7 +20,6 @@
|
||||||
#include "net_interface.h"
|
#include "net_interface.h"
|
||||||
#include "ip6string.h" //ip6tos
|
#include "ip6string.h" //ip6tos
|
||||||
#include "nsdynmemLIB.h"
|
#include "nsdynmemLIB.h"
|
||||||
#include "include/static_config.h"
|
|
||||||
#include "include/mesh_system.h"
|
#include "include/mesh_system.h"
|
||||||
#include "ns_event_loop.h"
|
#include "ns_event_loop.h"
|
||||||
#include "mesh_interface_types.h"
|
#include "mesh_interface_types.h"
|
||||||
|
|
|
@ -1,184 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2015 ARM Limited. All rights reserved.
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __INCLUDE_STATIC_CONFIG__
|
|
||||||
#define __INCLUDE_STATIC_CONFIG__
|
|
||||||
#include "ns_types.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_HEAP_SIZE
|
|
||||||
#define MBED_MESH_API_HEAP_SIZE MBED_CONF_MBED_MESH_API_HEAP_SIZE
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_HEAP_SIZE 32500
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Channel list is defined as 1 shifted by the channel number
|
|
||||||
* f.e.:
|
|
||||||
* channel 4 = 1<<4.
|
|
||||||
* channel 10 = 1<<10
|
|
||||||
*
|
|
||||||
* Channel page.
|
|
||||||
* -for scan channels 0-10 use value 2 = CHANNEL_PAGE_2
|
|
||||||
* -for scan channels 11-26 use value 0 = CHANNEL_PAGE_0
|
|
||||||
* Possible channels are 0,1,2,3,4,5,6,9,10, see arm_hal_phy.h for details
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL_PAGE
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_CHANNEL_PAGE MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL_PAGE
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_CHANNEL_PAGE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_CHANNEL MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_CHANNEL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL_MASK
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_CHANNEL_MASK MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL_MASK
|
|
||||||
#elif defined MBED_MESH_API_6LOWPAN_ND_CHANNEL
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_CHANNEL_MASK (1<<MBED_MESH_API_6LOWPAN_ND_CHANNEL)
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_CHANNEL_MASK (1<<12)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_6LOWPAN_ND_SECURITY_MODE
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_SECURITY_MODE MBED_CONF_MBED_MESH_API_6LOWPAN_ND_SECURITY_MODE
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_SECURITY_MODE NONE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PSK_KEY_ID
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_PSK_KEY_ID MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PSK_KEY_ID
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_PSK_KEY_ID 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PSK_KEY
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_PSK_KEY MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PSK_KEY
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_PSK_KEY {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_6LOWPAN_ND_SEC_LEVEL
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_SEC_LEVEL MBED_CONF_MBED_MESH_API_6LOWPAN_ND_SEC_LEVEL
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_SEC_LEVEL 5
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PANID_FILTER
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_PANID_FILTER MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PANID_FILTER
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_6LOWPAN_ND_PANID_FILTER 0xffff
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Thread configuration */
|
|
||||||
// PSKd, must be longer than 6
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_PSKD
|
|
||||||
#define MBED_MESH_API_THREAD_PSKD MBED_CONF_MBED_MESH_API_THREAD_PSKD
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_PSKD "abcdefghijklmno"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Operating mode, values: Router, SED
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_DEVICE_TYPE
|
|
||||||
#define MBED_MESH_API_THREAD_DEVICE_TYPE MBED_CONF_MBED_MESH_API_THREAD_DEVICE_TYPE
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_DEVICE_TYPE MESH_DEVICE_TYPE_THREAD_ROUTER
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// channel mask, enable all channels
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL_MASK
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_CHANNEL_MASK MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL_MASK
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_CHANNEL_MASK 0x07fff800
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL_PAGE
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_CHANNEL_PAGE MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL_PAGE
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_CHANNEL_PAGE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_CHANNEL MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_CHANNEL 22
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Default PANID
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_CONFIG_PANID
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_PANID MBED_CONF_MBED_MESH_API_THREAD_CONFIG_PANID
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_PANID 0x0700
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// extended PANID
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_CONFIG_EXTENDED_PANID
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_EXTENDED_PANID MBED_CONF_MBED_MESH_API_THREAD_CONFIG_EXTENDED_PANID
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_EXTENDED_PANID {0xf1, 0xb5, 0xa1, 0xb2,0xc4, 0xd5, 0xa1, 0xbd }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// network name
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME MBED_CONF_MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME "Thread Network"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// is static config used?
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_USE_STATIC_LINK_CONFIG
|
|
||||||
#define MBED_MESH_API_THREAD_USE_STATIC_LINK_CONFIG MBED_CONF_MBED_MESH_API_THREAD_USE_STATIC_LINK_CONFIG
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_USE_STATIC_LINK_CONFIG 0X1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// commissioning dataset timestamp
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_CONFIG_COMMISSIONING_DATASET_TIMESTAMP
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_COMMISSIONING_DATASET_TIMESTAMP MBED_CONF_MBED_MESH_API_THREAD_CONFIG_COMMISSIONING_DATASET_TIMESTAMP
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_COMMISSIONING_DATASET_TIMESTAMP 0X1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_MASTER_KEY
|
|
||||||
#define MBED_MESH_API_THREAD_MASTER_KEY MBED_CONF_MBED_MESH_API_THREAD_MASTER_KEY
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_MASTER_KEY {0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_CONFIG_ML_PREFIX
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_ML_PREFIX MBED_CONF_MBED_MESH_API_THREAD_CONFIG_ML_PREFIX
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_ML_PREFIX {0xfd, 0x0, 0x0d, 0xb8, 0x0, 0x0, 0x0, 0x0}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined MBED_CONF_MBED_MESH_API_THREAD_CONFIG_PSKC
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_PSKC MBED_CONF_MBED_MESH_API_THREAD_CONFIG_PSKC
|
|
||||||
#else
|
|
||||||
#define MBED_MESH_API_THREAD_CONFIG_PSKC {0xc8, 0xa6, 0x2e, 0xae, 0xf3, 0x68, 0xf3, 0x46, 0xa9, 0x9e, 0x57, 0x85, 0x98, 0x9d, 0x1c, 0xd0}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif /* __INCLUDE_STATIC_CONFIG__ */
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include "randLIB.h"
|
#include "randLIB.h"
|
||||||
#include "platform/arm_hal_timer.h"
|
#include "platform/arm_hal_timer.h"
|
||||||
#include "ns_hal_init.h"
|
#include "ns_hal_init.h"
|
||||||
#include "include/static_config.h"
|
|
||||||
#include "include/mesh_system.h"
|
#include "include/mesh_system.h"
|
||||||
// For tracing we need to define flag, have include and define group
|
// For tracing we need to define flag, have include and define group
|
||||||
#define HAVE_DEBUG 1
|
#define HAVE_DEBUG 1
|
||||||
|
@ -29,7 +28,7 @@
|
||||||
#define TRACE_GROUP "m6-mesh-system"
|
#define TRACE_GROUP "m6-mesh-system"
|
||||||
|
|
||||||
/* Heap for NanoStack */
|
/* Heap for NanoStack */
|
||||||
static uint8_t app_stack_heap[MBED_MESH_API_HEAP_SIZE + 1];
|
static uint8_t app_stack_heap[MBED_CONF_MBED_MESH_API_HEAP_SIZE + 1];
|
||||||
static bool mesh_initialized = false;
|
static bool mesh_initialized = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -56,7 +55,7 @@ static void mesh_system_heap_error_handler(heap_fail_t event)
|
||||||
void mesh_system_init(void)
|
void mesh_system_init(void)
|
||||||
{
|
{
|
||||||
if (mesh_initialized == false) {
|
if (mesh_initialized == false) {
|
||||||
ns_hal_init(app_stack_heap, MBED_MESH_API_HEAP_SIZE,
|
ns_hal_init(app_stack_heap, MBED_CONF_MBED_MESH_API_HEAP_SIZE,
|
||||||
mesh_system_heap_error_handler, NULL);
|
mesh_system_heap_error_handler, NULL);
|
||||||
eventOS_scheduler_mutex_wait();
|
eventOS_scheduler_mutex_wait();
|
||||||
net_init_core();
|
net_init_core();
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include "ip6string.h" //ip6tos
|
#include "ip6string.h" //ip6tos
|
||||||
#include "nsdynmemLIB.h"
|
#include "nsdynmemLIB.h"
|
||||||
#include "include/nd_tasklet.h"
|
#include "include/nd_tasklet.h"
|
||||||
#include "include/static_config.h"
|
|
||||||
#include "include/mesh_system.h"
|
#include "include/mesh_system.h"
|
||||||
#include "ns_event_loop.h"
|
#include "ns_event_loop.h"
|
||||||
|
|
||||||
|
@ -87,15 +86,15 @@ void nd_tasklet_trace_bootstrap_info(void);
|
||||||
|
|
||||||
static void initialize_channel_list(void)
|
static void initialize_channel_list(void)
|
||||||
{
|
{
|
||||||
uint32_t channel = MBED_MESH_API_6LOWPAN_ND_CHANNEL;
|
uint32_t channel = MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL;
|
||||||
|
|
||||||
const int_fast8_t word_index = channel / 32;
|
const int_fast8_t word_index = channel / 32;
|
||||||
const int_fast8_t bit_index = channel % 32;
|
const int_fast8_t bit_index = channel % 32;
|
||||||
|
|
||||||
memset(&tasklet_data_ptr->channel_list, 0, sizeof(tasklet_data_ptr->channel_list));
|
memset(&tasklet_data_ptr->channel_list, 0, sizeof(tasklet_data_ptr->channel_list));
|
||||||
|
|
||||||
tasklet_data_ptr->channel_list.channel_page = (channel_page_e)MBED_MESH_API_6LOWPAN_ND_CHANNEL_PAGE;
|
tasklet_data_ptr->channel_list.channel_page = (channel_page_e)MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL_PAGE;
|
||||||
tasklet_data_ptr->channel_list.channel_mask[0] = MBED_MESH_API_6LOWPAN_ND_CHANNEL_MASK;
|
tasklet_data_ptr->channel_list.channel_mask[0] = MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL_MASK;
|
||||||
|
|
||||||
if (channel > 0) {
|
if (channel > 0) {
|
||||||
memset(&tasklet_data_ptr->channel_list.channel_mask, 0, sizeof(tasklet_data_ptr->channel_list.channel_mask));
|
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)
|
||||||
tasklet_data_ptr->network_interface_id, tasklet_data_ptr->mode,
|
tasklet_data_ptr->network_interface_id, tasklet_data_ptr->mode,
|
||||||
NET_6LOWPAN_ND_WITH_MLE);
|
NET_6LOWPAN_ND_WITH_MLE);
|
||||||
|
|
||||||
sec_mode = STR(MBED_MESH_API_6LOWPAN_ND_SECURITY_MODE);
|
sec_mode = STR(MBED_CONF_MBED_MESH_API_6LOWPAN_ND_SECURITY_MODE);
|
||||||
|
|
||||||
if (strcmp(sec_mode, "PSK") == 0) {
|
if (strcmp(sec_mode, "PSK") == 0) {
|
||||||
tr_debug("Using PSK security mode.");
|
tr_debug("Using PSK security mode.");
|
||||||
tasklet_data_ptr->sec_mode = NET_SEC_MODE_PSK_LINK_SECURITY;
|
tasklet_data_ptr->sec_mode = NET_SEC_MODE_PSK_LINK_SECURITY;
|
||||||
tasklet_data_ptr->psk_sec_info.key_id = MBED_MESH_API_6LOWPAN_ND_PSK_KEY_ID;
|
tasklet_data_ptr->psk_sec_info.key_id = MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PSK_KEY_ID;
|
||||||
memcpy(tasklet_data_ptr->psk_sec_info.security_key, (const uint8_t[16])MBED_MESH_API_6LOWPAN_ND_PSK_KEY, 16);
|
memcpy(tasklet_data_ptr->psk_sec_info.security_key, (const uint8_t[16])MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PSK_KEY, 16);
|
||||||
} else {
|
} else {
|
||||||
tr_debug("Link-layer security NOT enabled.");
|
tr_debug("Link-layer security NOT enabled.");
|
||||||
tasklet_data_ptr->sec_mode = NET_SEC_MODE_NO_LINK_SECURITY;
|
tasklet_data_ptr->sec_mode = NET_SEC_MODE_NO_LINK_SECURITY;
|
||||||
|
@ -249,7 +248,7 @@ void nd_tasklet_configure_and_connect_to_network(void)
|
||||||
arm_nwk_link_layer_security_mode(
|
arm_nwk_link_layer_security_mode(
|
||||||
tasklet_data_ptr->network_interface_id,
|
tasklet_data_ptr->network_interface_id,
|
||||||
tasklet_data_ptr->sec_mode,
|
tasklet_data_ptr->sec_mode,
|
||||||
MBED_MESH_API_6LOWPAN_ND_SEC_LEVEL,
|
MBED_CONF_MBED_MESH_API_6LOWPAN_ND_SEC_LEVEL,
|
||||||
&tasklet_data_ptr->psk_sec_info);
|
&tasklet_data_ptr->psk_sec_info);
|
||||||
|
|
||||||
// configure scan parameters
|
// configure scan parameters
|
||||||
|
@ -264,7 +263,7 @@ void nd_tasklet_configure_and_connect_to_network(void)
|
||||||
|
|
||||||
arm_nwk_6lowpan_link_panid_filter_for_nwk_scan(
|
arm_nwk_6lowpan_link_panid_filter_for_nwk_scan(
|
||||||
tasklet_data_ptr->network_interface_id,
|
tasklet_data_ptr->network_interface_id,
|
||||||
MBED_MESH_API_6LOWPAN_ND_PANID_FILTER);
|
MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PANID_FILTER);
|
||||||
|
|
||||||
status = arm_nwk_interface_up(tasklet_data_ptr->network_interface_id);
|
status = arm_nwk_interface_up(tasklet_data_ptr->network_interface_id);
|
||||||
if (status >= 0) {
|
if (status >= 0) {
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "thread_management_if.h"
|
#include "thread_management_if.h"
|
||||||
#include "net_polling_api.h"
|
#include "net_polling_api.h"
|
||||||
#include "include/thread_tasklet.h"
|
#include "include/thread_tasklet.h"
|
||||||
#include "include/static_config.h"
|
|
||||||
#include "include/mesh_system.h"
|
#include "include/mesh_system.h"
|
||||||
#include <mbed_assert.h>
|
#include <mbed_assert.h>
|
||||||
#include "ns_event_loop.h"
|
#include "ns_event_loop.h"
|
||||||
|
@ -207,26 +206,26 @@ void thread_tasklet_parse_network_event(arm_event_s *event)
|
||||||
|
|
||||||
void read_link_configuration() {
|
void read_link_configuration() {
|
||||||
|
|
||||||
thread_tasklet_data_ptr->link_config.panId = MBED_MESH_API_THREAD_CONFIG_PANID;
|
thread_tasklet_data_ptr->link_config.panId = MBED_CONF_MBED_MESH_API_THREAD_CONFIG_PANID;
|
||||||
TRACE_DETAIL("PANID %x", thread_tasklet_data_ptr->link_config.panId);
|
TRACE_DETAIL("PANID %x", thread_tasklet_data_ptr->link_config.panId);
|
||||||
|
|
||||||
thread_tasklet_data_ptr->link_config.rfChannel = MBED_MESH_API_THREAD_CONFIG_CHANNEL;
|
thread_tasklet_data_ptr->link_config.rfChannel = MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL;
|
||||||
TRACE_DETAIL("channel: %d", thread_tasklet_data_ptr->link_config.rfChannel);
|
TRACE_DETAIL("channel: %d", thread_tasklet_data_ptr->link_config.rfChannel);
|
||||||
|
|
||||||
// Mesh prefix
|
// Mesh prefix
|
||||||
const uint8_t mesh_local_prefix[] = MBED_MESH_API_THREAD_CONFIG_ML_PREFIX;
|
const uint8_t mesh_local_prefix[] = MBED_CONF_MBED_MESH_API_THREAD_CONFIG_ML_PREFIX;
|
||||||
MBED_ASSERT(sizeof(mesh_local_prefix) == 8);
|
MBED_ASSERT(sizeof(mesh_local_prefix) == 8);
|
||||||
|
|
||||||
memcpy(thread_tasklet_data_ptr->link_config.mesh_local_ula_prefix, mesh_local_prefix, 8);
|
memcpy(thread_tasklet_data_ptr->link_config.mesh_local_ula_prefix, mesh_local_prefix, 8);
|
||||||
TRACE_DETAIL("Mesh prefix: %s", trace_array(mesh_local_prefix, 8));
|
TRACE_DETAIL("Mesh prefix: %s", trace_array(mesh_local_prefix, 8));
|
||||||
|
|
||||||
// Master Key
|
// Master Key
|
||||||
const uint8_t master_key[] = MBED_MESH_API_THREAD_MASTER_KEY;
|
const uint8_t master_key[] = MBED_CONF_MBED_MESH_API_THREAD_MASTER_KEY;
|
||||||
MBED_ASSERT(sizeof(master_key) == 16);
|
MBED_ASSERT(sizeof(master_key) == 16);
|
||||||
memcpy(thread_tasklet_data_ptr->link_config.master_key, master_key, 16);
|
memcpy(thread_tasklet_data_ptr->link_config.master_key, master_key, 16);
|
||||||
|
|
||||||
// PSKc
|
// PSKc
|
||||||
const uint8_t PSKc[] = MBED_MESH_API_THREAD_CONFIG_PSKC;
|
const uint8_t PSKc[] = MBED_CONF_MBED_MESH_API_THREAD_CONFIG_PSKC;
|
||||||
MBED_ASSERT(sizeof(PSKc) == 16);
|
MBED_ASSERT(sizeof(PSKc) == 16);
|
||||||
memcpy(thread_tasklet_data_ptr->link_config.PSKc, PSKc, 16);
|
memcpy(thread_tasklet_data_ptr->link_config.PSKc, PSKc, 16);
|
||||||
|
|
||||||
|
@ -234,13 +233,13 @@ void read_link_configuration() {
|
||||||
thread_tasklet_data_ptr->link_config.key_sequence = 0;
|
thread_tasklet_data_ptr->link_config.key_sequence = 0;
|
||||||
|
|
||||||
// network name
|
// network name
|
||||||
MBED_ASSERT(strlen(MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME) > 0 && strlen(MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME) < 17);
|
MBED_ASSERT(strlen(MBED_CONF_MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME) > 0 && strlen(MBED_CONF_MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME) < 17);
|
||||||
memcpy(thread_tasklet_data_ptr->link_config.name, MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME, strlen(MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME));
|
memcpy(thread_tasklet_data_ptr->link_config.name, MBED_CONF_MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME, strlen(MBED_CONF_MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME));
|
||||||
|
|
||||||
thread_tasklet_data_ptr->link_config.timestamp = MBED_MESH_API_THREAD_CONFIG_COMMISSIONING_DATASET_TIMESTAMP;
|
thread_tasklet_data_ptr->link_config.timestamp = MBED_CONF_MBED_MESH_API_THREAD_CONFIG_COMMISSIONING_DATASET_TIMESTAMP;
|
||||||
|
|
||||||
// extended pan-id
|
// extended pan-id
|
||||||
const uint8_t extented_panid[] = MBED_MESH_API_THREAD_CONFIG_EXTENDED_PANID;
|
const uint8_t extented_panid[] = MBED_CONF_MBED_MESH_API_THREAD_CONFIG_EXTENDED_PANID;
|
||||||
MBED_ASSERT(sizeof(extented_panid) == 8);
|
MBED_ASSERT(sizeof(extented_panid) == 8);
|
||||||
memcpy(thread_tasklet_data_ptr->link_config.extented_pan_id, extented_panid, sizeof(extented_panid));
|
memcpy(thread_tasklet_data_ptr->link_config.extented_pan_id, extented_panid, sizeof(extented_panid));
|
||||||
}
|
}
|
||||||
|
@ -254,7 +253,7 @@ void thread_tasklet_configure_and_connect_to_network(void)
|
||||||
int8_t status;
|
int8_t status;
|
||||||
link_configuration_s* temp_link_config=NULL;
|
link_configuration_s* temp_link_config=NULL;
|
||||||
|
|
||||||
if (MBED_MESH_API_THREAD_DEVICE_TYPE == MESH_DEVICE_TYPE_THREAD_SLEEPY_END_DEVICE) {
|
if (MBED_CONF_MBED_MESH_API_THREAD_DEVICE_TYPE == MESH_DEVICE_TYPE_THREAD_SLEEPY_END_DEVICE) {
|
||||||
thread_tasklet_data_ptr->operating_mode = NET_6LOWPAN_SLEEPY_HOST;
|
thread_tasklet_data_ptr->operating_mode = NET_6LOWPAN_SLEEPY_HOST;
|
||||||
} else {
|
} else {
|
||||||
thread_tasklet_data_ptr->operating_mode = NET_6LOWPAN_ROUTER;
|
thread_tasklet_data_ptr->operating_mode = NET_6LOWPAN_ROUTER;
|
||||||
|
@ -265,14 +264,14 @@ void thread_tasklet_configure_and_connect_to_network(void)
|
||||||
thread_tasklet_data_ptr->operating_mode,
|
thread_tasklet_data_ptr->operating_mode,
|
||||||
NET_6LOWPAN_THREAD);
|
NET_6LOWPAN_THREAD);
|
||||||
|
|
||||||
thread_tasklet_data_ptr->channel_list.channel_page = (channel_page_e)MBED_MESH_API_THREAD_CONFIG_CHANNEL_PAGE;
|
thread_tasklet_data_ptr->channel_list.channel_page = (channel_page_e)MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL_PAGE;
|
||||||
thread_tasklet_data_ptr->channel_list.channel_mask[0] = MBED_MESH_API_THREAD_CONFIG_CHANNEL_MASK;
|
thread_tasklet_data_ptr->channel_list.channel_mask[0] = MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL_MASK;
|
||||||
|
|
||||||
TRACE_DETAIL("channel page: %d", thread_tasklet_data_ptr->channel_list.channel_page);
|
TRACE_DETAIL("channel page: %d", thread_tasklet_data_ptr->channel_list.channel_page);
|
||||||
TRACE_DETAIL("channel mask: %d", (int)thread_tasklet_data_ptr->channel_list.channel_mask[0]);
|
TRACE_DETAIL("channel mask: %d", (int)thread_tasklet_data_ptr->channel_list.channel_mask[0]);
|
||||||
|
|
||||||
// PSKd
|
// PSKd
|
||||||
const char PSKd[] = MBED_MESH_API_THREAD_PSKD;
|
const char PSKd[] = MBED_CONF_MBED_MESH_API_THREAD_PSKD;
|
||||||
MBED_ASSERT(sizeof(PSKd) > 5 && sizeof(PSKd) < 33);
|
MBED_ASSERT(sizeof(PSKd) > 5 && sizeof(PSKd) < 33);
|
||||||
|
|
||||||
char *dyn_buf = ns_dyn_mem_alloc(sizeof(PSKd));
|
char *dyn_buf = ns_dyn_mem_alloc(sizeof(PSKd));
|
||||||
|
@ -281,7 +280,7 @@ void thread_tasklet_configure_and_connect_to_network(void)
|
||||||
device_configuration.PSKd_ptr = (uint8_t*)dyn_buf;
|
device_configuration.PSKd_ptr = (uint8_t*)dyn_buf;
|
||||||
device_configuration.PSKd_len = sizeof(PSKd) - 1;
|
device_configuration.PSKd_len = sizeof(PSKd) - 1;
|
||||||
|
|
||||||
if (true == MBED_MESH_API_THREAD_USE_STATIC_LINK_CONFIG) {
|
if (true == MBED_CONF_MBED_MESH_API_THREAD_USE_STATIC_LINK_CONFIG) {
|
||||||
read_link_configuration();
|
read_link_configuration();
|
||||||
temp_link_config = &thread_tasklet_data_ptr->link_config;
|
temp_link_config = &thread_tasklet_data_ptr->link_config;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue