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