@@ -43,6 +43,28 @@ class WisunInterface final : public MeshInterfaceNanostack {
43
43
* */
44
44
mesh_error_t set_network_name (char *network_name);
45
45
46
+ /* *
47
+ * \brief Get Wi-SUN network name.
48
+ *
49
+ * Function reads network name from mbed-mesh-api.
50
+ *
51
+ * \param network_name Network name as NUL terminated string. Must have space for 33 characters (string and null terminator).
52
+ * \return MESH_ERROR_NONE on success.
53
+ * \return MESH_ERROR_UNKNOWN in case of failure.
54
+ * */
55
+ mesh_error_t get_network_name (char *network_name);
56
+
57
+ /* *
58
+ * \brief Validate Wi-SUN network name.
59
+ *
60
+ * Function validates network name. Function can be used to test that values that will be used on set function are valid.
61
+ *
62
+ * \param network_name Network name as NUL terminated string. Can't exceed 32 characters and can't be NULL.
63
+ * \return MESH_ERROR_NONE on success.
64
+ * \return MESH_ERROR_UNKNOWN in case of failure.
65
+ * */
66
+ mesh_error_t validate_network_name (char *network_name);
67
+
46
68
/* *
47
69
* \brief Set Wi-SUN network regulatory domain, operating class and operating mode.
48
70
*
@@ -60,6 +82,252 @@ class WisunInterface final : public MeshInterfaceNanostack {
60
82
* */
61
83
mesh_error_t set_network_regulatory_domain (uint8_t regulatory_domain = 0xff , uint8_t operating_class = 0xff , uint8_t operating_mode = 0xff );
62
84
85
+ /* *
86
+ * \brief Get Wi-SUN network regulatory domain, operating class and operating mode.
87
+ *
88
+ * Function reads regulatory_domain, operating_class and operating_mode from mbed-mesh-api.
89
+ *
90
+ * \param regulatory_domain Values defined in Wi-SUN PHY-specification.
91
+ * \param operating_class Values defined in Wi-SUN PHY-specification.
92
+ * \param operating_mode Values defined in Wi-SUN PHY-specification.
93
+ * \return MESH_ERROR_NONE on success.
94
+ * \return MESH_ERROR_UNKNOWN in case of failure.
95
+ * */
96
+ mesh_error_t get_network_regulatory_domain (uint8_t *regulatory_domain, uint8_t *operating_class, uint8_t *operating_mode);
97
+
98
+ /* *
99
+ * \brief Validate Wi-SUN network regulatory domain, operating class and operating mode.
100
+ *
101
+ * Function validates regulatory_domain, operating_class and operating_mode. Function can be used to test that values that will
102
+ * be used on set function are valid.
103
+ *
104
+ * \param regulatory_domain Values defined in Wi-SUN PHY-specification.
105
+ * \param operating_class Values defined in Wi-SUN PHY-specification.
106
+ * \param operating_mode Values defined in Wi-SUN PHY-specification.
107
+ * \return MESH_ERROR_NONE on success.
108
+ * \return MESH_ERROR_UNKNOWN in case of failure.
109
+ * */
110
+ mesh_error_t validate_network_regulatory_domain (uint8_t regulatory_domain, uint8_t operating_class, uint8_t operating_mode);
111
+
112
+ /* *
113
+ * \brief Set Wi-SUN network size.
114
+ *
115
+ * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
116
+ * If device is already connected to the Wi-SUN network then device will restart network discovery after
117
+ * changing the network size.
118
+ *
119
+ * Default value: medium
120
+ * Small network size: less than hundred devices
121
+ * Medium network size: hundreds of devices
122
+ * Large network size: thousands of devices
123
+ * Certificate: used on testing
124
+ *
125
+ * When network size is changed, it will override all or some of the following configuration values:
126
+ * - Timing settings set by set_timing_parameters() of the Wi-SUN interface.
127
+ * - RPL settings set by rpl_parameters_set() of the Border Router interface.
128
+ *
129
+ * When network size is changed, and if timing or RPL values should be other than defaults set by stack for the network size,
130
+ * they need to set again using above function calls.
131
+ *
132
+ * \param network_size Network size in hundreds of devices (e.g. 1200 devices is 12), 0x00 for network size certificate.
133
+ * \return MESH_ERROR_NONE on success.
134
+ * \return MESH_ERROR_UNKNOWN in case of failure.
135
+ * */
136
+ mesh_error_t set_network_size (uint8_t network_size);
137
+
138
+ /* *
139
+ * \brief Get Wi-SUN network size.
140
+ *
141
+ * Function reads network size from mbed-mesh-api.
142
+ *
143
+ * \param network_size Network size in hundreds of devices, 0x00 for network size certificate.
144
+ * \return MESH_ERROR_NONE on success.
145
+ * \return MESH_ERROR_UNKNOWN in case of failure.
146
+ * */
147
+ mesh_error_t get_network_size (uint8_t *network_size);
148
+
149
+ /* *
150
+ * \brief Validate Wi-SUN network size.
151
+ *
152
+ * Function validates network size from mbed-mesh-api. Function can be used to test that values that will
153
+ * be used on set function are valid.
154
+ *
155
+ * \param network_size Network size in hundreds of devices, 0x00 for network size certificate.
156
+ * \return MESH_ERROR_NONE on success.
157
+ * \return MESH_ERROR_UNKNOWN in case of failure.
158
+ * */
159
+ mesh_error_t validate_network_size (uint8_t network_size);
160
+
161
+ /* *
162
+ * \brief Set Wi-SUN FHSS channel mask
163
+ *
164
+ * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
165
+ * If device is already connected to the Wi-SUN network then settings take effect right away.
166
+ *
167
+ * \param channel_mask Values defined in Wi-SUN management API. Channel mask bit field.
168
+ * \return MESH_ERROR_NONE on success.
169
+ * \return MESH_ERROR_UNKNOWN in case of failure.
170
+ * */
171
+ mesh_error_t set_channel_mask (uint32_t channel_mask[8 ]);
172
+
173
+ /* *
174
+ * \brief Get Wi-SUN FHSS channel mask
175
+ *
176
+ * Function reads FHSS channel mask from mbed-mesh-api.
177
+ *
178
+ * \param channel_mask Values defined in Wi-SUN management API. Channel mask bit field.
179
+ * \return MESH_ERROR_NONE on success.
180
+ * \return MESH_ERROR_UNKNOWN in case of failure.
181
+ * */
182
+ mesh_error_t get_channel_mask (uint32_t *channel_mask);
183
+
184
+ /* *
185
+ * \brief Validate Wi-SUN FHSS channel mask
186
+ *
187
+ * Function validates FHSS channel mask. Function can be used to test that values that will
188
+ * be used on set function are valid.
189
+ *
190
+ * \param channel_mask Values defined in Wi-SUN management API. Channel mask bit field.
191
+ * \return MESH_ERROR_NONE on success.
192
+ * \return MESH_ERROR_UNKNOWN in case of failure.
193
+ * */
194
+ mesh_error_t validate_channel_mask (uint32_t channel_mask[8 ]);
195
+
196
+ /* *
197
+ * \brief Set Wi-SUN FHSS unicast channel function parameters
198
+ *
199
+ * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
200
+ * If device is already connected to the Wi-SUN network then device will restart network discovery after
201
+ * changing the channel function, fixed channel or dwell interval.
202
+ *
203
+ * Function overwrites parameters defined by Mbed OS configuration.
204
+ *
205
+ * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
206
+ * \param fixed_channel Used channel when channel function is fixed channel. Use 0xffff when fixed channel function not on use.
207
+ * \param dwell_interval Used dwell interval when channel function is TR51 or DH1. Use 0x00 to use leave parameter unchanged.
208
+ * \return MESH_ERROR_NONE on success.
209
+ * \return MESH_ERROR_UNKNOWN in case of failure.
210
+ * */
211
+ mesh_error_t set_unicast_channel_function (mesh_channel_function_t channel_function, uint16_t fixed_channel = 0xffff , uint8_t dwell_interval = 0x00 );
212
+
213
+ /* *
214
+ * \brief Get Wi-SUN FHSS unicast channel function parameters
215
+ *
216
+ * Function reads FHSS unicast channel function parameters from mbed-mesh-api.
217
+ *
218
+ * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
219
+ * \param fixed_channel Used channel when channel function is fixed channel.
220
+ * \param dwell_interval Used dwell interval when channel function is TR51 or DH1.
221
+ * \return MESH_ERROR_NONE on success.
222
+ * \return MESH_ERROR_UNKNOWN in case of failure.
223
+ * */
224
+ mesh_error_t get_unicast_channel_function (mesh_channel_function_t *channel_function, uint16_t *fixed_channel, uint8_t *dwell_interval);
225
+
226
+ /* *
227
+ * \brief Validate Wi-SUN FHSS unicast channel function parameters
228
+ *
229
+ * Function validates FHSS unicast channel function parameters. Function can be used to test that values that will
230
+ * be used on set function are valid.
231
+ *
232
+ * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
233
+ * \param fixed_channel Used channel when channel function is fixed channel.
234
+ * \param dwell_interval Used dwell interval when channel function is TR51 or DH1.
235
+ * \return MESH_ERROR_NONE on success.
236
+ * \return MESH_ERROR_UNKNOWN in case of failure.
237
+ * */
238
+ mesh_error_t validate_unicast_channel_function (mesh_channel_function_t channel_function, uint16_t fixed_channel, uint8_t dwell_interval);
239
+
240
+ /* *
241
+ * \brief Set Wi-SUN FHSS broadcast channel function parameters
242
+ *
243
+ * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
244
+ * If device is already connected to the Wi-SUN network then device will restart network discovery after
245
+ * changing the channel function, fixed channel, dwell interval or broadcast_interval.
246
+ *
247
+ * Function overwrites parameters defined by Mbed OS configuration.
248
+ *
249
+ * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
250
+ * \param fixed_channel Used channel when channel function is fixed channel. Use 0xffff when fixed channel function not on use.
251
+ * \param dwell_interval Used dwell interval when channel function is TR51 or DH1. Use 0x00 to use leave parameter unchanged.
252
+ * \param broadcast_interval Used broadcast interval. Use 0x00 to use leave parameter unchanged.
253
+ * \return MESH_ERROR_NONE on success.
254
+ * \return MESH_ERROR_UNKNOWN in case of failure.
255
+ * */
256
+ mesh_error_t set_broadcast_channel_function (mesh_channel_function_t channel_function, uint16_t fixed_channel = 0xffff , uint8_t dwell_interval = 0x00 , uint32_t broadcast_interval = 0x00 );
257
+
258
+ /* *
259
+ * \brief Get Wi-SUN FHSS broadcast channel function parameters
260
+ *
261
+ * Function reads FHSS broadcast channel function parameters from mbed-mesh-api.
262
+ *
263
+ * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
264
+ * \param fixed_channel Used channel when channel function is fixed channel.
265
+ * \param dwell_interval Used dwell interval when channel function is TR51 or DH1.
266
+ * \param broadcast_interval Used broadcast interval.
267
+ * \return MESH_ERROR_NONE on success.
268
+ * \return MESH_ERROR_UNKNOWN in case of failure.
269
+ * */
270
+ mesh_error_t get_broadcast_channel_function (mesh_channel_function_t *channel_function, uint16_t *fixed_channel, uint8_t *dwell_interval, uint32_t *broadcast_interval);
271
+
272
+ /* *
273
+ * \brief Validate Wi-SUN FHSS broadcast channel function parameters
274
+ *
275
+ * Function validates FHSS broadcast channel function parameters from mbed-mesh-api. Function can be used to test that values that will
276
+ * be used on set function are valid.
277
+ *
278
+ * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
279
+ * \param fixed_channel Used channel when channel function is fixed channel.
280
+ * \param dwell_interval Used dwell interval when channel function is TR51 or DH1.
281
+ * \param broadcast_interval Used broadcast interval.
282
+ * \return MESH_ERROR_NONE on success.
283
+ * \return MESH_ERROR_UNKNOWN in case of failure.
284
+ * */
285
+ mesh_error_t validate_broadcast_channel_function (mesh_channel_function_t channel_function, uint16_t fixed_channel, uint8_t dwell_interval, uint32_t broadcast_interval);
286
+
287
+ /* *
288
+ * \brief Set Wi-SUN timing parameters
289
+ *
290
+ * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
291
+ * If device is already connected to the Wi-SUN network then settings take effect right away.
292
+ *
293
+ * \param disc_trickle_imin Discovery trickle Imin. Range 1-255 seconds. Use 0x00 to use leave parameter unchanged.
294
+ * \param disc_trickle_imax Discovery trickle Imax. Range (2-2^8)*Imin. Use 0x00 to use leave parameter unchanged.
295
+ * \param disc_trickle_k Discovery trickle k. Use 0x00 to use leave parameter unchanged.
296
+ * \param pan_timeout PAN timeout; seconds; Range 60-15300 seconds. Use 0x00 to use leave parameter unchanged.
297
+ * \return MESH_ERROR_NONE on success.
298
+ * \return MESH_ERROR_UNKNOWN in case of failure.
299
+ * */
300
+ mesh_error_t set_timing_parameters (uint16_t disc_trickle_imin = 0x00 , uint16_t disc_trickle_imax = 0x00 , uint8_t disc_trickle_k = 0x00 , uint16_t pan_timeout = 0x00 );
301
+
302
+ /* *
303
+ * \brief Get Wi-SUN timing parameters
304
+ *
305
+ * Function reads timing parameters from mbed-mesh-api.
306
+ *
307
+ * \param disc_trickle_imin Discovery trickle Imin. Range 1-255 seconds.
308
+ * \param disc_trickle_imax Discovery trickle Imax. Range (2-2^8)*Imin.
309
+ * \param disc_trickle_k Discovery trickle k.
310
+ * \param pan_timeout PAN timeout; seconds; Range 60-15300 seconds.
311
+ * \return MESH_ERROR_NONE on success.
312
+ * \return MESH_ERROR_UNKNOWN in case of failure.
313
+ * */
314
+ mesh_error_t get_timing_parameters (uint16_t *disc_trickle_imin, uint16_t *disc_trickle_imax, uint8_t *disc_trickle_k, uint16_t *pan_timeout);
315
+
316
+ /* *
317
+ * \brief Validates Wi-SUN timing parameters
318
+ *
319
+ * Function validates timing parameters. Function can be used to test that values that will be used on set
320
+ * function are valid.
321
+ *
322
+ * \param disc_trickle_imin Discovery trickle Imin. Range 1-255 seconds.
323
+ * \param disc_trickle_imax Discovery trickle Imax. Range (2-2^8)*Imin.
324
+ * \param disc_trickle_k Discovery trickle k.
325
+ * \param pan_timeout PAN timeout; seconds; Range 60-15300 seconds.
326
+ * \return MESH_ERROR_NONE on success.
327
+ * \return MESH_ERROR_UNKNOWN in case of failure.
328
+ * */
329
+ mesh_error_t validate_timing_parameters (uint16_t disc_trickle_imin, uint16_t disc_trickle_imax, uint8_t disc_trickle_k, uint16_t pan_timeout);
330
+
63
331
/* *
64
332
* \brief Set own certificate and private key reference to the Wi-SUN network.
65
333
*
@@ -125,6 +393,7 @@ class WisunInterface final : public MeshInterfaceNanostack {
125
393
protected:
126
394
Nanostack::WisunInterface *get_interface () const ;
127
395
nsapi_error_t do_initialize () override ;
396
+ virtual nsapi_error_t configure ();
128
397
};
129
398
130
399
#endif
0 commit comments