Mbed OS Reference
Loading...
Searching...
No Matches
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
21extern "C" {
22#endif
23
24/**
25 * Mesh network types
26 */
27typedef 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 */
35typedef 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 */
46typedef 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 */
59typedef 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 */
70typedef 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 */
80typedef 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 */
86 uint32_t join_state_1; /*<! Time spent in individual Wi-SUN join state 1 Discovery */
87 uint32_t join_state_2; /*<! Time spent in individual Wi-SUN join state 2 Authentication */
88 uint32_t join_state_3; /*<! Time spent in individual Wi-SUN join state 3 Configuration learn */
89 uint32_t join_state_4; /*<! Time spent in individual Wi-SUN join state 4 RPL parent discovery */
90 uint32_t join_state_5; /*<! Time spent in individual Wi-SUN join state 5 Active state */
91 uint32_t sent_PAS; /*<! Amount of Wi-SUN Pan Advertisement Solicit Message sent */
92 uint32_t sent_PA; /*<! Amount of Wi-SUN Pan Advertisement Message sent */
93 uint32_t sent_PCS; /*<! Amount of Wi-SUN Pan Configuration Solicit Message sent */
94 uint32_t sent_PC; /*<! Amount of Wi-SUN Pan Configuration Message sent */
95 uint32_t recv_PAS; /*<! Amount of Wi-SUN Pan Advertisement Solicit Message received */
96 uint32_t recv_PA; /*<! Amount of Wi-SUN Pan Advertisement Message received */
97 uint32_t recv_PCS; /*<! Amount of Wi-SUN Pan Configuration Solicit Message received */
98 uint32_t recv_PC; /*<! Amount of Wi-SUN Pan Configuration Message received */
99 uint32_t Neighbour_add; /*<! New Neighbours found */
100 uint32_t Neighbour_remove; /*<! New Neighbours Removed */
101 uint32_t Child_add; /*<! New Child added */
102 uint32_t child_remove; /*<! Child lost */
104
105/**
106 * Mesh physical layer statistics
107 */
108typedef struct {
109 uint32_t mac_rx_count; /*<! MAC RX packet count. */
110 uint32_t mac_tx_count; /*<! MAC TX packet count. */
111 uint32_t mac_bc_rx_count; /*<! MAC broadcast RX packet count. */
112 uint32_t mac_bc_tx_count; /*<! MAC broadcast TX packet count. */
113 uint32_t mac_tx_bytes; /*<! MAC TX bytes count. */
114 uint32_t mac_rx_bytes; /*<! MAC RX bytes count. */
115 uint32_t mac_tx_failed_count; /*<! MAC TX failed count. */
116 uint32_t mac_retry_count; /*<! MAC TX retry count. */
117 uint32_t mac_cca_attempts_count; /*<! MAC CCA attempts count. */
118 uint32_t mac_failed_cca_count; /*<! MAC failed CCA count. */
120
121#ifdef __cplusplus
122}
123#endif
124
125#endif /* __MESH_INTERFACE_TYPES_H__ */
Mesh physical layer statistics.
Mesh network statistics.