Skip to content

Commit 1b83d31

Browse files
authored
Merge pull request #12648 from artokin/nanostack_wisun_device_type_config
Nanostack: Add config for Wi-SUN device type
2 parents d048cd4 + 1b17179 commit 1b83d31

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

features/nanostack/mbed-mesh-api/mbed-mesh-api/mesh_interface_types.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ typedef enum {
5959
typedef enum {
6060
MESH_DEVICE_TYPE_THREAD_ROUTER = 0, /*<! Thread router */
6161
MESH_DEVICE_TYPE_THREAD_SLEEPY_END_DEVICE, /*<! Thread Sleepy end device */
62-
MESH_DEVICE_TYPE_THREAD_MINIMAL_END_DEVICE /*<! Thread minimal end device */
62+
MESH_DEVICE_TYPE_THREAD_MINIMAL_END_DEVICE, /*<! Thread minimal end device */
63+
MESH_DEVICE_TYPE_WISUN_ROUTER, /*<! Wi-SUN router */
64+
MESH_DEVICE_TYPE_WISUN_BORDER_ROUTER /*<! Wi-SUN border router */
6365
} mesh_device_type_t;
6466

6567
#ifdef __cplusplus

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@
159159
"value_max": 255,
160160
"value": 255
161161
},
162+
"wisun-device-type": {
163+
"help": "Supported device operating modes: MESH_DEVICE_TYPE_WISUN_ROUTER, MESH_DEVICE_TYPE_WISUN_BORDER_ROUTER",
164+
"value": "MESH_DEVICE_TYPE_WISUN_ROUTER"
165+
},
162166
"certificate-header": {
163167
"help": "File name of the certificate header file (used on include directive)",
164168
"value": null

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,12 @@ static void wisun_tasklet_configure_and_connect_to_network(void)
253253
int status;
254254
fhss_timer_t *fhss_timer_ptr = &fhss_functions;
255255

256-
wisun_tasklet_data_ptr->operating_mode = NET_6LOWPAN_ROUTER;
256+
if (MBED_CONF_MBED_MESH_API_WISUN_DEVICE_TYPE == MESH_DEVICE_TYPE_WISUN_BORDER_ROUTER) {
257+
wisun_tasklet_data_ptr->operating_mode = NET_6LOWPAN_BORDER_ROUTER;
258+
} else {
259+
wisun_tasklet_data_ptr->operating_mode = NET_6LOWPAN_ROUTER;
260+
}
261+
257262
wisun_tasklet_data_ptr->operating_mode_extension = NET_6LOWPAN_WS;
258263

259264
arm_nwk_interface_configure_6lowpan_bootstrap_set(

0 commit comments

Comments
 (0)