Skip to content

Commit b728321

Browse files
committed
Add WiSun network size configs in JSON
1 parent 5daad96 commit b728321

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@
120120
"help": "default network name for wisun network",
121121
"value": "\"Wi-SUN Network\""
122122
},
123+
"wisun-network-size": {
124+
"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.",
125+
"value": null
126+
},
123127
"wisun-regulatory-domain": {
124128
"help": "Regulator domain.",
125129
"value": "3"

features/nanostack/mbed-mesh-api/source/WisunInterface.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ nsapi_error_t WisunInterface::configure()
117117
}
118118
#endif
119119

120+
#ifdef MBED_CONF_MBED_MESH_API_WISUN_NETWORK_SIZE
121+
status = set_network_size(MBED_CONF_MBED_MESH_API_WISUN_NETWORK_SIZE);
122+
if (status < 0) {
123+
tr_error("Failed to set network size");
124+
return NSAPI_ERROR_PARAMETER;
125+
}
126+
#endif
127+
120128
return NSAPI_ERROR_OK;
121129
}
122130

0 commit comments

Comments
 (0)