9eb2174df7e05ed7b0208c379d6ff182ad2a0b2e
[platform/core/api/zigbee.git] / include / zdo / zb-zdo-type.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may 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,
12  * WITHOUT 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 #ifndef __ZB_ZDO_TYPE_H__
17 #define __ZB_ZDO_TYPE_H__
18
19 #include <zb-type.h>
20
21 /**
22  * @file zb-zdo-type.h
23  */
24
25 /**
26  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
27  * @brief Table 2.138 ZDP Enumerations Description
28  *
29  * @since_tizen 3.0
30  */
31 typedef enum {
32         ZB_ZDP_SUCCESS = 0, /**< Success */
33         ZB_ZDP_INV_REQUESTTYPE = 0x80, /**< Invalid Request Type */
34         ZB_ZDP_DEVICE_NOT_FOUND = 0x81, /**< Device Not Found */
35         ZB_ZDP_INVALID_EP = 0x82, /**< Invalid Endpoint */
36         ZB_ZDP_NOT_ACTIVE = 0x83, /**< Not Active */
37         ZB_ZDP_NOT_SUPPORTED = 0x84, /**< Not Supported */
38         ZB_ZDP_TIMEOUT = 0x85, /**< Timeout */
39         ZB_ZDP_NO_MATCH = 0x86, /**< No Match */
40         ZB_ZDP_NO_ENTRY = 0x88, /**< No Entry */
41         ZB_ZDP_NO_DESCRIPTOR = 0x89, /**< No Descriptor */
42         ZB_ZDP_INSUFFICIENT_SPACE = 0x8A, /**< Insufficient Space */
43         ZB_ZDP_NOT_PERMITED = 0x8B, /**< Not Permitted */
44         ZB_ZDP_TABLE_FULL = 0x8C, /**< Table Full */
45         ZB_ZDP_NOT_AUTHORIZED = 0x8D, /**< Not Authorized */
46         ZB_ZDP_DEVICE_BINDING_TABLE_FULL = 0x8E, /**< Binding Table Full */
47 } zb_zdo_status_e;
48
49 /**
50  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
51  * @brief RequestType Enumeration
52  *
53  * @since_tizen 3.0
54  */
55 typedef enum {
56         ZB_ZDP_SINGLE_DEVICE_RESPONSE = 0, /**< 0 : Single Device Response */
57         ZB_ZDP_EXTENDED_RESPONSE = 1, /**< 1 : Extended Response */
58 } zb_zdo_request_type_e;
59
60 /**
61  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
62  * @brief Table 2.30 Values of the Logical Type Field
63  *
64  * @since_tizen 3.0
65  */
66 typedef enum {
67         ZB_ZDP_COORDINATOR = 0, /**< Coordinator */
68         ZB_ZDP_ROUTER = 1, /**< Router */
69         ZB_ZDP_END_DEVIEC = 2, /**< End Device */
70 } zb_zdo_logical_type_e;
71
72 /**
73  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
74  * @brief Table 2.31 Values of the Frequency Band Field
75  *
76  * @since_tizen 3.0
77  */
78 typedef enum {
79         ZB_ZDP_868_868_6_MHZ = 0, /**< 868~888.6MHz */
80         ZB_ZDP_902_928_MHA = 2, /**< 902~928MHz */
81         ZB_ZDP_2400_2483_5_MHZ = 3, /**< 2400~2483.5MHz */
82 } zb_zdo_frequency_band_e;
83
84 /**
85  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
86  * @brief Alternative PAN coordinator bit in MAC capability Flags
87  *
88  * @since_tizen 3.0
89  */
90 typedef enum {
91         ZB_ZDP_DO_NOT_SUPPORT_PAN_COORDINATOR = 0, /**< Otherwise..*/
92         ZB_ZDP_SUPPORT_PAN_COORDINATOR = 1, /**< This node is capable of becoming a PAN
93                 coordinator. */
94 } zb_zdo_alternative_pan_coordinator_e;
95
96 /**
97  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
98  * @brief Device type bit in MAC capability Flags
99  *
100  * @since_tizen 3.0
101  */
102 typedef enum {
103         ZB_ZDP_RFD = 0, /**< This node is a reduced function device (RFD) */
104         ZB_ZDP_FFD = 1, /**< This node is a full function device (FFD) */
105 } zb_zdo_device_type_e;
106
107 /**
108  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
109  * @brief Power Source bit in MAC capability Flags
110  *
111  * @since_tizen 3.0
112  */
113 typedef enum {
114         ZB_ZDP_NO_NODE_POWER_DESCRIPTION = 0, /**< Otherwise.. */
115         ZB_ZDP_MAIN_POWER = 1, /**< Current power source is main power. This information is
116                 derived from the node current power source field of the node power descriptor */
117 } zb_zdo_power_source_e;
118
119 /**
120  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
121  * @brief Receiver on when idle bit in MAC capability Flags
122  *
123  * @since_tizen 3.0
124  */
125 typedef enum {
126         ZB_ZDP_KEEP_POWER_SAVE_MODE = 0, /**< Otherwise.. */
127         ZB_ZDP_DO_NOT_POWER_SAVE_MODE = 1, /**< The device does not disable its receiver to
128                 conserve power during idle periods. */
129 } zb_zdo_receiver_on_when_idle_e;
130
131 /**
132  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
133  * @brief Security capability bit in MAC capability Flags
134  *
135  * @since_tizen 3.0
136  */
137 typedef enum {
138         ZB_ZDP_DO_NOT_SUPPORT_SECURITY_MODE = 0,
139         ZB_ZDP_SUPPORT_SECURITY_MODE = 1,
140 } zb_zdo_security_capability_e;
141
142 /**
143  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
144  * @brief Figure 2.17 Format of the MAC Capability Flags Field
145  *
146  * @since_tizen 3.0
147  */
148 typedef enum {
149         ZB_ZDP_ALTERNATIVE_PAN_COORDINATOR = (1 << 0), /**< Alternative Pan Coordinator see
150                 #zb_zdo_alternative_pan_coordinator_e */
151         ZB_ZDP_DEVICE_TYPE = (1 << 1), /**< Device Type see #zb_zdo_device_type_e */
152         ZB_ZDP_POWER_SOURCE = (1 << 2), /**< Power Source see #zb_zdo_power_source_e */
153         ZB_ZDP_RECEIVER_ON_WHEN_IDLE = (1 << 3), /**< Register on When Idle
154                 see #zb_zdo_receiver_on_when_idle_e */
155         ZB_ZDP_SECURITY_CAPABILITY = (1 << 6), /**< Security Capability
156                 see #zb_zdo_security_capability_e */
157         ZB_ZDP_ALLOCATE_ADDRESS = (1 << 7), /**< Allocated Address.\n
158                 This mean device receive network address from coordinator\n
159                 This field will always have a value of 1 in implementations of IEEE 802.15.4 spec,
160                 indicating that the joining device must be issued a 16-bit short address */
161 } zb_zdo_mac_capability_field_e;
162
163 /**
164  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
165  * @brief Table 2.32 Server Mask Bit Assignments
166  *
167  * @since_tizen 3.0
168  */
169 typedef enum {
170         ZB_ZDP_PRIMARY_TRUST_CENTER = (1 << 0), /**< Primary Trust Center */
171         ZB_ZDP_BACKUP_TRUST_CENTER = (1 << 1), /**< Backup Trust Center */
172         ZB_ZDP_PRIMARY_BINDING_TABLE_CACHE = (1 << 2), /**< Primary Binding Table Cache */
173         ZB_ZDP_BACKUP_BINDING_TABLE_CACHE = (1 << 3), /**< Backup Binding Table Cache */
174         ZB_ZDP_PRIMARY_DISCOVERY_CACHE = (1 << 4), /**< Primary Discovery Cache */
175         ZB_ZDP_BACKUP_DISCOVERY_CACHE = (1 << 5), /**< Backup Discovery Cache */
176         ZB_ZDP_NETWORK_MANAGER = (1 << 6), /**< Network Manager */
177 } zb_zdo_server_mask_e;
178
179 /**
180  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
181  * @brief Table 2.29 Fields of the Node Descriptor
182  * @details Type and capabilities of the node.
183  *
184  * @since_tizen 3.0
185  */
186 typedef struct zb_zdo_node_descriptor_s* zb_zdo_node_descriptor_h;
187
188 /**
189  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
190  * @brief Table 2.35 Values of the Current Power Mode Field
191  *
192  * @since_tizen 3.0
193  */
194 typedef enum {
195         ZB_ZDP_RECEVIER_SYNCHRONIZED_WITH_RECEVIER_ON = 0, /**< Register Synchronized with Receiver On */
196         ZB_ZDP_RECEIVER_COMES_ON_PERIODICALLY = (1 << 0), /**< Register Comes on Periodically */
197         ZB_ZDP_RECEIVER_COMES_ON_WHEN_STIMULATED = (1 << 1), /**< Register Comes on When Stimulated */
198 } zb_zdo_current_power_mode_e;
199
200 /**
201  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
202  * @brief Table 2.34 Fields of the Node Power Descriptor
203  *
204  * @since_tizen 3.0
205  */
206 typedef enum {
207         ZB_ZDP_CONSTANT_POWER = 0, /**< Constant Power */
208         ZB_ZDP_RECHARGEABLE_BATTERY = 1, /**< Rechargeable Battery */
209         ZB_ZDP_DISPOSABLE_BATTERY = 2, /**< Disposable Battery */
210 } zb_zdo_available_power_source_e;
211
212 /**
213  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
214  * @brief Table 2.36 Values of the Available Power Sources Field
215  *
216  * @since_tizen 3.0
217  */
218 typedef enum {
219         ZB_ZDP_CHARGE_LEVEL_CRITICAL = 0, /**< Charge Level Critical */
220         ZB_ZDP_CHARGE_LEVEL_33 = 1, /**< Charge Level 33% */
221         ZB_ZDP_CHARGE_LEVEL_66 = 2, /**< Charge Level 66% */
222         ZB_ZDP_CHARGE_LEVEL_100 = 3, /**< Charge Level 100% */
223 } zb_zdo_current_power_source_level_e;
224
225 /**
226  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
227  * @brief Binding type
228  *
229  * @since_tizen 3.0
230  */
231 typedef enum {
232         ZB_UNICAST_BINDING = 0x03, /**< A unicast binding whose 64-bit identifier is the
233                                                                 destination ieee_addr. */
234         ZB_MANY_TO_ONE_BINDING = 0x83, /**< A unicast binding whose 64-bit identifier is the
235                                                                 many-to-one destination ieee_addr. A Route discovery
236                                                                 should be disabled when sending unicast via may-to-one
237                                                                 binding */
238         ZB_MULTICAST_BINDING = 0x01, /**< A multicast binding whose 64-bit identifier is the
239                                                                 group address. A multicast binding can be used to send
240                                                                 messages to the group and to receive message sent to
241                                                                 the group */
242 } zb_binding_type_e;
243
244 /**
245  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
246  * @brief Table 2.34 Fields of the Node Power Descriptor .
247  * @details Node power characteristics.
248  *
249  * @since_tizen 3.0
250  */
251 typedef struct zb_zdo_node_power_descriptor_s* zb_zdo_node_power_descriptor_h;
252
253
254 #define MAX_ENDPOINT_CLUSTERS 32 /**< Cluster counts to handle with */
255
256 /**
257  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
258  * @details Device descriptions contained in node.
259  *
260  * @since_tizen 3.0
261  */
262 typedef struct zb_zdo_simple_desc_s* zb_zdo_simple_desc_h;
263
264 /**
265  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
266  * @brief The handle of zigbee end-device information
267  * @details a zb_end_device_info_h is an opaque data structure.\n
268  * zb_end_device_info_h is a data type of network address, IEEE address, endpoint count
269  * and endpoint information structure.
270  *
271  * @since_tizen 3.0
272  */
273 typedef struct zb_end_device_info_s* zb_end_device_info_h;
274
275
276 /**
277  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
278  * @brief Table 2.125 NetworkList Record Format.
279  *
280  * @since_tizen 3.0
281  */
282 typedef struct zb_zdo_network_list_record_s* zb_zdo_network_list_record_h;
283
284 /**
285  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
286  * @brief Table 2.127 NeighborTableList Record Format.
287  *
288  * @since_tizen 3.0
289  */
290 typedef struct zb_zdo_neighbor_table_desc_s* zb_zdo_neighbor_table_desc_h;
291
292 /**
293  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
294  * @brief Table 2.129 RoutingTableList Record Format.
295  *
296  * @since_tizen 3.0
297  */
298 typedef struct zb_zdo_routing_table_s* zb_zdo_routing_table_h;
299
300 /**
301  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
302  * @brief Table 2.131 BindingTableList Record Format.
303  *
304  * @since_tizen 3.0
305  */
306 typedef struct zb_zdo_binding_table_s* zb_zdo_binding_table_h;
307
308 /**
309  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
310  * @brief Table 2.136 DiscoveryCacheList Record Format.
311  *
312  * @since_tizen 3.0
313  */
314 typedef struct zb_zdo_discovery_cache_s* zb_zdo_discovery_cache_h;
315
316
317 /**
318  * @}
319  */
320
321 #endif /* __ZB_ZDO_TYPE_H__ */
322