Mistake on this page?
Report an issue in GitHub or email us
WisunInterface.h
1 /*
2  * Copyright (c) 2018-2019 ARM Limited. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  * Licensed under the Apache License, Version 2.0 (the License); you may
5  * not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef WISUNINTERFACE_H
18 #define WISUNINTERFACE_H
19 
20 #include "MeshInterfaceNanostack.h"
21 
22 /**
23  * \brief Struct ws_rpl_info Wi-SUN router RPL information.
24  */
25 typedef struct ws_rpl_info {
26  /** Router dodag id */
27  uint8_t rpl_dodag_id[16];
28  /** Router instance identifier */
29  uint8_t instance_id;
30  /** RPL version number */
31  uint8_t version;
32  /** RPL DODAG node current Rank */
33  uint16_t current_rank;
34  /** RPL Primary Parent Rank */
37 
38 /**
39  * \brief Struct ws_stack_state Wi-SUN stack information.
40  */
41 typedef struct ws_stack_state {
42  /** Mesh Interface Global IPv6 Address */
43  uint8_t global_addr[16];
44  /** Mesh Interface Link Local IPv6 Address */
45  uint8_t link_local_addr[16];
46  /** Parent link local address */
47  uint8_t parent_addr[16];
48  /** parent RSSI Out measured RSSI value calculated using EWMA specified by Wi-SUN from range of -174 (0) to +80 (254) dBm.*/
49  uint8_t rsl_out;
50  /** parent RSSI in measured RSSI value calculated using EWMA specified by Wi-SUN from range of -174 (0) to +80 (254) dBm.*/
51  uint8_t rsl_in;
52  /** Wi-SUN join state defined by Wi-SUN specification 1-5 */
53  uint8_t join_state;
54  /** Network PAN ID */
55  uint16_t pan_id;
56  /** Device RF minimum sensitivity configuration. lowest level of radio signal strength packet heard. Range of -174 (0) to +80 (254) dBm*/
57  uint8_t device_min_sens;
59 
60 /**
61  * \brief Struct ws_cca_threshold_table Wi-SUN CCA threshold table information.
62  */
63 typedef struct ws_cca_threshold_table {
64  /** Number of channels */
66  /** CCA threshold table */
67  const int8_t *cca_threshold_table;
69 
70 /** Wi-SUN mesh network interface class
71  *
72  * Configure Nanostack to use Wi-SUN protocol.
73  */
74 class WisunInterface final : public MeshInterfaceNanostack {
75 public:
76  /** Inherit MeshInterfaceNanostack constructors */
77  using MeshInterfaceNanostack::MeshInterfaceNanostack;
78 
79  /**
80  * \brief Set Wi-SUN network name.
81  *
82  * Function stores new network name to mbed-mesh-api and uses it when connect() is called next time.
83  * If device is already connected to the Wi-SUN network then device will restart network discovery after
84  * changing the network name.
85  *
86  * Function overwrites network name defined by Mbed OS configuration.
87  *
88  * \param network_name Network name as NUL terminated string. Can't exceed 32 characters and can't be NULL.
89  * \return MESH_ERROR_NONE on success.
90  * \return MESH_ERROR_UNKNOWN in case of failure.
91  * */
92  mesh_error_t set_network_name(char *network_name);
93 
94  /**
95  * \brief Get Wi-SUN network name.
96  *
97  * Function reads network name from mbed-mesh-api.
98  *
99  * \param network_name Network name as NUL terminated string. Must have space for 33 characters (string and null terminator).
100  * \return MESH_ERROR_NONE on success.
101  * \return MESH_ERROR_UNKNOWN in case of failure.
102  * */
103  mesh_error_t get_network_name(char *network_name);
104 
105  /**
106  * \brief Validate Wi-SUN network name.
107  *
108  * Function validates network name. Function can be used to test that values that will be used on set function are valid.
109  *
110  * \param network_name Network name as NUL terminated string. Can't exceed 32 characters and can't be NULL.
111  * \return MESH_ERROR_NONE on success.
112  * \return MESH_ERROR_UNKNOWN in case of failure.
113  * */
114  mesh_error_t validate_network_name(char *network_name);
115 
116  /**
117  * \brief Set Wi-SUN network regulatory domain, operating class and operating mode.
118  *
119  * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
120  * If device is already connected to the Wi-SUN network then device will restart network discovery after
121  * changing the regulatory_domain, operating_class or operating_mode.
122  *
123  * Function overwrites parameters defined by Mbed OS configuration.
124  *
125  * \param regulatory_domain Values defined in Wi-SUN PHY-specification. Use 0xff to use leave parameter unchanged.
126  * \param operating_class Values defined in Wi-SUN PHY-specification. Use 0xff to use leave parameter unchanged.
127  * \param operating_mode Values defined in Wi-SUN PHY-specification. Use 0xff to use leave parameter unchanged.
128  * \return MESH_ERROR_NONE on success.
129  * \return MESH_ERROR_UNKNOWN in case of failure.
130  * */
131  mesh_error_t set_network_regulatory_domain(uint8_t regulatory_domain = 0xff, uint8_t operating_class = 0xff, uint8_t operating_mode = 0xff);
132 
133  /**
134  * \brief Get Wi-SUN network regulatory domain, operating class and operating mode.
135  *
136  * Function reads regulatory_domain, operating_class and operating_mode from mbed-mesh-api.
137  *
138  * \param regulatory_domain Values defined in Wi-SUN PHY-specification.
139  * \param operating_class Values defined in Wi-SUN PHY-specification.
140  * \param operating_mode Values defined in Wi-SUN PHY-specification.
141  * \return MESH_ERROR_NONE on success.
142  * \return MESH_ERROR_UNKNOWN in case of failure.
143  * */
144  mesh_error_t get_network_regulatory_domain(uint8_t *regulatory_domain, uint8_t *operating_class, uint8_t *operating_mode);
145 
146  /**
147  * \brief Validate Wi-SUN network regulatory domain, operating class and operating mode.
148  *
149  * Function validates regulatory_domain, operating_class and operating_mode. Function can be used to test that values that will
150  * be used on set function are valid.
151  *
152  * \param regulatory_domain Values defined in Wi-SUN PHY-specification.
153  * \param operating_class Values defined in Wi-SUN PHY-specification.
154  * \param operating_mode Values defined in Wi-SUN PHY-specification.
155  * \return MESH_ERROR_NONE on success.
156  * \return MESH_ERROR_UNKNOWN in case of failure.
157  * */
158  mesh_error_t validate_network_regulatory_domain(uint8_t regulatory_domain, uint8_t operating_class, uint8_t operating_mode);
159 
160  /**
161  * \brief Set Wi-SUN network size.
162  *
163  * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
164  * If device is already connected to the Wi-SUN network then device will restart network discovery after
165  * changing the network size.
166  *
167  * Default value: medium
168  * Small network size: less than hundred devices
169  * Medium network size: hundreds of devices
170  * Large network size: thousands of devices
171  * Certificate: used on testing
172  *
173  * When network size is changed, it will override all or some of the following configuration values:
174  * - Timing settings set by set_timing_parameters() of the Wi-SUN interface.
175  * - RPL settings set by rpl_parameters_set() of the Border Router interface.
176  *
177  * When network size is changed, and if timing or RPL values should be other than defaults set by stack for the network size,
178  * they need to set again using above function calls.
179  *
180  * \param network_size Network size in hundreds of devices (e.g. 1200 devices is 12), 0x00 for network size certificate.
181  * \return MESH_ERROR_NONE on success.
182  * \return MESH_ERROR_UNKNOWN in case of failure.
183  * */
184  mesh_error_t set_network_size(uint8_t network_size);
185 
186  /**
187  * \brief Get Wi-SUN network size.
188  *
189  * Function reads network size from mbed-mesh-api.
190  *
191  * \param network_size Network size in hundreds of devices, 0x00 for network size certificate.
192  * \return MESH_ERROR_NONE on success.
193  * \return MESH_ERROR_UNKNOWN in case of failure.
194  * */
195  mesh_error_t get_network_size(uint8_t *network_size);
196 
197  /**
198  * \brief Validate Wi-SUN network size.
199  *
200  * Function validates network size from mbed-mesh-api. Function can be used to test that values that will
201  * be used on set function are valid.
202  *
203  * \param network_size Network size in hundreds of devices, 0x00 for network size certificate.
204  * \return MESH_ERROR_NONE on success.
205  * \return MESH_ERROR_UNKNOWN in case of failure.
206  * */
207  mesh_error_t validate_network_size(uint8_t network_size);
208 
209  /**
210  * \brief Set Wi-SUN FHSS channel mask
211  *
212  * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
213  * If device is already connected to the Wi-SUN network then settings take effect right away.
214  *
215  * \param channel_mask Values defined in Wi-SUN management API. Channel mask bit field.
216  * \return MESH_ERROR_NONE on success.
217  * \return MESH_ERROR_UNKNOWN in case of failure.
218  * */
219  mesh_error_t set_channel_mask(uint32_t channel_mask[8]);
220 
221  /**
222  * \brief Get Wi-SUN FHSS channel mask
223  *
224  * Function reads FHSS channel mask from mbed-mesh-api.
225  *
226  * \param channel_mask Values defined in Wi-SUN management API. Channel mask bit field.
227  * \return MESH_ERROR_NONE on success.
228  * \return MESH_ERROR_UNKNOWN in case of failure.
229  * */
230  mesh_error_t get_channel_mask(uint32_t *channel_mask);
231 
232  /**
233  * \brief Validate Wi-SUN FHSS channel mask
234  *
235  * Function validates FHSS channel mask. Function can be used to test that values that will
236  * be used on set function are valid.
237  *
238  * \param channel_mask Values defined in Wi-SUN management API. Channel mask bit field.
239  * \return MESH_ERROR_NONE on success.
240  * \return MESH_ERROR_UNKNOWN in case of failure.
241  * */
242  mesh_error_t validate_channel_mask(uint32_t channel_mask[8]);
243 
244  /**
245  * \brief Set Wi-SUN FHSS unicast channel function parameters
246  *
247  * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
248  * If device is already connected to the Wi-SUN network then device will restart network discovery after
249  * changing the channel function, fixed channel or dwell interval.
250  *
251  * Function overwrites parameters defined by Mbed OS configuration.
252  *
253  * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
254  * \param fixed_channel Used channel when channel function is fixed channel. Use 0xffff when fixed channel function not on use.
255  * \param dwell_interval Used dwell interval when channel function is TR51 or DH1. Use 0x00 to use leave parameter unchanged.
256  * \return MESH_ERROR_NONE on success.
257  * \return MESH_ERROR_UNKNOWN in case of failure.
258  * */
259  mesh_error_t set_unicast_channel_function(mesh_channel_function_t channel_function, uint16_t fixed_channel = 0xffff, uint8_t dwell_interval = 0x00);
260 
261  /**
262  * \brief Get Wi-SUN FHSS unicast channel function parameters
263  *
264  * Function reads FHSS unicast channel function parameters from mbed-mesh-api.
265  *
266  * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
267  * \param fixed_channel Used channel when channel function is fixed channel.
268  * \param dwell_interval Used dwell interval when channel function is TR51 or DH1.
269  * \return MESH_ERROR_NONE on success.
270  * \return MESH_ERROR_UNKNOWN in case of failure.
271  * */
272  mesh_error_t get_unicast_channel_function(mesh_channel_function_t *channel_function, uint16_t *fixed_channel, uint8_t *dwell_interval);
273 
274  /**
275  * \brief Validate Wi-SUN FHSS unicast channel function parameters
276  *
277  * Function validates FHSS unicast channel function parameters. Function can be used to test that values that will
278  * be used on set function are valid.
279  *
280  * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
281  * \param fixed_channel Used channel when channel function is fixed channel.
282  * \param dwell_interval Used dwell interval when channel function is TR51 or DH1.
283  * \return MESH_ERROR_NONE on success.
284  * \return MESH_ERROR_UNKNOWN in case of failure.
285  * */
286  mesh_error_t validate_unicast_channel_function(mesh_channel_function_t channel_function, uint16_t fixed_channel, uint8_t dwell_interval);
287 
288  /**
289  * \brief Set Wi-SUN FHSS broadcast channel function parameters
290  *
291  * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
292  * If device is already connected to the Wi-SUN network then device will restart network discovery after
293  * changing the channel function, fixed channel, dwell interval or broadcast_interval.
294  *
295  * Function overwrites parameters defined by Mbed OS configuration.
296  *
297  * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
298  * \param fixed_channel Used channel when channel function is fixed channel. Use 0xffff when fixed channel function not on use.
299  * \param dwell_interval Used dwell interval when channel function is TR51 or DH1. Use 0x00 to use leave parameter unchanged.
300  * \param broadcast_interval Used broadcast interval. Use 0x00 to use leave parameter unchanged.
301  * \return MESH_ERROR_NONE on success.
302  * \return MESH_ERROR_UNKNOWN in case of failure.
303  * */
304  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);
305 
306  /**
307  * \brief Get Wi-SUN FHSS broadcast channel function parameters
308  *
309  * Function reads FHSS broadcast channel function parameters from mbed-mesh-api.
310  *
311  * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
312  * \param fixed_channel Used channel when channel function is fixed channel.
313  * \param dwell_interval Used dwell interval when channel function is TR51 or DH1.
314  * \param broadcast_interval Used broadcast interval.
315  * \return MESH_ERROR_NONE on success.
316  * \return MESH_ERROR_UNKNOWN in case of failure.
317  * */
318  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);
319 
320  /**
321  * \brief Validate Wi-SUN FHSS broadcast channel function parameters
322  *
323  * Function validates FHSS broadcast channel function parameters from mbed-mesh-api. Function can be used to test that values that will
324  * be used on set function are valid.
325  *
326  * \param channel_function Channel function. Fixed, TR51CF, DH1CF or vendor defined.
327  * \param fixed_channel Used channel when channel function is fixed channel.
328  * \param dwell_interval Used dwell interval when channel function is TR51 or DH1.
329  * \param broadcast_interval Used broadcast interval.
330  * \return MESH_ERROR_NONE on success.
331  * \return MESH_ERROR_UNKNOWN in case of failure.
332  * */
333  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);
334 
335  /**
336  * \brief Set Wi-SUN timing parameters
337  *
338  * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
339  * If device is already connected to the Wi-SUN network then settings take effect right away.
340  *
341  * \param disc_trickle_imin Discovery trickle Imin. Range 1-255 seconds. Use 0x00 to use leave parameter unchanged.
342  * \param disc_trickle_imax Discovery trickle Imax. Range (2-2^8)*Imin. Use 0x00 to use leave parameter unchanged.
343  * \param disc_trickle_k Discovery trickle k. Use 0x00 to use leave parameter unchanged.
344  * \param pan_timeout PAN timeout; seconds; Range 60-15300 seconds. Use 0x00 to use leave parameter unchanged.
345  * \return MESH_ERROR_NONE on success.
346  * \return MESH_ERROR_UNKNOWN in case of failure.
347  * */
348  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);
349 
350  /**
351  * \brief Get Wi-SUN timing parameters
352  *
353  * Function reads timing parameters from mbed-mesh-api.
354  *
355  * \param disc_trickle_imin Discovery trickle Imin. Range 1-255 seconds.
356  * \param disc_trickle_imax Discovery trickle Imax. Range (2-2^8)*Imin.
357  * \param disc_trickle_k Discovery trickle k.
358  * \param pan_timeout PAN timeout; seconds; Range 60-15300 seconds.
359  * \return MESH_ERROR_NONE on success.
360  * \return MESH_ERROR_UNKNOWN in case of failure.
361  * */
362  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);
363 
364  /**
365  * \brief Validates Wi-SUN timing parameters
366  *
367  * Function validates timing parameters. Function can be used to test that values that will be used on set
368  * function are valid.
369  *
370  * \param disc_trickle_imin Discovery trickle Imin. Range 1-255 seconds.
371  * \param disc_trickle_imax Discovery trickle Imax. Range (2-2^8)*Imin.
372  * \param disc_trickle_k Discovery trickle k.
373  * \param pan_timeout PAN timeout; seconds; Range 60-15300 seconds.
374  * \return MESH_ERROR_NONE on success.
375  * \return MESH_ERROR_UNKNOWN in case of failure.
376  * */
377  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);
378 
379  /**
380  * \brief Set Wi-SUN device minimum sensitivity
381  *
382  * Function stores new parameters to mbed-mesh-api and uses them when connect() is called next time.
383  * If device is already connected to the Wi-SUN network then settings take effect right away.
384  *
385  * \param device_min_sens Device minimum sensitivity. Range 0(-174 dB) to 254(+80 dB).
386  * \return MESH_ERROR_NONE on success.
387  * \return MESH_ERROR_UNKNOWN in case of failure.
388  * */
389  mesh_error_t set_device_min_sens(uint8_t device_min_sens);
390 
391  /**
392  * \brief Get Wi-SUN device minimum sensitivity.
393  *
394  * Function reads device minimum sensitivity from mbed-mesh-api.
395  *
396  * \param device_min_sens Device minimum sensitivity. Range 0-254.
397  * \return MESH_ERROR_NONE on success.
398  * \return MESH_ERROR_UNKNOWN in case of failure.
399  * */
400  mesh_error_t get_device_min_sens(uint8_t *device_min_sens);
401 
402  /**
403  * \brief Validates Device minimum sensitivity.
404  *
405  * Function validates device minimum sensitivity. Function can be used to test that values that will be used on set
406  * function are valid.
407  *
408  * \param device_min_sens Device minimum sensitivity. Range 0-254.
409  * \return MESH_ERROR_NONE on success.
410  * \return MESH_ERROR_UNKNOWN in case of failure.
411  * */
412  mesh_error_t validate_device_min_sens(uint8_t device_min_sens);
413 
414  /**
415  * \brief Set own certificate and private key reference to the Wi-SUN network.
416  *
417  * Function can be called several times if intermediate certificates are used. Then each call to the function
418  * adds a certificate reference to own certificate chain. Certificates are in bottom up order i.e. own certificate
419  * is given first and the top certificate is given last.
420  *
421  * PEM formatted certificates must use either "\n" or "\r\n" as line separator. PEM formatted certificates
422  * must be NUL terminated and the NUL terminator is counted to certificate length.
423  *
424  * It is possible to add multiple PEM certificates concatenated together in one call set_own_certificate(). In that
425  * case certificates are in bottom up order i.e. own certificate is given first and the top certificate is given
426  * last. NUL terminator is added after the last concatenated certificate and the NUL terminator is counted to
427  * total concatenated certificate length.
428  *
429  * Function must be called before connecting the device i.e before call to connect() method.
430  * Function will not copy certificate or key, therefore addresses must remain valid.
431  *
432  * \param cert Certificate address.
433  * \param cert_len Certificate length in bytes.
434  * \param cert_key Certificate key address.
435  * \param cert_key_len Certificate key length in bytes.
436  * \return MESH_ERROR_NONE on success.
437  * \return MESH_ERROR_STATE if method is called after calling connect().
438  * \return MESH_ERROR_MEMORY in case of memory allocation failure.
439  * */
440  mesh_error_t set_own_certificate(uint8_t *cert, uint16_t cert_len, uint8_t *cert_key = NULL, uint16_t cert_key_len = 0);
441 
442  /**
443  * \brief Remove own certificates from the Wi-SUN network.
444  *
445  * Function must be called before connecting the device i.e before call to connect() method.
446  *
447  * \return MESH_ERROR_NONE on success.
448  * \return MESH_ERROR_STATE if method is called after calling connect().
449  * */
450  mesh_error_t remove_own_certificates(void);
451 
452  /**
453  * \brief Set trusted certificate reference to the Wi-SUN network.
454  *
455  * Function can be called several times. Each call to the function adds a trusted certificate to Wi-SUN.
456  *
457  * PEM formatted certificates must use either "\n" or "\r\n" as line separator. PEM formatted certificates
458  * must be NUL terminated and the NUL terminator is counted to certificate length.
459  *
460  * It is possible to add multiple PEM certificates concatenated together in one call set_trusted_certificate().
461  * NUL terminator is added after the last concatenated certificate and the NUL terminator is counted to
462  * total concatenated certificate length.
463  *
464  * Function must be called before connecting the device i.e before call to connect() method.
465  * Function will not copy certificate, therefore addresses must remain valid.
466  *
467  * \param cert Certificate address.
468  * \param cert_len Certificate length in bytes.
469  * \return MESH_ERROR_NONE on success.
470  * \return MESH_ERROR_STATE if method is called after calling connect().
471  * \return MESH_ERROR_MEMORY in case of memory allocation failure.
472  * */
473  mesh_error_t set_trusted_certificate(uint8_t *cert, uint16_t cert_len);
474 
475  /**
476  * \brief Remove trusted certificates from the Wi-SUN network.
477  *
478  * Function must be called before connecting the device i.e before call to connect() method.
479  *
480  * \return MESH_ERROR_NONE on success.
481  * \return MESH_ERROR_STATE if method is called after calling connect().
482  * */
483  mesh_error_t remove_trusted_certificates(void);
484 
485  /**
486  * \brief Get router IP address
487  *
488  * \param address
489  * \param len
490  * */
491  bool getRouterIpAddress(char *address, int8_t len);
492 
493  /**
494  * \brief Enable Wi-SUN statistics
495  *
496  * After enabling statistics those can be read using the network, physical layer,
497  * MAC and FHSS and Wi-SUN statistics read functions.
498  *
499  * \return MESH_ERROR_NONE on success.
500  * \return MESH_ERROR_UNKNOWN on error
501  * */
502  mesh_error_t enable_statistics(void);
503 
504  /**
505  * \brief Reads Wi-SUN network statistics
506  *
507  * Reads network statistics.
508  *
509  * \param statistics Network statistics.
510  * \return MESH_ERROR_NONE on success.
511  * \return MESH_ERROR_UNKNOWN on error
512  * */
513  mesh_error_t read_nw_statistics(mesh_nw_statistics_t *statistics);
514 
515  /**
516  * \brief Reads Wi-SUN MAC statistics
517  *
518  * Reads MAC statistics.
519  *
520  * \param statistics MAC statistics.
521  * \return MESH_ERROR_NONE on success.
522  * \return MESH_ERROR_UNKNOWN on error
523  * */
524  mesh_error_t read_mac_statistics(mesh_mac_statistics_t *statistics);
525 
526  /**
527  * \brief Get Wi-SUN Router information.
528  *
529  * Function reads RPL information from nanostack.
530  * Mesh interface must be initialized before calling this function.
531  *
532  * \param info_ptr Structure given to stack where information will be stored
533  *
534  * \return MESH_ERROR_NONE on success.
535  * \return MESH_ERROR_UNKNOWN in case of failure.
536  * */
537  mesh_error_t info_get(ws_rpl_info_t *info_ptr);
538 
539  /**
540  * \brief Get Wi-SUN Stack information.
541  *
542  * Function reads Stack information from nanostack.
543  * Mesh interface must be initialized before calling this function.
544  *
545  * \param stack_info_ptr Structure given to stack where information will be stored
546  *
547  * \return MESH_ERROR_NONE on success.
548  * \return MESH_ERROR_UNKNOWN in case of failure.
549  * */
550  mesh_error_t stack_info_get(ws_stack_state_t *stack_info_ptr);
551 
552  /**
553  * \brief Get Wi-SUN CCA threshold table information.
554  *
555  * Function reads CCA threshold table from nanostack.
556  *
557  ** \param ws_cca_threshold_table_t Structure given to stack where information will be stored
558  **
559  * \return MESH_ERROR_NONE on success.
560  * \return MESH_ERROR_UNKNOWN in case of failure.
561  * */
562  mesh_error_t cca_threshold_table_get(ws_cca_threshold_table_t *table);
563 
564 protected:
565  Nanostack::WisunInterface *get_interface() const;
566  nsapi_error_t do_initialize() override;
567  virtual nsapi_error_t configure();
568 };
569 
570 #endif
uint8_t join_state
Wi-SUN join state defined by Wi-SUN specification 1-5.
Wi-SUN mesh network interface class.
uint8_t version
RPL version number.
signed int nsapi_error_t
Type used to represent error codes.
Definition: nsapi_types.h:140
uint16_t primary_parent_rank
RPL Primary Parent Rank.
Mesh physical layer statistics.
Mesh network statistics.
Struct ws_stack_state Wi-SUN stack information.
uint8_t instance_id
Router instance identifier.
const int8_t * cca_threshold_table
CCA threshold table.
uint8_t number_of_channels
Number of channels.
Struct ws_cca_threshold_table Wi-SUN CCA threshold table information.
uint8_t rsl_out
parent RSSI Out measured RSSI value calculated using EWMA specified by Wi-SUN from range of -174 (0) ...
uint8_t rsl_in
parent RSSI in measured RSSI value calculated using EWMA specified by Wi-SUN from range of -174 (0) t...
uint8_t device_min_sens
Device RF minimum sensitivity configuration.
uint8_t rpl_dodag_id[16]
Router dodag id.
Struct ws_rpl_info Wi-SUN router RPL information.
uint16_t current_rank
RPL DODAG node current Rank.
uint16_t pan_id
Network PAN ID.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.