diff --git a/features/nanostack/mbed-mesh-api/mbed_lib.json b/features/nanostack/mbed-mesh-api/mbed_lib.json index 95ea0fa335..d26fa4452b 100644 --- a/features/nanostack/mbed-mesh-api/mbed_lib.json +++ b/features/nanostack/mbed-mesh-api/mbed_lib.json @@ -120,6 +120,10 @@ "help": "default network name for wisun network", "value": "\"Wi-SUN Network\"" }, + "wisun-network-size": { + "help": "Expected amount of devices in the network as 100s of devices. with possible pre defined constants NETWORK_SIZE_SMALL, NETWORK_SIZE_MEDIUM, NETWORK_SIZE_LARGE, NETWORK_SIZE_XLARGE. if set to 0 Wi-SUN Certification configuration values are used. If don't define this(default null), then NETWORK_SIZE_MEDIUM will be used.", + "value": null + }, "wisun-regulatory-domain": { "help": "Regulator domain.", "value": "3" diff --git a/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp b/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp index 1190fdf408..fb826f9d5e 100644 --- a/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp +++ b/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp @@ -119,6 +119,14 @@ nsapi_error_t WisunInterface::configure() } #endif +#ifdef MBED_CONF_MBED_MESH_API_WISUN_NETWORK_SIZE + status = set_network_size(MBED_CONF_MBED_MESH_API_WISUN_NETWORK_SIZE); + if (status < 0) { + tr_error("Failed to set network size"); + return NSAPI_ERROR_PARAMETER; + } +#endif + return NSAPI_ERROR_OK; }