Skip to content

Commit 6163e6f

Browse files
Review changes corrected
1 parent 4440612 commit 6163e6f

File tree

4 files changed

+7
-116
lines changed

4 files changed

+7
-116
lines changed

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

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"help": "default network name for wisun network",
114114
"value": "\"NETWORK_NAME\""
115115
},
116-
"wisun-regulator-domain": {
116+
"wisun-regulatory-domain": {
117117
"help": "Regulator domain.",
118118
"value": "3"
119119
},
@@ -146,32 +146,12 @@
146146
"value": 0
147147
},
148148
"wisun-bc-dwell-interval": {
149-
"help": "Broadcast dwell interval. Range: 15-250 milliseconds",
149+
"help": "Broadcast dwell interval. Range: 15-255 milliseconds",
150150
"value": 0
151151
},
152152
"wisun-uc-dwell-interval": {
153-
"help": "Unicast dwell interval. Range: 15-250 milliseconds",
153+
"help": "Unicast dwell interval. Range: 15-255 milliseconds",
154154
"value": 0
155-
},
156-
"wisun-device-type": {
157-
"help": "Device mode (NET_6LOWPAN_ROUTER or NET_6LOWPAN_HOST). Router is routing packets from other device, creating a mesh network.",
158-
"value": "NET_6LOWPAN_ROUTER"
159-
},
160-
"wisun-nd-channel-mask": {
161-
"help": "Channel mask, bit-mask of channels to use. [0-0x07fff800]",
162-
"value": "0x7fff800"
163-
},
164-
"wisun-nd-channel-page": {
165-
"help": "0 for 2.4 GHz and 2 for sub-GHz radios.",
166-
"value": 0
167-
},
168-
"wisun-nd-channel": {
169-
"help": "RF channel to use when `channel_mask` is not defined. [0-26].",
170-
"value": 0
171-
},
172-
"wisun-nd-panid-filter": {
173-
"help": "Beacon PAN ID filter, 0xffff means no filtering. [0-0xffff]",
174-
"value": "0xffff"
175155
}
176156
},
177157
"target_overrides": {

features/nanostack/mbed-mesh-api/source/WisunInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "randLIB.h"
2323

2424
#include "ns_trace.h"
25-
#define TRACE_GROUP "wisuI"
25+
#define TRACE_GROUP "WSIn"
2626

2727
class Nanostack::WisunInterface : public Nanostack::MeshInterface {
2828
public:

features/nanostack/mbed-mesh-api/source/wisun_tasklet.c

Lines changed: 3 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
// For tracing we need to define flag, have include and define group
3232
//#define HAVE_DEBUG
33-
#define TRACE_GROUP "wisuND"
33+
#define TRACE_GROUP "WSND"
3434
#include "ns_trace.h"
3535

3636
// Tasklet timer events
@@ -53,13 +53,11 @@ typedef enum {
5353
*/
5454
typedef struct {
5555
void (*mesh_api_cb)(mesh_connection_status_t nwk_status);
56-
channel_list_s channel_list;
5756
tasklet_state_t tasklet_state;
5857
int8_t tasklet;
5958
net_6lowpan_mode_e operating_mode;
6059
net_6lowpan_mode_extension_e operating_mode_extension;
6160
int8_t network_interface_id;
62-
uint8_t *mac;
6361
} wisun_tasklet_data_str_t;
6462

6563

@@ -75,36 +73,6 @@ static void wisun_tasklet_network_state_changed(mesh_connection_status_t status)
7573
static void wisun_tasklet_parse_network_event(arm_event_s *event);
7674
static void wisun_tasklet_configure_and_connect_to_network(void);
7775

78-
//#define TRACE_WISUN_TASKLET
79-
#ifndef TRACE_WISUN_TASKLET
80-
#define wisun_tasklet_trace_bootstrap_info() ((void) 0)
81-
#else
82-
void wisun_tasklet_trace_bootstrap_info(void);
83-
#endif
84-
85-
static void initialize_channel_list(void)
86-
{
87-
uint32_t channel = MBED_CONF_MBED_MESH_API_WISUN_ND_CHANNEL;
88-
89-
const int_fast8_t word_index = channel / 32;
90-
const int_fast8_t bit_index = channel % 32;
91-
92-
memset(&wisun_tasklet_data_ptr->channel_list, 0, sizeof(wisun_tasklet_data_ptr->channel_list));
93-
94-
wisun_tasklet_data_ptr->channel_list.channel_page = (channel_page_e)MBED_CONF_MBED_MESH_API_WISUN_ND_CHANNEL_PAGE;
95-
wisun_tasklet_data_ptr->channel_list.channel_mask[0] = MBED_CONF_MBED_MESH_API_WISUN_ND_CHANNEL_MASK;
96-
97-
if (channel > 0) {
98-
memset(&wisun_tasklet_data_ptr->channel_list.channel_mask, 0, sizeof(wisun_tasklet_data_ptr->channel_list.channel_mask));
99-
wisun_tasklet_data_ptr->channel_list.channel_mask[word_index] |= ((uint32_t) 1 << bit_index);
100-
}
101-
102-
arm_nwk_set_channel_list(wisun_tasklet_data_ptr->network_interface_id, &wisun_tasklet_data_ptr->channel_list);
103-
104-
tr_debug("Channel: %ld", channel);
105-
tr_debug("Channel page: %d", wisun_tasklet_data_ptr->channel_list.channel_page);
106-
tr_debug("Channel mask: 0x%.8lx", wisun_tasklet_data_ptr->channel_list.channel_mask[word_index]);
107-
}
10876
/*
10977
* \brief A function which will be eventually called by NanoStack OS when ever the OS has an event to deliver.
11078
* @param event, describes the sender, receiver and event type.
@@ -173,7 +141,6 @@ static void wisun_tasklet_parse_network_event(arm_event_s *event)
173141
if (wisun_tasklet_data_ptr->tasklet_state != TASKLET_STATE_BOOTSTRAP_READY) {
174142
tr_info("Wi-SUN bootstrap ready");
175143
wisun_tasklet_data_ptr->tasklet_state = TASKLET_STATE_BOOTSTRAP_READY;
176-
wisun_tasklet_trace_bootstrap_info();
177144
wisun_tasklet_network_state_changed(MESH_CONNECTED);
178145
}
179146
break;
@@ -235,30 +202,10 @@ static void wisun_tasklet_configure_and_connect_to_network(void)
235202
wisun_tasklet_data_ptr->operating_mode_extension);
236203

237204
ws_management_node_init(wisun_tasklet_data_ptr->network_interface_id,
238-
MBED_CONF_MBED_MESH_API_WISUN_REGULATOR_DOMAIN,
205+
MBED_CONF_MBED_MESH_API_WISUN_REGULATORY_DOMAIN,
239206
network_name,
240207
fhss_timer_ptr);
241208

242-
// configure scan parameters
243-
arm_nwk_6lowpan_link_scan_parameter_set(wisun_tasklet_data_ptr->network_interface_id, 5);
244-
245-
// configure scan channels
246-
initialize_channel_list();
247-
248-
// Configure scan options (NULL disables filter)
249-
arm_nwk_6lowpan_link_nwk_id_filter_for_nwk_scan(wisun_tasklet_data_ptr->network_interface_id, NULL);
250-
251-
arm_nwk_6lowpan_link_panid_filter_for_nwk_scan(
252-
wisun_tasklet_data_ptr->network_interface_id,
253-
MBED_CONF_MBED_MESH_API_WISUN_ND_PANID_FILTER);
254-
255-
// Enable MPL by default
256-
const uint8_t all_mpl_forwarders[16] = {0xff, 0x03, [15] = 0xfc};
257-
multicast_mpl_domain_subscribe(wisun_tasklet_data_ptr->network_interface_id,
258-
all_mpl_forwarders,
259-
MULTICAST_MPL_SEED_ID_DEFAULT,
260-
NULL);
261-
262209
status = arm_nwk_interface_up(wisun_tasklet_data_ptr->network_interface_id);
263210
if (status >= 0) {
264211
wisun_tasklet_data_ptr->tasklet_state = TASKLET_STATE_BOOTSTRAP_STARTED;
@@ -281,42 +228,6 @@ static void wisun_tasklet_network_state_changed(mesh_connection_status_t status)
281228
}
282229
}
283230

284-
/*
285-
* Trace bootstrap information.
286-
*/
287-
#ifdef TRACE_WISUN_TASKLET
288-
void wisun_tasklet_trace_bootstrap_info()
289-
{
290-
network_layer_address_s app_nd_address_info;
291-
link_layer_address_s app_link_address_info;
292-
uint8_t temp_ipv6[16];
293-
if (arm_nwk_nd_address_read(wisun_tasklet_data_ptr->network_interface_id, &app_nd_address_info) != 0) {
294-
tr_error("WS Address read fail");
295-
} else {
296-
tr_debug("WS Access Point: %s", trace_ipv6(app_nd_address_info.border_router));
297-
tr_debug("WS Prefix 64: %s", trace_array(app_nd_address_info.prefix, 8));
298-
299-
if (arm_net_address_get(wisun_tasklet_data_ptr->network_interface_id, ADDR_IPV6_GP, temp_ipv6) == 0) {
300-
tr_debug("GP IPv6: %s", trace_ipv6(temp_ipv6));
301-
}
302-
}
303-
304-
if (arm_nwk_mac_address_read(wisun_tasklet_data_ptr->network_interface_id, &app_link_address_info) != 0) {
305-
tr_error("MAC Address read fail\n");
306-
} else {
307-
uint8_t temp[2];
308-
common_write_16_bit(app_link_address_info.mac_short, temp);
309-
tr_debug("MAC 16-bit: %s", trace_array(temp, 2));
310-
common_write_16_bit(app_link_address_info.PANId, temp);
311-
tr_debug("PAN ID: %s", trace_array(temp, 2));
312-
tr_debug("MAC 64-bit: %s", trace_array(app_link_address_info.mac_long, 8));
313-
tr_debug("IID (Based on MAC 64-bit address): %s", trace_array(app_link_address_info.iid_eui64, 8));
314-
}
315-
316-
tr_debug("Channel: %d", arm_net_get_current_channel(wisun_tasklet_data_ptr->network_interface_id));
317-
}
318-
#endif /* #define TRACE_WISUN_TASKLET */
319-
320231
/* Public functions */
321232
int8_t wisun_tasklet_get_router_ip_address(char *address, int8_t len)
322233
{
@@ -398,7 +309,7 @@ int8_t wisun_tasklet_network_init(int8_t device_id)
398309
// TODO, read interface name from configuration
399310
mac_description_storage_size_t storage_sizes;
400311
storage_sizes.device_decription_table_size = 32;
401-
storage_sizes.key_description_table_size = 6;
312+
storage_sizes.key_description_table_size = 4;
402313
storage_sizes.key_lookup_size = 1;
403314
storage_sizes.key_usage_size = 3;
404315
if (!mac_api) {

0 commit comments

Comments
 (0)