Skip to content

Commit aa375c4

Browse files
author
Arto Kinnunen
authored
Merge pull request #12656 from artokin/fea_wisun_nanostack_device_type_config
[feature-wisun] Nanostack: Add config for Wi-SUN device type
2 parents b3c529b + 0051c0e commit aa375c4

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
@@ -154,6 +154,10 @@
154154
"help": "Unicast dwell interval. Range: 15-255 milliseconds",
155155
"value": 0
156156
},
157+
"wisun-device-type": {
158+
"help": "Supported device operating modes: MESH_DEVICE_TYPE_WISUN_ROUTER, MESH_DEVICE_TYPE_WISUN_BORDER_ROUTER",
159+
"value": "MESH_DEVICE_TYPE_WISUN_ROUTER"
160+
},
157161
"certificate-header": {
158162
"help": "File name of the certificate header file (used on include directive)",
159163
"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
@@ -252,7 +252,12 @@ static void wisun_tasklet_configure_and_connect_to_network(void)
252252
int status;
253253
fhss_timer_t *fhss_timer_ptr = &fhss_functions;
254254

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

258263
arm_nwk_interface_configure_6lowpan_bootstrap_set(

0 commit comments

Comments
 (0)