Skip to content

Commit

Permalink
Merge pull request #12648 from artokin/nanostack_wisun_device_type_co…
Browse files Browse the repository at this point in the history
…nfig

Nanostack: Add config for Wi-SUN device type
  • Loading branch information
adbridge authored Mar 20, 2020
2 parents d048cd4 + 1b17179 commit 1b83d31
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 @@ -159,6 +159,10 @@
"value_max": 255,
"value": 255
},
"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 @@ -253,7 +253,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 1b83d31

Please sign in to comment.