Mistake on this page?
Report an issue in GitHub or email us
mesh_interface_types.h
1 /*
2  * Copyright (c) 2015 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 __MESH_INTERFACE_TYPES_H__
18 #define __MESH_INTERFACE_TYPES_H__
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 /**
25  * Mesh network types
26  */
27 typedef enum {
28  MESH_TYPE_6LOWPAN_ND = 0,
29  MESH_TYPE_THREAD
30 } mesh_network_type_t;
31 
32 /**
33  * Error status values returned by Mesh network API.
34  */
35 typedef enum {
36  MESH_ERROR_NONE = 0, /*<! No error */
37  MESH_ERROR_UNKNOWN, /*<! Unspecified error */
38  MESH_ERROR_MEMORY, /*<! Memory error */
39  MESH_ERROR_STATE, /*<! Illegal state */
40  MESH_ERROR_PARAM, /*<! Illegal parameter */
41 } mesh_error_t;
42 
43 /**
44  * Mesh network connection status codes returned in callback.
45  */
46 typedef enum {
47  MESH_CONNECTED = 0, /*<! connected to network */
48  MESH_CONNECTED_LOCAL, /*<! connected to network, got local IP */
49  MESH_CONNECTED_GLOBAL, /*<! connected to network, got global IP */
50  MESH_DISCONNECTED, /*<! disconnected from network */
51  MESH_BOOTSTRAP_START_FAILED, /*<! error during bootstrap start */
52  MESH_BOOTSTRAP_FAILED, /*<! error in bootstrap */
53  MESH_BOOTSTRAP_STARTED /*<! bootstrap started */
54 } mesh_connection_status_t;
55 
56 /**
57  * Mesh device types
58  */
59 typedef enum {
60  MESH_DEVICE_TYPE_THREAD_ROUTER = 0, /*<! Thread router */
61  MESH_DEVICE_TYPE_THREAD_SLEEPY_END_DEVICE, /*<! Thread Sleepy end device */
62  MESH_DEVICE_TYPE_THREAD_MINIMAL_END_DEVICE, /*<! Thread minimal end device */
63  MESH_DEVICE_TYPE_WISUN_ROUTER, /*<! Wi-SUN router */
64  MESH_DEVICE_TYPE_WISUN_BORDER_ROUTER /*<! Wi-SUN border router */
65 } mesh_device_type_t;
66 
67 /**
68  * Mesh channel function
69  */
70 typedef enum {
71  MESH_CHANNEL_FUNCTION_FIXED = 0x00,
72  MESH_CHANNEL_FUNCTION_TR51CF,
73  MESH_CHANNEL_FUNCTION_DH1CF,
74  MESH_CHANNEL_FUNCTION_VENDOR_DEFINED
75 } mesh_channel_function_t;
76 
77 /**
78  * Mesh network statistics
79  */
80 typedef struct {
81  uint32_t rpl_total_memory; /*<! RPL current memory usage total. */
82  uint16_t etx_1st_parent; /*<! Primary parent ETX. */
83  uint16_t etx_2nd_parent; /*<! Secondary parent ETX. */
84  uint32_t asynch_tx_count; /*<! Asynch TX counter */
85  uint32_t asynch_rx_count; /*<! Asynch RX counter */
87 
88 /**
89  * Mesh physical layer statistics
90  */
91 typedef struct {
92  uint32_t mac_rx_count; /*<! MAC RX packet count. */
93  uint32_t mac_tx_count; /*<! MAC TX packet count. */
94  uint32_t mac_bc_rx_count; /*<! MAC broadcast RX packet count. */
95  uint32_t mac_bc_tx_count; /*<! MAC broadcast TX packet count. */
96  uint32_t mac_tx_bytes; /*<! MAC TX bytes count. */
97  uint32_t mac_rx_bytes; /*<! MAC RX bytes count. */
98  uint32_t mac_tx_failed_count; /*<! MAC TX failed count. */
99  uint32_t mac_retry_count; /*<! MAC TX retry count. */
100  uint32_t mac_cca_attempts_count; /*<! MAC CCA attempts count. */
101  uint32_t mac_failed_cca_count; /*<! MAC failed CCA count. */
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 #endif /* __MESH_INTERFACE_TYPES_H__ */
Mesh physical layer statistics.
Mesh network statistics.
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.