Skip to content

Commit

Permalink
Merge pull request #12656 from artokin/fea_wisun_nanostack_device_typ…
Browse files Browse the repository at this point in the history
…e_config

[feature-wisun] Nanostack: Add config for Wi-SUN device type
  • Loading branch information
Arto Kinnunen authored Mar 23, 2020
2 parents b3c529b + 0051c0e commit aa375c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ typedef enum {
typedef enum {
MESH_DEVICE_TYPE_THREAD_ROUTER = 0, /*<! Thread router */
MESH_DEVICE_TYPE_THREAD_SLEEPY_END_DEVICE, /*<! Thread Sleepy end device */
MESH_DEVICE_TYPE_THREAD_MINIMAL_END_DEVICE /*<! Thread minimal end device */
MESH_DEVICE_TYPE_THREAD_MINIMAL_END_DEVICE, /*<! Thread minimal end device */
MESH_DEVICE_TYPE_WISUN_ROUTER, /*<! Wi-SUN router */
MESH_DEVICE_TYPE_WISUN_BORDER_ROUTER /*<! Wi-SUN border router */
} mesh_device_type_t;

#ifdef __cplusplus
Expand Down
4 changes: 4 additions & 0 deletions features/nanostack/mbed-mesh-api/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@
"help": "Unicast dwell interval. Range: 15-255 milliseconds",
"value": 0
},
"wisun-device-type": {
"help": "Supported device operating modes: MESH_DEVICE_TYPE_WISUN_ROUTER, MESH_DEVICE_TYPE_WISUN_BORDER_ROUTER",
"value": "MESH_DEVICE_TYPE_WISUN_ROUTER"
},
"certificate-header": {
"help": "File name of the certificate header file (used on include directive)",
"value": null
Expand Down
7 changes: 6 additions & 1 deletion features/nanostack/mbed-mesh-api/source/wisun_tasklet.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,12 @@ static void wisun_tasklet_configure_and_connect_to_network(void)
int status;
fhss_timer_t *fhss_timer_ptr = &fhss_functions;

wisun_tasklet_data_ptr->operating_mode = NET_6LOWPAN_ROUTER;
if (MBED_CONF_MBED_MESH_API_WISUN_DEVICE_TYPE == MESH_DEVICE_TYPE_WISUN_BORDER_ROUTER) {
wisun_tasklet_data_ptr->operating_mode = NET_6LOWPAN_BORDER_ROUTER;
} else {
wisun_tasklet_data_ptr->operating_mode = NET_6LOWPAN_ROUTER;
}

wisun_tasklet_data_ptr->operating_mode_extension = NET_6LOWPAN_WS;

arm_nwk_interface_configure_6lowpan_bootstrap_set(
Expand Down

0 comments on commit aa375c4

Please sign in to comment.