Fixed ACR issue.
[platform/core/api/zigbee.git] / include / zigbee.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 __TIZEN_CAPI_NETWORK_ZIGBEE_H__
17 #define __TIZEN_CAPI_NETWORK_ZIGBEE_H__
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 /**
24  * @file zigbee.h
25  */
26
27 /**
28  * @ingroup CAPI_NETWORK_FRAMEWORK
29  * @addtogroup CAPI_NETWORK_ZIGBEE_MODULE ZigBee
30  *
31  * @{
32  */
33
34 /**
35  * @brief Zigbee profile id.
36  *
37  * @since_tizen 4.0
38  */
39 typedef enum {
40         ZB_PROFILE_HOME_AUTOMATION = 0x0104, /**< Zigbee Home Automation profile */
41 } zb_profile_id_e;
42
43 #include <tizen_error.h>
44
45 /**
46  * @brief Enumeration for zigbee CAPI error code.
47  * @since_tizen 4.0
48  */
49 typedef enum {
50         ZIGBEE_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
51         ZIGBEE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
52         ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE = TIZEN_ERROR_RESULT_OUT_OF_RANGE, /**< Out of range */
53         ZIGBEE_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
54         ZIGBEE_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< DBus error */
55         ZIGBEE_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA, /**< No data available */
56         ZIGBEE_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
57         ZIGBEE_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
58         ZIGBEE_ERROR_INVALID_ENDPOINT = TIZEN_ERROR_ZIGBEE | 0x01, /**< Endpoint 0 is reserved for ZDP */
59         ZIGBEE_ERROR_INVALID_ADDRESS = TIZEN_ERROR_ZIGBEE | 0x02, /**< Wrong address */
60         ZIGBEE_ERROR_OPERATION_FAILED = TIZEN_ERROR_ZIGBEE | 0x03, /**< Operation failed */
61 } zb_error_e;
62
63 #include <tizen_type.h>
64 #include <zigbee-zdo-type.h>
65 #include <zigbee-zcl-type.h>
66
67 /**
68  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
69  * @brief The data type abbreviation : IEEE Address.
70  *
71  * @since_tizen 4.0
72  */
73 typedef unsigned char zb_ieee_addr[8];
74
75 /**
76  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
77  * @brief The data type abbreviation : Network Address.
78  *
79  * @since_tizen 4.0
80  */
81 typedef unsigned short zb_nwk_addr;
82
83 /**
84  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
85  * @brief The data type abbreviation : End Point.
86  *
87  * @since_tizen 4.0
88  */
89 typedef unsigned char zb_end_point;
90
91 /**
92  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
93  * @brief The data type abbreviation : Device ID.
94  *
95  * @since_tizen 4.0
96  */
97 typedef unsigned short zb_device_id;
98
99 /**
100  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
101  * @brief The data type abbreviation : Profile ID.
102  *
103  * @since_tizen 4.0
104  */
105 typedef unsigned short zb_profile_id;
106
107 /**
108  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
109  * @brief The data type abbreviation : Cluster ID.
110  *
111  * @since_tizen 4.0
112  */
113 typedef unsigned short zb_cluster_id;
114
115 /**
116  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
117  * @brief The data type abbreviation : Attribute ID.
118  *
119  * @since_tizen 4.0
120  */
121 typedef unsigned short zb_attribute_id;
122
123 /**
124  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
125  * @brief The data type abbreviation : Command ID.
126  *
127  * @since_tizen 4.0
128  */
129 typedef unsigned char zb_command_id;
130
131 /**
132  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
133  * @brief The data type abbreviation : 128 bit security key.
134  *
135  * @since_tizen 4.0
136  */
137 typedef unsigned char zb_aes128_key[16];
138
139 /**
140  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
141  * @brief The handle of zigbee.
142  * @since_tizen 4.0
143  */
144 typedef void* zb_zigbee_h;
145
146 /**
147  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
148  * @brief The event handle.
149  *
150  * @since_tizen 4.0
151  */
152 typedef void* zb_event_data_h;
153
154 /**
155  * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
156  * @brief The events for zb_event_cb().
157  *
158  * @since_tizen 4.0
159  */
160 typedef enum {
161         ZB_ZDP_ENABLE_EVENT = 0x00, /**< This event is received after enabling zigbee system service */
162         ZB_ZDP_FORM_NETWORK_DONE = 0x01, /**< This event comes from coming network operation completed */
163         ZB_ZDP_JOIN_EVENT = 0x02, /**< This event takes place when a new device joins */
164         ZB_ZDP_REJOIN_EVENT = 0x03, /**< This event takes place when an existing device or devices which are received 'leave_network' command are re-joined */
165         ZB_ZDP_CHILD_LEFT = 0x04, /**< This event takes place when a child device leaves current network explicitly */
166         ZB_ZDP_LEAVE_DONE_EVENT = 0x05, /**< This event will take place after dismissing the current network */
167         ZB_ZCL_GLOBAL_DEFAULT_RSP_EVENT = 0x10, /**< This event is used when global default response */
168         ZB_ZCL_IAS_ZONE_ENROLL_REQUEST_EVENT = 0x21, /**< A Device which supports IAS zone cluster wants to register its ability */
169         ZB_ZCL_IAS_ZONE_STATUS_CHANGE_NOTIFICATION_EVENT = 0x22, /**< A Device which supports IAS zone cluster announces its status change */
170         ZB_ZCL_IAS_ZONE_STATUS_CHANGE_EXTENDED_NOTIFICATION_EVENT = 0x23, /**< A Device which supports IAS zone cluster announces its status change */
171 } zb_event_e;
172
173 /**
174  * @brief Creates handle to access the zigbee service.
175  *
176  * @since_tizen 4.0
177  *
178  * @remarks The @a handle should be released using zb_destroy().
179  *
180  * @param[out] handle The handle of zigbee
181  *
182  * @return 0 on success, otherwise a negative error value.
183  * @retval #ZIGBEE_ERROR_NONE Successful
184  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
185  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
186  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
187  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
188  *
189  * @see zb_destroy()
190  */
191 int zb_create(zb_zigbee_h *handle);
192
193 /**
194  * @brief Destroys to the zigbee service handle.
195  * @details All this function to stop zigbee service
196  *
197  * @since_tizen 4.0
198  *
199  * @param[in] handle The handle of zigbee
200  *
201  * @return 0 on success, otherwise a negative error value.
202  * @retval #ZIGBEE_ERROR_NONE Successful
203  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
204  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
205  *
206  * @see zb_create()
207  */
208 int zb_destroy(zb_zigbee_h handle);
209
210 /**
211  * @platform
212  * @brief Enables the zigbee service.
213  * @details All this function to start zigbee service
214  *
215  * @since_tizen 4.0
216  * @privlevel platform
217  * @privilege %http://tizen.org/privilege/zigbee.admin
218  *
219  * @remarks You must free all resources of the zigbee by calling zb_destroy()
220  * if zigbee service is no longer needed.
221  *
222  * @param[in] handle The handle of zigbee
223  *
224  * @return 0 on success, otherwise a negative error value.
225  * @retval #ZIGBEE_ERROR_NONE Successful
226  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
227  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
228  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
229  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
230  *
231  * @see zb_create()
232  * @see zb_destroy()
233  *
234  */
235 int zb_enable(zb_zigbee_h handle);
236
237 /**
238  * @platform
239  * @brief Disables the zigbee service.
240  * @details Call this function to stop the zigbee service.
241  *
242  * @since_tizen 4.0
243  * @privlevel platform
244  * @privilege %http://tizen.org/privilege/zigbee.admin
245  *
246  * @remarks You must free all resources of the zigbee by calling zb_destroy()
247  * if zigbee service is no longer needed.
248  *
249  * @param[in] handle The handle of zigbee
250  *
251  * @return 0 on success, otherwise a negative error value.
252  * @retval #ZIGBEE_ERROR_NONE Successful
253  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
254  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
255  * @retval #ZIGBEE_ERROR_NO_DATA No data available
256  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
257  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
258  *
259  * @see zb_create()
260  * @see zb_destroy()
261  *
262  */
263 int zb_disable(zb_zigbee_h handle);
264
265 /**
266  * @brief Called after receiving events from zigbee service.
267  * @details This function can receive events from the devices in the network.
268  * ex) join, re-join, leave and attribute change report
269  *
270  * @since_tizen 4.0
271  *
272  * @remarks The @a ev should not be released.
273  * @remarks The @a ev can be used only in the callback.
274  *
275  * @param[out] addr16 Network address (16 bit) from the source device
276  * @param[out] addr64 IEEE address (EUI64) from the source device
277  * @param[out] event_type The event identification
278  * @param[out] ev event data pointer
279  * @param[out] user_data User data
280  *
281  * @pre The callback must be registered when using zb_set_event_handler()
282  *
283  * @see #ZB_ZDP_ENABLE_EVENT
284  * @see #ZB_ZDP_JOIN_EVENT
285  * @see #ZB_ZDP_REJOIN_EVENT
286  * @see #ZB_ZDP_LEAVE_DONE_EVENT
287  * @see zb_event_cb()
288  */
289 typedef void (*zb_event_cb)(zb_nwk_addr addr16, zb_ieee_addr addr64, zb_event_e event_type,
290                 zb_event_data_h ev, void *user_data);
291
292 /**
293  * @brief Sets the event handler to get events from the zigbee service.
294  *
295  * @since_tizen 4.0
296  *
297  * @param[in] handle The handle of zigbee
298  * @param[in] event_handler The event handler
299  *
300  * @return 0 on success, otherwise a negative error value.
301  * @retval #ZIGBEE_ERROR_NONE Successful
302  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
303  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
304  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
305  *
306  * @see zb_create()
307  * @see zb_destroy()
308  *
309  */
310 int zb_set_event_cb(zb_zigbee_h handle, zb_event_cb event_handler);
311
312 /**
313  * @brief Gets status code of enable commmand.
314  * @since_tizen 4.0
315  *
316  * @param[in] ev Event data structure
317  * @param[out] status The result of enable command
318  *
319  * @return 0 on success, otherwise a negative error value.
320  * @retval #ZIGBEE_ERROR_NONE Successful
321  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
322  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
323  *
324  */
325 int zb_ev_get_enable_status(zb_event_data_h ev, zb_error_e* status);
326
327 /**
328  * @brief Gets PAN ID after forming a network.
329  * @since_tizen 4.0
330  *
331  * @param[in] ev Event data structure
332  * @param[out] pan_id The result of enable command
333  *
334  * @return 0 on success, otherwise a negative error value.
335  * @retval #ZIGBEE_ERROR_NONE Successful
336  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
337  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
338  *
339  */
340 int zb_ev_get_form_network_panid(zb_event_data_h ev, zb_nwk_addr* pan_id);
341
342 /**
343  * @brief Gets the number of end-points of a joined device.
344  * @since_tizen 4.0
345  *
346  * @param[in] ev Event data structure
347  * @param[out] count The number of end-points of a device joined to the network
348  *
349  * @return 0 on success, otherwise a negative error value.
350  * @retval #ZIGBEE_ERROR_NONE Successful
351  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
352  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
353  *
354  */
355 int zb_ev_get_join_count(zb_event_data_h ev, unsigned char* count);
356
357 /**
358  * @brief Gets the end-point list at a new device joined.
359  * @since_tizen 4.0
360  *
361  * @remarks The @a ep should be released using free().
362  *
363  * @param[in] ev Event data structure
364  * @param[out] ep The end point list
365  *
366  * @return 0 on success, otherwise a negative error value.
367  * @retval #ZIGBEE_ERROR_NONE Successful
368  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
369  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
370  *
371  */
372 int zb_ev_get_join_ep(zb_event_data_h ev, zb_end_point** ep);
373
374
375 /**
376  * @brief Gets the status code of leave request commands.
377  * @since_tizen 4.0
378  *
379  * @param[in] ev Event data structure
380  * @param[out] status The result of end-device left command
381  *
382  * @return 0 on success, otherwise a negative error value.
383  * @retval #ZIGBEE_ERROR_NONE Successful
384  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
385  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
386  *
387  */
388 int zb_ev_get_child_left_status(zb_event_data_h ev, zb_error_e* status);
389
390 /**
391  * @brief Gets the end-point number of the device which sent this default response.
392  * @since_tizen 4.0
393  *
394  * @param[in] ev Event data structure
395  * @param[out] ep Source end point
396  *
397  * @return 0 on success, otherwise a negative error value.
398  * @retval #ZIGBEE_ERROR_NONE Successful
399  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
400  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
401  *
402  */
403 int zb_ev_get_global_default_rsp_ep(zb_event_data_h ev, zb_end_point* ep);
404
405 /**
406  * @brief Gets the cluster id of the device which sent this default response.
407  * @since_tizen 4.0
408  *
409  * @param[in] ev Event data structure
410  * @param[out] clusterid The cluster id
411  *
412  * @return 0 on success, otherwise a negative error value.
413  * @retval #ZIGBEE_ERROR_NONE Successful
414  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
415  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
416  *
417  */
418 int zb_ev_get_global_default_rsp_cluster_id(zb_event_data_h ev,
419                 zb_cluster_id* clusterid);
420
421 /**
422  * @brief Gets the command id of the device which sent this default response.
423  * @since_tizen 4.0
424  *
425  * @param[in] ev Event data structure
426  * @param[out] commandid The command id
427  *
428  * @return 0 on success, otherwise a negative error value.
429  * @retval #ZIGBEE_ERROR_NONE Successful
430  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
431  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
432  *
433  */
434 int zb_ev_get_global_default_rsp_command_id(zb_event_data_h ev,
435                 zb_command_id* commandid);
436
437 /**
438  * @brief Gets status code of a default response of the global command request.
439  * @since_tizen 4.0
440  *
441  * @param[in] ev Event data structure
442  * @param[out] status The result of the global command
443  *
444  * @return 0 on success, otherwise a negative error value.
445  * @retval #ZIGBEE_ERROR_NONE Successful
446  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
447  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
448  *
449  */
450 int zb_ev_get_global_default_rsp_status(zb_event_data_h ev,
451                 zb_zcl_status_e* status);
452
453 /**
454  * @brief Gets the end-point number of the IAS notification.
455  * @since_tizen 4.0
456  *
457  * @param[in] ev Event data structure
458  * @param[out] src_ep Source end point
459  *
460  * @return 0 on success, otherwise a negative error value.
461  * @retval #ZIGBEE_ERROR_NONE Successful
462  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
463  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
464  *
465  */
466 int zb_ev_get_ias_noti_src_ep(zb_event_data_h ev, zb_end_point* src_ep);
467
468 /**
469  * @brief Gets zone status of the IAS notification.
470  * @since_tizen 4.0
471  *
472  * @param[in] ev Event data structure
473  * @param[out] zone_status Zone status
474  *  Bit 0 : Alarm1 : 1 - opened or alarmed / 0 - closed or not alarmed\n
475  *  Bit 1 : Alarm2 : 1 - opened or alarmed / 0 - closed or not alarmed\n
476  *  Bit 2 : Temper : 1 - Tempered / 0 - Not tempered\n
477  *  Bit 3 : Battery : 1 - Low battery / 0 - Battery OK\n
478  *  Bit 4 : Supervision report : 1 - Report / 0 - Does not report\n
479  *  Note 1: This bit indicates whether the Zone issues periodic Zone Status Change\n
480  *  Notification commands. The CIE device may use these periodic reports as an\n
481  *  indication that a zone is operational. Zones that do not implement the periodic\n
482  *  reporting are required to set this bit to zero (the CIE will know not to interpret the\n
483  *  lack of reports as a problem).\n
484  *  Bit 5 : Restore reports : 1 - Reports restore / 0 - Does not report restore\n
485  *  Note 2: This bit indicates whether or not a Zone Status Change Notification\n
486  *  command will be sent to indicate that an alarm is no longer present. Some Zones\n
487  *  do not have the ability to detect that alarm condition is no longer present, they\n
488  *  only can tell that an alarm has occurred. These Zones must set the "Restore" bit to\n
489  *  zero, indicating to the CIE not to look for alarm-restore notifications.\n
490  *  Bit 6 : Trouble : 1 - Trouble/Failure / 0 - OK\n
491  *  Bit 7 : AC(mains) : 1 - ACMains fault / 0 - AC/Mains OK\n
492  *
493  * @return 0 on success, otherwise a negative error value.
494  * @retval #ZIGBEE_ERROR_NONE Successful
495  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
496  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
497  *
498  */
499 int zb_ev_get_ias_noti_zone_status(zb_event_data_h ev,
500                 unsigned short* zone_status);
501
502 /**
503  * @brief Gets the end-point number of the IAS extended notification.
504  * @since_tizen 4.0
505  *
506  * @param[in] ev Event data structure
507  * @param[out] src_ep Source end point
508  *
509  * @return 0 on success, otherwise a negative error value.
510  * @retval #ZIGBEE_ERROR_NONE Successful
511  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
512  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
513  *
514  */
515 int zb_ev_get_ias_ext_noti_src_ep(zb_event_data_h ev, zb_end_point* src_ep);
516
517 /**
518  * @brief Gets status of the IAS extended notification.
519  * @since_tizen 4.0
520  *
521  * @param[in] ev Event data structure
522  * @param[out] status Status
523  *
524  * @return 0 on success, otherwise a negative error value.
525  * @retval #ZIGBEE_ERROR_NONE Successful
526  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
527  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
528  *
529  */
530 int zb_ev_get_ias_ext_noti_status(zb_event_data_h ev, unsigned char* status);
531
532 /**
533  * @brief Gets zone status of the IAS extended notification.
534  * @since_tizen 4.0
535  *
536  * @param[in] ev Event data structure
537  * @param[out] zone_status Zone status
538  *  Bit 0 : Alarm1 : 1 - opened or alarmed / 0 - closed or not alarmed\n
539  *  Bit 1 : Alarm2 : 1 - opened or alarmed / 0 - closed or not alarmed\n
540  *  Bit 2 : Temper : 1 - Tempered / 0 - Not tempered\n
541  *  Bit 3 : Battery : 1 - Low battery / 0 - Battery OK\n
542  *  Bit 4 : Supervision report : 1 - Report / 0 - Does not report\n
543  *  Note 1: This bit indicates whether the Zone issues periodic Zone Status Change\n
544  *  Notification commands. The CIE device may use these periodic reports as an\n
545  *  indication that a zone is operational. Zones that do not implement the periodic\n
546  *  reporting are required to set this bit to zero (the CIE will know not to interpret the\n
547  *  lack of reports as a problem).\n
548  *  Bit 5 : Restore reports : 1 - Reports restore / 0 - Does not report restore\n
549  *  Note 2: This bit indicates whether or not a Zone Status Change Notification\n
550  *  command will be sent to indicate that an alarm is no longer present. Some Zones\n
551  *  do not have the ability to detect that alarm condition is no longer present, they\n
552  *  only can tell that an alarm has occurred. These Zones must set the "Restore" bit to\n
553  *  zero, indicating to the CIE not to look for alarm-restore notifications.\n
554  *  Bit 6 : Trouble : 1 - Trouble/Failure / 0 - OK\n
555  *  Bit 7 : AC(mains) : 1 - ACMains fault / 0 - AC/Mains OK\n
556  *
557  * @return 0 on success, otherwise a negative error value.
558  * @retval #ZIGBEE_ERROR_NONE Successful
559  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
560  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
561  *
562  */
563 int zb_ev_get_ias_ext_noti_zone_status(zb_event_data_h ev,
564                 unsigned short* zone_status);
565
566 /**
567  * @brief Gets delay of the IAS extended notification.
568  * @since_tizen 4.0
569  *
570  * @param[in] ev Event data structure
571  * @param[out] delay Delay
572  *
573  * @return 0 on success, otherwise a negative error value.
574  * @retval #ZIGBEE_ERROR_NONE Successful
575  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
576  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
577  *
578  */
579 int zb_ev_get_ias_ext_noti_delay(zb_event_data_h ev, unsigned short* delay);
580
581 /**
582  * @brief Gets zone id of the IAS extended notification.
583  * @since_tizen 4.0
584  *
585  * @param[in] ev Event data structure
586  * @param[out] zone_id Zone id
587  *
588  * @return 0 on success, otherwise a negative error value.
589  * @retval #ZIGBEE_ERROR_NONE Successful
590  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
591  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
592  *
593  */
594 int zb_ev_get_ias_ext_noti_zone_id(zb_event_data_h ev, unsigned char* zone_id);
595
596 /**
597  * @brief Gets the end-point number of the device which sent this enroll request.
598  * @since_tizen 4.0
599  *
600  * @param[in] ev Event data structure
601  * @param[out] src_ep Source end point
602  *
603  * @return 0 on success, otherwise a negative error value.
604  * @retval #ZIGBEE_ERROR_NONE Successful
605  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
606  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
607  *
608  */
609 int zb_ev_get_enroll_request_src_ep(zb_event_data_h ev, zb_end_point* src_ep);
610
611 /**
612  * @brief Gets the zone type of the enroll request.
613  * @since_tizen 4.0
614  *
615  * @param[in] ev Event data structure
616  * @param[out] zone_type Zone type \n
617  *                                 #ZB_ZCL_IAS_ZONE_TYPE_STANDARD_CIE \n
618  *                                 #ZB_ZCL_IAS_ZONE_TYPE_MOTION_SENSOR \n
619  *                                 #ZB_ZCL_IAS_ZONE_TYPE_CONTACT_SWITCH \n
620  *                                 #ZB_ZCL_IAS_ZONE_TYPE_FIRE_SENSOR \n
621  *                                 #ZB_ZCL_IAS_ZONE_TYPE_WATER_SENSOR \n
622  *                                 #ZB_ZCL_IAS_ZONE_TYPE_GAS_SENSOR \n
623  *                                 #ZB_ZCL_IAS_ZONE_TYPE_PERSONAL_EMERGENCY_SENSOR \n
624  *                                 #ZB_ZCL_IAS_ZONE_TYPE_MOVEMENT_SENSOR \n
625  *                                 #ZB_ZCL_IAS_ZONE_TYPE_REMOTE_CONTROL \n
626  *                                 #ZB_ZCL_IAS_ZONE_TYPE_KEY_FOB \n
627  *                                 #ZB_ZCL_IAS_ZONE_TYPE_KEYPAD \n
628  *                                 #ZB_ZCL_IAS_ZONE_TYPE_STANDARD_WARNING_DEVICE \n
629  *                                 #ZB_ZCL_IAS_ZONE_TYPE_INVALID
630  *
631  * @return 0 on success, otherwise a negative error value.
632  * @retval #ZIGBEE_ERROR_NONE Successful
633  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
634  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
635  *
636  */
637 int zb_ev_get_enroll_request_zone_type(zb_event_data_h ev,
638                 zb_zcl_ias_zone_type_e* zone_type);
639
640 /**
641  * @brief Gets the manufacturer code of the enroll request.
642  * @since_tizen 4.0
643  *
644  * @param[in] ev Event data structure
645  * @param[out] mfg_code Manufacturer code
646  *
647  * @return 0 on success, otherwise a negative error value.
648  * @retval #ZIGBEE_ERROR_NONE Successful
649  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
650  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
651  *
652  */
653 int zb_ev_get_enroll_request_mfg_code(zb_event_data_h ev,
654                 unsigned char* mfg_code);
655
656 /**
657  * @brief Called after zigbee network formation is completed.
658  * @details Response of forming the zigbee network
659  *
660  * @since_tizen 4.0
661  *
662  * @param[out] panid PAN ID
663  * @param[out] user_data user data
664  *
665  * @see zb_form_network()
666  */
667 typedef void (*zb_form_network_cb)(zb_nwk_addr panid, void *user_data);
668
669 /**
670  * @brief Makes the network work as a zigbee coordinator.
671  *
672  * @since_tizen 4.0
673  * @privlevel public
674  * @privilege %http://tizen.org/privilege/zigbee
675  *
676  * @remarks If you want to change parameters related to network configuration you should
677  * call zb_zdo_set_compatible_startup_parameters() function.
678  *
679  * @param[in] handle The handle of zigbee
680  * @param[in] cb zb_form_network_cb()
681  * @param[in] user_data user data
682  *
683  * @return 0 on success, otherwise a negative error value.
684  * @retval #ZIGBEE_ERROR_NONE Successful
685  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
686  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
687  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
688  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
689  *
690  * @post When forming network is finished, form_network_done event will be generated.
691  *
692  * @see zb_disable_network()
693  * @see zb_zdo_set_compatible_startup_parameters()
694  */
695 int zb_form_network(zb_zigbee_h handle, zb_form_network_cb cb, void *user_data);
696
697 /**
698  * @brief Called after disabling the zigbee network.
699  * @details Response of disabling the zigbee network
700  *
701  * @since_tizen 4.0
702  *
703  * @param[out] status #ZB_ZDP_STATUS_SUCCESS \n
704  *                    #ZB_ZDP_STATUS_NOT_SUPPORTED \n
705  * @param[out] user_data user data
706  *
707  * @see zb_form_network()
708  */
709 typedef void (*zb_disable_network_cb)(unsigned char status, void *user_data);
710 /**
711  * @brief Disables network and stops zigbee coordinator role.
712  * @details This function to stop zigbee coordinator
713  *
714  * @since_tizen 4.0
715  * @privlevel public
716  * @privilege %http://tizen.org/privilege/zigbee
717  *
718  * @param[in] handle The handle of zigbee
719  * @param[in] cb zb_disable_network_cb()
720  * @param[in] user_data user data
721  *
722  * @return 0 on success, otherwise a negative error value.
723  * @retval #ZIGBEE_ERROR_NONE Successful
724  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
725  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
726  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
727  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
728  *
729  * @see zb_form_network()
730  */
731 int zb_disable_network(zb_zigbee_h handle, zb_disable_network_cb cb, void *user_data);
732
733 /**
734  * @brief Forces a node to leave one network and to rejoin the other.
735  * @details If @a remove_children is set to true, the target end device will reset its
736  * state-machine to factory defaults.
737  *
738  * @since_tizen 4.0
739  * @privlevel public
740  * @privilege %http://tizen.org/privilege/zigbee
741  *
742  * @param[in] handle The handle of zigbee
743  * @param[in] addr The source EUI64 of the binding (the remote device's EUI64)
744  * @param[in] remove_children Remove children
745  * @param[in] rejoin Rejoin after leave
746  *
747  * @return 0 on success, otherwise a negative error value.
748  * @retval #ZIGBEE_ERROR_NONE Successful
749  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
750  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
751  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
752  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
753  *
754  * @see zb_form_network()
755  */
756 int zb_leave_device(zb_zigbee_h handle, zb_ieee_addr addr, bool remove_children, bool rejoin);
757
758 /**
759  * @brief Allows or disallows the coordinator device to accept other device's association
760  * request.
761  *
762  * @since_tizen 4.0
763  * @privlevel public
764  * @privilege %http://tizen.org/privilege/zigbee
765  *
766  * @remarks Especially, this can be very useful for disabling joining all throughout the
767  * network. Typically, this is the last step when commissioning a network. It closes it
768  * down to prevent other nodes getting on the network without permission.
769  *
770  * @param[in] handle The handle of zigbee
771  * @param[in] timeout Number of seconds during which devices will be allowed to join
772  * the network. A value of 0xff turns permit joining on permanently
773  *
774  * @return 0 on success, otherwise a negative error value.
775  * @retval #ZIGBEE_ERROR_NONE Successful
776  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
777  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
778  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
779  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
780  *
781  * @see zb_form_network()
782  */
783 int zb_permit_join(zb_zigbee_h handle, unsigned char timeout);
784
785 /**
786  * @brief Shows current coordinator's IEEE MAC address.
787  * @details The function gets the coordinator's MAC address from the machine which runs
788  * zigbee-service daemon.
789  *
790  * @since_tizen 4.0
791  * @privlevel public
792  * @privilege %http://tizen.org/privilege/zigbee
793  *
794  * @param[in] handle The handle of zigbee
795  * @param[out] addr64 the Zigbee IEEE MAC address of this machine.
796  *
797  * @return 0 on success, otherwise a negative error value.
798  * @retval #ZIGBEE_ERROR_NONE Successful
799  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
800  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
801  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
802  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
803  *
804  * @see zb_get_network_info()
805  */
806 int zb_get_controller_mac_address(zb_zigbee_h handle, zb_ieee_addr addr64);
807
808 /**
809  * @brief Gets information of the current network environment of coordinator.
810  * @details The function shows network environment
811  *
812  * @since_tizen 4.0
813  * @privlevel public
814  * @privilege %http://tizen.org/privilege/zigbee
815  *
816  * @param[in] handle The handle of zigbee
817  * @param[out] addr64 the Zigbee IEEE MAC address
818  * @param[out] nodeid Node ID
819  * @param[out] panid PAN ID
820  * @param[out] channel 11~26 : 2.4GHz~2.485GHz
821  * @param[out] tx_power Tx power strength
822  *
823  * @return 0 on success, otherwise a negative error value.
824  * @retval #ZIGBEE_ERROR_NONE Successful
825  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
826  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
827  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
828  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
829  *
830  * @see zb_form_network()
831  */
832 int zb_get_network_info(zb_zigbee_h handle, zb_ieee_addr addr64, zb_nwk_addr *nodeid,
833                 zb_nwk_addr *panid, unsigned char *channel, unsigned char *tx_power);
834
835 /**
836  * @brief Gets all children device list information.
837  * @details This function return end-point list and simple description per each end-point
838  * at each device.
839  *
840  * @since_tizen 4.0
841  * @privlevel public
842  * @privilege %http://tizen.org/privilege/zigbee
843  *
844  * @remarks The @a list should be released using zb_end_dev_info_list_free().
845  *
846  * @param[in] handle The handle of zigbee
847  * @param[out] count The number of end-devices
848  * @param[out] list The device information list
849  *
850  * @return 0 on success, otherwise a negative error value.
851  * @retval #ZIGBEE_ERROR_NONE Successful
852  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
853  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
854  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
855  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
856  *
857  * @see zb_end_dev_info_list_free()
858  *
859  */
860 int zb_end_dev_info_get_list(zb_zigbee_h handle, int *count,
861                 zb_end_dev_info_h **list);
862
863 /**
864  * @brief Gets endpoint list information.
865  * @details This function return end-point list of each device.
866  *
867  * @since_tizen 4.0
868  * @privlevel public
869  * @privilege %http://tizen.org/privilege/zigbee
870  *
871  * @remarks The @a ep_list should be released using free().
872  *
873  * @param[in] handle The handle of zigbee
874  * @param[in] addr64 the Zigbee IEEE MAC address
875  * @param[out] count The number of endpoints
876  * @param[out] ep_list The device endpoint list
877  *
878  * @return 0 on success, otherwise a negative error value.
879  * @retval #ZIGBEE_ERROR_NONE Successful
880  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
881  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
882  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
883  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
884  */
885 int zb_end_dev_get_endpoint_list(zb_zigbee_h handle, zb_ieee_addr addr64,
886                 unsigned char *count, zb_end_point **ep_list);
887
888 /**
889  * @brief Gets cluster list information.
890  * @details This function return in and out cluster list of each device.
891  *
892  * @since_tizen 4.0
893  * @privlevel public
894  * @privilege %http://tizen.org/privilege/zigbee
895  *
896  * @remarks The @a in_cluster_list should be released using free().
897  * @remarks The @a out_cluster_list should be released using free().
898  *
899  * @param[in] handle The handle of zigbee
900  * @param[in] addr64 the Zigbee IEEE MAC address
901  * @param[in] ep endpoint number
902  * @param[out] in_cluster_count The number of in-clusters
903  * @param[out] in_cluster_list The device server cluster list
904  * @param[out] out_cluster_count The number of out-clusters
905  * @param[out] out_cluster_list The device client list
906  *
907  * @return 0 on success, otherwise a negative error value.
908  * @retval #ZIGBEE_ERROR_NONE Successful
909  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
910  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
911  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
912  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
913  */
914 int zb_end_dev_info_get_cluster_list(zb_zigbee_h handle, zb_ieee_addr addr64, zb_end_point ep,
915                 unsigned char *in_cluster_count, zb_cluster_id **in_cluster_list,
916                 unsigned char *out_cluster_count, zb_cluster_id **out_cluster_list);
917
918 /**
919  * @brief Frees all children device list information.
920  * @details This function return end-point list and simple description per each end-point
921  * at each device.
922  *
923  * @since_tizen 4.0
924  *
925  * @param[in] list The device information list
926  *
927  * @return 0 on success, otherwise a negative error value.
928  * @retval #ZIGBEE_ERROR_NONE Successful
929  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
930  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
931  *
932  * @see zb_end_dev_info_get_list()
933  */
934 int zb_end_dev_info_list_free(zb_end_dev_info_h *list);
935
936 /**
937  * @brief Creates an end-device handle.
938  *
939  * @since_tizen 4.0
940  * @privlevel public
941  * @privilege %http://tizen.org/privilege/zigbee
942  *
943  * @remarks The @a handle should be released using zb_end_dev_destroy().
944  *
945  * @param[out] handle The handle of end-device descriptor
946  *
947  * @return 0 on success, otherwise a negative error value.
948  * @retval #ZIGBEE_ERROR_NONE Successful
949  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
950  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
951  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
952  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
953  *
954  * @see zb_end_dev_info_clone()
955  * @see zb_end_dev_info_destroy()
956  */
957 int zb_end_dev_info_create(zb_end_dev_info_h *handle);
958
959 /**
960  * @brief Clones an end-device handle.
961  *
962  * @since_tizen 4.0
963  *
964  * @remarks The @a src should be released using zb_end_dev_destroy().
965  * @remarks The @a dst should be released using zb_end_dev_destroy().
966  *
967  * @param[in] src handle of source end-device descriptor
968  * @param[in] dst handle of destination end-device descriptor
969  *
970  * @return 0 on success, otherwise a negative error value.
971  * @retval #ZIGBEE_ERROR_NONE Successful
972  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
973  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
974  *
975  * @see zb_end_dev_info_create()
976  * @see zb_end_dev_info_destroy()
977  */
978 int zb_end_dev_info_clone(zb_end_dev_info_h src, zb_end_dev_info_h *dst);
979
980 /**
981  * @brief Destroys an end-device handle.
982  *
983  * @since_tizen 4.0
984  *
985  * @param[in] handle The handle of end-device descriptor
986  *
987  * @return 0 on success, otherwise a negative error value.
988  * @retval #ZIGBEE_ERROR_NONE Successful
989  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
990  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
991  *
992  * @see zb_end_dev_info_create()
993  * @see zb_end_dev_info_clone()
994  */
995 int zb_end_dev_info_destroy(zb_end_dev_info_h handle);
996
997 /**
998  * @brief Gets network address of a specific end-point.
999  *
1000  * @since_tizen 4.0
1001  *
1002  * @remarks This function should be called in zb_end_dev_info_cb()
1003  *
1004  * @param[in] handle The handle of a specific end-device
1005  * @param[out] addr16 network address of the end-point
1006  *
1007  * @return 0 on success, otherwise a negative error value.
1008  * @retval #ZIGBEE_ERROR_NONE Successful
1009  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1010  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1011  *
1012  * @see zb_end_dev_info_cb()
1013  * @see zb_foreach_end_dev_info()
1014  * @see zb_end_dev_info_get_list()
1015  */
1016 int zb_end_dev_info_get_network_address(zb_end_dev_info_h handle,
1017                 zb_nwk_addr *addr16);
1018
1019 /**
1020  * @brief Gets ieee address of a specific end-point.
1021  *
1022  * @since_tizen 4.0
1023  *
1024  * @remarks This function should be called in zb_end_dev_info_cb()
1025  *
1026  * @param[in] handle The handle of a specific end-device
1027  * @param[out] addr64 ieee address of the end-point
1028  *
1029  * @return 0 on success, otherwise a negative error value.
1030  * @retval #ZIGBEE_ERROR_NONE Successful
1031  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1032  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1033  *
1034  * @see zb_end_dev_info_cb()
1035  * @see zb_foreach_end_dev_info()
1036  * @see zb_end_dev_get_list()
1037  */
1038 int zb_end_dev_info_get_ieee_address(zb_end_dev_info_h handle, zb_ieee_addr addr64);
1039
1040 /**
1041  * @brief Gets a number of end-points of a specific end-device.
1042  *
1043  * @since_tizen 4.0
1044  *
1045  * @remarks This function should be called in zb_end_dev_info_cb()
1046  *
1047  * @param[in] handle The handle of a specific end-device
1048  * @param[out] count a number of endpoints of the end-point
1049  *
1050  * @return 0 on success, otherwise a negative error value.
1051  * @retval #ZIGBEE_ERROR_NONE Successful
1052  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1053  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1054  *
1055  * @see zb_end_dev_info_cb()
1056  * @see zb_foreach_end_dev_info()
1057  * @see zb_end_dev_get_list()
1058  */
1059 int zb_end_dev_info_get_num_of_ep(zb_end_dev_info_h handle, unsigned char *count);
1060
1061 /**
1062  * @brief Gets pointer of end-points list.
1063  *
1064  * @since_tizen 4.0
1065  *
1066  * @remarks This function should be called in zb_end_dev_info_cb().
1067  * The number of items on the list can be found with zb_end_dev_info_get_num_of_ep().
1068  * @remarks The @a ep_list should be released using free().
1069  *
1070  * @param[in] handle The handle of a specific end-device
1071  * @param[out] ep_list list of endpoints of the end-point
1072  *
1073  * @return 0 on success, otherwise a negative error value.
1074  * @retval #ZIGBEE_ERROR_NONE Successful
1075  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1076  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1077  *
1078  * @see zb_end_dev_info_cb()
1079  * @see zb_foreach_end_dev_info()
1080  * @see zb_end_dev_info_get_list()
1081  # @see zb_end_dev_info_get_num_of_ep()
1082  */
1083 int zb_end_dev_info_get_ep_list(zb_end_dev_info_h handle, zb_end_point **ep_list);
1084
1085 /**
1086  * @brief Gets 802.15.4 MAC capability of a specific end-point.
1087  *
1088  * @since_tizen 4.0
1089  *
1090  * @remarks This function should be called in zb_end_dev_info_cb()
1091  *
1092  * @param[in] handle The handle of a specific end-device
1093  * @param[out] capability 802.15.4 MAC capability of the end-point
1094  *
1095  * @return 0 on success, otherwise a negative error value.
1096  * @retval #ZIGBEE_ERROR_NONE Successful
1097  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1098  * @retval #ZIGBEE_ERROR_NO_DATA No data available
1099  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1100  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1101  *
1102  * @see zb_end_dev_info_cb()
1103  * @see zb_foreach_end_dev_info()
1104  * @see zb_end_dev_info_get_list()
1105  */
1106 int zb_end_dev_info_get_mac_capability(zb_end_dev_info_h handle,
1107         zb_zdp_mac_capability_field_e *capability);
1108
1109 /**
1110  * @brief Gets ability of alternative PAN coordinator of a specific end-point.
1111  *
1112  * @since_tizen 4.0
1113  *
1114  * @remarks This function should be called in zb_end_dev_info_cb()
1115  *
1116  * @param[in] handle The handle of a specific end-device
1117  * @param[out] can_do_it alternative of PAN coordinator of the end-point
1118  *
1119  * @return 0 on success, otherwise a negative error value.
1120  * @retval #ZIGBEE_ERROR_NONE Successful
1121  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1122  * @retval #ZIGBEE_ERROR_NO_DATA No data available
1123  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1124  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1125  *
1126  * @see zb_end_dev_info_cb()
1127  * @see zb_foreach_end_dev_info()
1128  * @see zb_end_dev_info_get_list()
1129  */
1130 int zb_end_dev_info_get_alternative_pan_coordinator(
1131                 zb_end_dev_info_h handle, zb_zdp_do_pan_coordinator_e *can_do_it);
1132
1133 /**
1134  * @brief Gets device id of a specific end-point.
1135  *
1136  * @since_tizen 4.0
1137  *
1138  * @remarks This function should be called in zb_end_dev_info_cb()
1139  *
1140  * @param[in] handle The handle of a specific end-device
1141  * @param[in] ep endpoint number
1142  * @param[out] deviceid device id of the end-point
1143  *
1144  * @return 0 on success, otherwise a negative error value.
1145  * @retval #ZIGBEE_ERROR_NONE Successful
1146  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1147  * @retval #ZIGBEE_ERROR_NO_DATA No data available
1148  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1149  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1150  *
1151  * @see zb_end_dev_info_cb()
1152  * @see zb_foreach_end_dev_info()
1153  * @see zb_end_dev_info_get_list()
1154  */
1155 int zb_end_dev_info_get_device_id(zb_end_dev_info_h handle, zb_end_point ep,
1156                 zb_device_id *deviceid);
1157
1158 /**
1159  * @brief Gets profile id of a specific end-point.
1160  *
1161  * @since_tizen 4.0
1162  *
1163  * @remarks This function should be called in zb_end_dev_info_cb()
1164  *
1165  * @param[in] handle The handle of a specific end-device
1166  * @param[in] ep endpoint number
1167  * @param[out] profileid profile id of the end-point
1168  *
1169  * @return 0 on success, otherwise a negative error value.
1170  * @retval #ZIGBEE_ERROR_NONE Successful
1171  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1172  * @retval #ZIGBEE_ERROR_NO_DATA No data available
1173  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1174  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1175  *
1176  * @see zb_end_dev_info_cb()
1177  * @see zb_foreach_end_dev_info()
1178  * @see zb_end_dev_info_get_list()
1179  */
1180 int zb_end_dev_info_get_profile_id(zb_end_dev_info_h handle, zb_end_point ep,
1181                 zb_profile_id *profileid);
1182
1183 /**
1184  * @brief Gets power source type of a specific end-point.
1185  *
1186  * @since_tizen 4.0
1187  *
1188  * @remarks This function should be called in zb_end_dev_info_cb()
1189  *
1190  * @param[in] handle The handle of a specific end-device
1191  * @param[out] power_src power source type of the end-point
1192  *
1193  * @return 0 on success, otherwise a negative error value.
1194  * @retval #ZIGBEE_ERROR_NONE Successful
1195  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1196  * @retval #ZIGBEE_ERROR_NO_DATA No data available
1197  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1198  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1199  *
1200  * @see zb_end_dev_info_cb()
1201  * @see zb_foreach_end_dev_info()
1202  * @see zb_end_dev_info_get_list()
1203  */
1204 int zb_end_dev_info_get_power_source(zb_end_dev_info_h handle,
1205                 zb_zdp_power_e *power_src);
1206
1207 /**
1208  * @brief Gets security capability of a specific end-point.
1209  *
1210  * @since_tizen 4.0
1211  *
1212  * @remarks This function should be called in zb_end_dev_info_cb()
1213  *
1214  * @param[in] handle The handle of a specific end-device
1215  * @param[out] sec_capability security type of the end-point
1216  *
1217  * @return 0 on success, otherwise a negative error value.
1218  * @retval #ZIGBEE_ERROR_NONE Successful
1219  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1220  * @retval #ZIGBEE_ERROR_NO_DATA No data available
1221  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1222  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1223  *
1224  * @see zb_end_dev_info_cb()
1225  * @see zb_foreach_end_dev_info()
1226  * @see zb_end_dev_get_list()
1227  */
1228 int zb_end_dev_info_get_security_capabilty(zb_end_dev_info_h handle,
1229                 zb_zdp_security_cap_e *sec_capability);
1230
1231 /**
1232  * @}
1233  */
1234
1235 /**
1236  * @addtogroup CAPI_NETWORK_ZIGBEE_ZDO_DEVICE_DISCOVERY_MODULE
1237  *
1238  * @{
1239  */
1240
1241 /**
1242  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1243  * @brief Creates a simple descriptor.
1244  *
1245  * @since_tizen 4.0
1246  * @privlevel public
1247  * @privilege %http://tizen.org/privilege/zigbee
1248  *
1249  * @remarks The @a handle should be released using zb_simple_desc_destroy().
1250  *
1251  * @param[out] handle The handle of a simple descriptor
1252  *
1253  * @return 0 on success, otherwise a negative error value.
1254  * @retval #ZIGBEE_ERROR_NONE Successful
1255  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1256  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
1257  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
1258  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1259  *
1260  * @see zb_simple_desc_clone()
1261  * @see zb_simple_desc_destroy()
1262  */
1263 int zb_simple_desc_create(zb_zdo_simple_desc_h *handle);
1264
1265 /**
1266  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1267  * @brief Clones a simple descriptor.
1268  *
1269  * @since_tizen 4.0
1270  *
1271  * @remarks The @a dst should be released using zb_simple_desc_destroy().
1272  *
1273  * @param[in] src handle of a source simple descriptor
1274  * @param[in] dst handle of a destination simple descriptor
1275  *
1276  * @return 0 on success, otherwise a negative error value.
1277  * @retval #ZIGBEE_ERROR_NONE Successful
1278  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1279  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1280  *
1281  * @see zb_simple_desc_create()
1282  * @see zb_simple_desc_destroy()
1283  */
1284 int zb_simple_desc_clone(zb_zdo_simple_desc_h src, zb_zdo_simple_desc_h *dst);
1285
1286 /**
1287  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1288  * @brief Destroys a simple a descriptor handle.
1289  *
1290  * @since_tizen 4.0
1291  *
1292  * @param[in] handle The handle of a simple descriptor
1293  *
1294  * @return 0 on success, otherwise a negative error value.
1295  * @retval #ZIGBEE_ERROR_NONE Successful
1296  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1297  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1298  *
1299  * @see zb_simple_desc_create()
1300  * @see zb_simple_desc_clone()
1301  */
1302 int zb_simple_desc_destroy(zb_zdo_simple_desc_h handle);
1303
1304 /**
1305  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1306  * @brief Gets active endpoint number from a simple descriptor handle.
1307  *
1308  * @since_tizen 4.0
1309  *
1310  * @param[in] handle The handle of a simple descriptor
1311  * @param[out] ep endpoint number
1312  *
1313  * @return 0 on success, otherwise a negative error value.
1314  * @retval #ZIGBEE_ERROR_NONE Successful
1315  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1316  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1317  *
1318  * @see zb_simple_desc_set_ep()
1319  */
1320 int zb_simple_desc_get_ep(zb_zdo_simple_desc_h handle, zb_end_point *ep);
1321
1322 /**
1323  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1324  * @brief Sets active endpoint number to a simple descriptor handle.
1325  *
1326  * @since_tizen 4.0
1327  *
1328  * @param[in] handle The handle of a simple descriptor
1329  * @param[in] ep endpoint number
1330  *
1331  * @return 0 on success, otherwise a negative error value.
1332  * @retval #ZIGBEE_ERROR_NONE Successful
1333  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1334  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1335  *
1336  * @see zb_simple_desc_get_ep()
1337  */
1338 int zb_simple_desc_set_ep(zb_zdo_simple_desc_h handle, zb_end_point ep);
1339
1340 /**
1341  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1342  * @brief Gets profile id from a simple descriptor handle.
1343  *
1344  * @since_tizen 4.0
1345  *
1346  * @param[in] handle The handle of a simple descriptor
1347  * @param[out] profileid profile id
1348  *
1349  * @return 0 on success, otherwise a negative error value.
1350  * @retval #ZIGBEE_ERROR_NONE Successful
1351  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1352  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1353  *
1354  * @see zb_simple_desc_set_profile_id()
1355  */
1356 int zb_simple_desc_get_profile_id(zb_zdo_simple_desc_h handle,
1357                 zb_profile_id *profileid);
1358
1359 /**
1360  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1361  * @brief Sets profile id to a simple descriptor handle.
1362  *
1363  * @since_tizen 4.0
1364  *
1365  * @param[in] handle The handle of a simple descriptor
1366  * @param[in] profileid profile id
1367  *
1368  * @return 0 on success, otherwise a negative error value.
1369  * @retval #ZIGBEE_ERROR_NONE Successful
1370  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1371  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1372  *
1373  * @see zb_simple_desc_get_device_id()
1374  */
1375 int zb_simple_desc_set_profile_id(
1376                 zb_zdo_simple_desc_h handle,
1377                 zb_profile_id profileid);
1378
1379 /**
1380  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1381  * @brief Gets device id from a simple descriptor handle.
1382  *
1383  * @since_tizen 4.0
1384  *
1385  * @param[in] handle The handle of a simple descriptor
1386  * @param[out] deviceid 16-bit device identifier
1387  *
1388  * @return 0 on success, otherwise a negative error value.
1389  * @retval #ZIGBEE_ERROR_NONE Successful
1390  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1391  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1392  *
1393  * @see zb_simple_desc_set_device_id()
1394  */
1395 int zb_simple_desc_get_device_id(zb_zdo_simple_desc_h handle,
1396                 zb_device_id *deviceid);
1397
1398 /**
1399  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1400  * @brief Sets device id to a simple descriptor handle.
1401  *
1402  * @since_tizen 4.0
1403  *
1404  * @param[in] handle The handle of a simple descriptor
1405  * @param[in] deviceid 16-bit device identifier
1406  *
1407  * @return 0 on success, otherwise a negative error value.
1408  * @retval #ZIGBEE_ERROR_NONE Successful
1409  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1410  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1411  *
1412  * @see zb_simple_desc_get_device_ver()
1413  */
1414 int zb_simple_desc_set_device_id(zb_zdo_simple_desc_h handle,
1415                 zb_device_id deviceid);
1416
1417 /**
1418  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1419  * @brief Gets device version from a simple descriptor handle.
1420  *
1421  * @since_tizen 4.0
1422  *
1423  * @param[in] handle The handle of a simple descriptor
1424  * @param[out] device_ver device version
1425  *
1426  * @return 0 on success, otherwise a negative error value.
1427  * @retval #ZIGBEE_ERROR_NONE Successful
1428  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1429  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1430  *
1431  * @see zb_simple_desc_set_device_ver()
1432  */
1433 int zb_simple_desc_get_device_ver(zb_zdo_simple_desc_h handle,
1434                 unsigned short *device_ver);
1435
1436 /**
1437  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1438  * @brief Sets device version to a simple descriptor handle.
1439  *
1440  * @since_tizen 4.0
1441  *
1442  * @param[in] handle The handle of a simple descriptor
1443  * @param[in] device_ver device version
1444  *
1445  * @return 0 on success, otherwise a negative error value.
1446  * @retval #ZIGBEE_ERROR_NONE Successful
1447  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1448  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1449  *
1450  * @see zb_simple_desc_set_device_ver()
1451  */
1452 int zb_simple_desc_set_device_ver(zb_zdo_simple_desc_h handle,
1453                 unsigned short device_ver);
1454
1455 /**
1456  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1457  * @brief Gets the number of items in input clusters from a simple descriptor handle.
1458  *
1459  * @since_tizen 4.0
1460  *
1461  * @param[in] handle Handle of a simple descriptor
1462  * @param[out] num_of_in_clusters The number of input clusters
1463  *
1464  * @return 0 on success, otherwise a negative error value.
1465  * @retval #ZIGBEE_ERROR_NONE Successful
1466  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1467  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1468  *
1469  * @see zb_simple_desc_set_num_of_in_clusters()
1470  */
1471 int zb_simple_desc_get_num_of_in_clusters(zb_zdo_simple_desc_h handle,
1472                 unsigned char *num_of_in_clusters);
1473
1474 /**
1475  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1476  * @brief Sets the number of input clusters to a simple descriptor handle.
1477  *
1478  * @since_tizen 4.0
1479  *
1480  * @param[in] handle The handle of a simple descriptor
1481  * @param[in] num_of_in_clusters number of input clusters
1482  *
1483  * @return 0 on success, otherwise a negative error value.
1484  * @retval #ZIGBEE_ERROR_NONE Successful
1485  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1486  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1487  *
1488  * @see zb_simple_desc_get_num_of_in_clusters()
1489  */
1490 int zb_simple_desc_set_num_of_in_clusters(zb_zdo_simple_desc_h handle,
1491                 unsigned char num_of_in_clusters);
1492
1493 /**
1494  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1495  * @brief Gets number of output clusters from a simple descriptor handle.
1496  *
1497  * @since_tizen 4.0
1498  *
1499  * @param[in] handle The handle of a simple descriptor
1500  * @param[out] num_of_out_clusters number of output clusters
1501  *
1502  * @return 0 on success, otherwise a negative error value.
1503  * @retval #ZIGBEE_ERROR_NONE Successful
1504  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1505  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1506  *
1507  * @see zb_simple_desc_set_num_of_out_clusters()
1508  */
1509 int zb_simple_desc_get_num_of_out_clusters(zb_zdo_simple_desc_h handle,
1510                 unsigned char *num_of_out_clusters);
1511
1512 /**
1513  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1514  * @brief Sets number of output clusters to a simple descriptor handle.
1515  *
1516  * @since_tizen 4.0
1517  *
1518  * @param[in] handle The handle of a simple descriptor
1519  * @param[in] num_of_out_clusters number of output clusters
1520  *
1521  * @return 0 on success, otherwise a negative error value.
1522  * @retval #ZIGBEE_ERROR_NONE Successful
1523  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1524  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1525  *
1526  * @see zb_simple_desc_get_num_of_out_clusters()
1527  */
1528 int zb_simple_desc_set_num_of_out_clusters(zb_zdo_simple_desc_h handle,
1529                 unsigned char num_of_out_clusters);
1530
1531 /**
1532  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1533  * @brief Gets input cluster list from a simple descriptor handle.
1534  *
1535  * @since_tizen 4.0
1536  *
1537  * @remarks The @a in_clusters should not be released.
1538  * @remarks The @a in_clusters is available until handle is released
1539  *
1540  * @param[in] handle The handle of simple descriptor
1541  * @param[out] in_clusters input clusters
1542  *
1543  * @return 0 on success, otherwise a negative error value.
1544  * @retval #ZIGBEE_ERROR_NONE Successful
1545  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1546  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1547  *
1548  * @see zb_simple_desc_set_in_clusters()
1549  */
1550 int zb_simple_desc_get_in_clusters(zb_zdo_simple_desc_h handle,
1551                 zb_cluster_id **in_clusters);
1552
1553 /**
1554  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1555  * @brief Sets input cluster list to a simple descriptor handle.
1556  *
1557  * @since_tizen 4.0
1558  *
1559  * @param[in] handle The handle of a simple descriptor
1560  * @param[in] in_clusters input clusters
1561  * @param[in] num number of input clusters
1562  *
1563  * @return 0 on success, otherwise a negative error value.
1564  * @retval #ZIGBEE_ERROR_NONE Successful
1565  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1566  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1567  *
1568  * @see zb_simple_desc_get_in_clusters()
1569  */
1570 int zb_simple_desc_set_in_clusters(zb_zdo_simple_desc_h handle,
1571                 zb_cluster_id *in_clusters, int num);
1572
1573 /**
1574  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1575  * @brief Gets output cluster list from a simple descriptor handle.
1576  *
1577  * @since_tizen 4.0
1578  *
1579  * @remarks The @a out_clusters should not be released.
1580  * @remarks The @a out_clusters is available until handle is released
1581  *
1582  * @param[in] handle The handle of a simple descriptor
1583  * @param[out] out_clusters output clusters
1584  *
1585  * @return 0 on success, otherwise a negative error value.
1586  * @retval #ZIGBEE_ERROR_NONE Successful
1587  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1588  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1589  *
1590  * @see zb_simple_desc_get_in_clusters()
1591  */
1592 int zb_simple_desc_get_out_clusters(zb_zdo_simple_desc_h handle,
1593                 zb_cluster_id **out_clusters);
1594
1595 /**
1596  * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_SIMPLE_DESCRIPTOR_MODULE
1597  * @brief Sets output cluster list to a simple descriptor handle.
1598  *
1599  * @since_tizen 4.0
1600  *
1601  * @param[in] handle The handle of a simple descriptor
1602  * @param[in] out_clusters output clusters
1603  * @param[in] num number of output clusters
1604  *
1605  * @return 0 on success, otherwise a negative error value.
1606  * @retval #ZIGBEE_ERROR_NONE Successful
1607  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1608  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1609  *
1610  * @see zb_simple_desc_get_in_clusters()
1611  */
1612 int zb_simple_desc_set_out_clusters(zb_zdo_simple_desc_h handle,
1613                 zb_cluster_id *out_clusters, int num);
1614
1615
1616 /**
1617  * @brief Called after Network / IEEE address request.
1618  * @details The NWK_addr_cb is generated by a Remote Device in response to a
1619  * NWK_addr_req or IEEE_addr_req command inquiring as to the NWK address of the Remote
1620  * Device or the NWK address of an address held in a local discovery cache.
1621  * The destination addressing on this command is unicast.
1622  *
1623  * @since_tizen 4.0
1624  *
1625  * @remarks The @a assoc_dev_addr_list should not be released.
1626  * @remarks The @a assoc_dev_addr_list can be used only in the callback. To use outside, make a copy.
1627  *
1628  * @param[out] status #ZB_ZDP_STATUS_SUCCESS \n
1629  *                    #ZB_ZDP_STATUS_INVALID_REQUEST_TYPE \n
1630  *                    #ZB_ZDP_STATUS_DEVICE_NOT_FOUND
1631  * @param[out] remote_dev_addr64 64-bit address for the remote device
1632  * @param[out] remote_dev_addr16 16-bit address for the remote device
1633  * @param[out] assoc_dev_len The number of items in the 16-bit short addresses #assoc_dev_addr_list.
1634  *                           If the RequestType in the request is Extended Response
1635  *                           and there are no associated devices on the Remote Device,
1636  *                           this field shall be set to 0.
1637  *                           If an error occurs or the RequestType in the request is
1638  *                           for a Single Device Response, this field shall not
1639  *                           be included.
1640  * @param[out] start_idx Starting index into the list of associated devices for this
1641  *                       report. If the RequestType in the request is Extended Response
1642  *                       and there are no associated devices on the Remote Device,
1643  *                       this field shall not be included in the ZigBee data frame.
1644  *                       If an error occurs or the RequestType in the request is
1645  *                       for a Single Device Response, this field shall not
1646  *                       be included.
1647  * @param[out] assoc_dev_addr_list A list of 16-bit addresses, one corresponding to each
1648  *                               associated device to Remote Device; The number of 16-bit
1649  *                               network addresses contained in this field is specified
1650  *                               in the NumAssocDev field.
1651  *                               If the RequestType in the request is Extended Response
1652  *                               and there are no associated devices on the Remote Device,
1653  *                               this field shall not be included in the ZigBee data frame.
1654  *                               If an error occurs or the RequestType in the request is
1655  *                               for a Single Device Response, this field shall not
1656  *                               be included.
1657  * @param[out] user_data user data
1658  *
1659  * @see zb_zdo_nwk_addr_req()
1660  */
1661 typedef void (*zb_zdo_addr_cb)(zb_zdp_status_e status, zb_ieee_addr remote_dev_addr64,
1662                 zb_nwk_addr remote_dev_addr16, unsigned char assoc_dev_len,
1663                 unsigned char start_idx, zb_device_id *assoc_dev_addr_list, void *user_data);
1664
1665 /**
1666  * @brief Sends 'Network address request' command.
1667  * @details The NWK_addr_req is generated from a Local Device wishing to inquire as to the
1668  * 16-bit address of the Remote Device based on its known IEEE address. The
1669  * destination addressing on this command shall be unicast or broadcast to all
1670  * devices for which macRxOnWhenIdle = TRUE.
1671  *
1672  * @since_tizen 4.0
1673  * @privlevel public
1674  * @privilege %http://tizen.org/privilege/zigbee
1675  *
1676  * @param[in] handle The handle of zigbee
1677  * @param[in] addr64 IEEE address for device of interest
1678  * @param[in] request_type \n
1679  *            0x00 - Single device response \n
1680  *            0x01 - Extended response \n
1681  * @param[in] start_idx If the Request type for this command is Extended response,
1682  *                      is StartIndex provides the starting index for the requested
1683  *                      elements of the associated devices list
1684  * @param[in] cb Response callback
1685  * @param[in] user_data user data
1686  *
1687  * @return 0 on success, otherwise a negative error value.
1688  * @retval #ZIGBEE_ERROR_NONE Successful
1689  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1690  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
1691  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1692  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
1693  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1694  *
1695  * @see zb_zdo_nwk_addr_cb()
1696  */
1697 int zb_zdo_nwk_addr_req(zb_zigbee_h handle, zb_ieee_addr addr64,
1698                 zb_zdp_req_type_e request_type, unsigned char start_idx, zb_zdo_addr_cb cb,
1699                 void *user_data);
1700
1701 /**
1702  * @brief Sends 'IEEE address request' command.
1703  * @details The IEEE_addr_req is generated from a Local Device wishing to inquire as to
1704  * the 64-bit IEEE address of the Remote Device based on their known 16-bit address.
1705  * The destination addressing on this command shall be unicast.
1706  *
1707  * @since_tizen 4.0
1708  * @privlevel public
1709  * @privilege %http://tizen.org/privilege/zigbee
1710  *
1711  * @param[in] handle The handle of zigbee
1712  * @param[in] addr16 Network address for device of interest
1713  * @param[in] cb Response callback
1714  * @param[in] user_data user data
1715  *
1716  * @return 0 on success, otherwise a negative error value.
1717  * @retval #ZIGBEE_ERROR_NONE Successful
1718  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1719  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
1720  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1721  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
1722  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1723  *
1724  * @see zb_zdo_ieee_addr_cb()
1725  */
1726 int zb_zdo_ieee_addr_req(zb_zigbee_h handle, zb_nwk_addr addr16, zb_zdo_addr_cb cb,
1727                 void *user_data);
1728
1729 /**
1730  * @brief Called after active endpoint request command.
1731  * @details The Active_EP_cb is generated by a remote device in response to an
1732  * Active_EP_req directed to the remote device. This command shall be unicast to
1733  * the originator of the Active_EP_req command.
1734  *
1735  * The remote device shall generate the Active_EP_cb command using the format
1736  * illustrated param list.
1737  *
1738  * The NWKAddrOfInterest field shall match that specified in the original
1739  * Active_EP_req command.
1740  *
1741  * If the NWKAddrOfInterest field matches the network address of the remote device,
1742  * it shall set the Status field to #ZB_ZDP_STATUS_SUCCESS, set the ActiveEPCount field
1743  * to the number of active endpoints on that device and include an ascending list of
1744  * all the identifiers of the active endpoints on that device in the ActiveEPList field.
1745  *
1746  * If the NWKAddrOfInterest field does not match the network address of the remote device
1747  * and it is an end device, it shall set the Status field to
1748  * #ZB_ZDP_STATUS_INVALID_REQUEST_TYPE, set the ActiveEPCount field to 0, and not include
1749  * the ActiveEPList field.
1750  *
1751  * If the NWKAddrOfInterest field does not match the network address of the remote device
1752  * and it is the coordinator or a router, it shall determine whether the NWKAddrOfInterest
1753  * field matches the network address of a device it holds in a discovery cache.
1754  *
1755  * If the NWKAddrOfInterest field does not match the network address of a device it holds
1756  * in a discovery cache, it shall set the Status field to #ZB_ZDP_STATUS_DEVICE_NOT_FOUND,
1757  * set the ActiveEPCount field to 0, and not include the ActiveEPList field.
1758  *
1759  * If the NWKAddrOfInterest matches the network address of a device held in a discovery
1760  * cache on the remote device, it shall determine whether that device has any active
1761  * endpoints.
1762  *
1763  * If the discovery information corresponding to the ActiveEP request has not yet been
1764  * uploaded to the discovery cache, the remote device shall set the Status field to
1765  * #ZB_ZDP_STATUS_NO_DESCRIPTOR, set the ActiveEPCount field to 0 and not include the
1766  * ActiveEPList field.
1767  *
1768  * If the cached device has no active endpoints, the remote device shall set the Status
1769  * field to #ZB_ZDP_STATUS_SUCCESS, set the ActiveEPCount field to 0, and not include
1770  * the ActiveEPList field.
1771  *
1772  * If the cached device has active endpoints,
1773  * the remote device shall set the Status field to #ZB_ZDP_STATUS_SUCCESS, set
1774  * the ActiveEPCount field to the number of active endpoints on that device,
1775  * and include an ascending list of all the identifiers of the active endpoints on that
1776  * device in the ActiveEPList field .
1777  *
1778  * @since_tizen 4.0
1779  *
1780  * @remarks The @a ep_list should not be released.
1781  * @remarks The @a ep_list can be used only in the callback. To use outside, make a copy.
1782  *
1783  * @param[out] status #ZB_ZDP_STATUS_SUCCESS \n
1784  *                    #ZB_ZDP_STATUS_INVALID_REQUEST_TYPE \n
1785  *                    #ZB_ZDP_STATUS_DEVICE_NOT_FOUND \n
1786  *                    #ZB_ZDP_STATUS_NO_DESCRIPTOR \n
1787  * @param[out] addr16 Network address for the request
1788  * @param[out] count The count of active endpoints on the remote device
1789  * @param[out] ep_list List of bytes each of which represents an 8-bit endpoints
1790  * @param[out] user_data user data
1791  *
1792  * @see zb_zdo_active_ep()
1793  */
1794 typedef void (*zb_zdo_active_ep_cb)(zb_zdp_status_e status, zb_nwk_addr addr16,
1795                 unsigned char count, zb_end_point *ep_list, void *user_data);
1796
1797 /**
1798  * @brief Sends 'active end-point request' command.
1799  * @details The Active_EP_req command is generated from a local device wishing to acquire
1800  * the list of endpoints on a remote device with simple descriptors. This command
1801  * shall be unicast either to the remote device itself or to an alternative device that
1802  * contains the discovery information of the remote device.
1803  *
1804  * The local device shall generate the Active_EP_req command using the format
1805  * illustrated in param list. The NWKAddrOfInterest field shall contain the network
1806  * address of the remote device for which the active endpoint list is required.
1807  *
1808  * @since_tizen 4.0
1809  * @privlevel public
1810  * @privilege %http://tizen.org/privilege/zigbee
1811  *
1812  * @param[in] handle The handle of zigbee
1813  * @param[in] addr16 Network address for device of interest
1814  * @param[in] cb Response callback
1815  * @param[in] user_data user data
1816  *
1817  * @return 0 on success, otherwise a negative error value.
1818  * @retval #ZIGBEE_ERROR_NONE Successful
1819  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1820  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
1821  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1822  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
1823  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1824  *
1825  * @see zb_zdo_active_ep_cb()
1826  */
1827 int zb_zdo_active_ep(zb_zigbee_h handle, zb_nwk_addr addr16, zb_zdo_active_ep_cb cb,
1828                 void *user_data);
1829
1830 /**
1831  * @brief Called after 'simple descriptor request' command.
1832  * @details The Simple_Desc_cb is generated by a remote device in response to a
1833  * Simple_Desc_req directed to the remote device. This command shall be unicast to
1834  * the originator of the Simple_Desc_req command.
1835  * The remote device shall generate the Simple_Desc_cb command using the format
1836  * illustrated in Table 2.94 in Zigbee Specification. The NWKAddrOfInterest field shall
1837  * match that specified in the original Simple_Desc_req command.
1838  * If the endpoint field specified in the original Simple_Desc_req command does not fall
1839  * within the correct range specified in param list, the remote device shall set the Status
1840  * field to #ZB_ZDP_STATUS_INVALID_EP, set the Length field to 0 and not include the
1841  * SimpleDescriptor field.
1842  *
1843  * If the NWKAddrOfInterest field matches the network address of the remote
1844  * device, it shall determine whether the endpoint field specifies the identifier of an
1845  * active endpoint on the device. If the endpoint field corresponds to an active
1846  * endpoint, the remote device shall set the Status field to #ZB_ZDP_STATUS_SUCCESS,
1847  * set the Length field to the length of the simple descriptor on that endpoint,
1848  * and include the simple descriptor for that endpoint in the SimpleDescriptor field.
1849  * If the endpoint field does not correspond to an active endpoint, the remote device
1850  * shall set the Status field to #ZB_ZDP_STATUS_NOT_ACTIVE, set the Length field to 0,
1851  * and not include the SimpleDescriptor field.
1852  *
1853  * If the NWKAddrOfInterest field does not match the network address of the
1854  * remote device and it is an end device, it shall set the Status field to
1855  * #ZB_ZDP_STATUS_INVALID_REQUEST_TYPE, set the Length field to 0, and not include the
1856  * SimpleDescriptor field. If the NWKAddrOfInterest field does not match the
1857  * network address of the remote device and it is the coordinator or a router, it shall
1858  * determine whether the NWKAddrOfInterest field matches the network address of
1859  * one of its children. If the NWKAddrOfInterest field does not match the network
1860  * address of one of the children of the remote device, it shall set the Status field to
1861  * #ZB_ZDP_STATUS_DEVICE_NOT_FOUND, set the Length field to 0, and not include the
1862  * SimpleDescriptor field.
1863  *
1864  * If the NWKAddrOfInterest matches the network address of one of the children of
1865  * the remote device, it shall determine whether a simple descriptor for that device
1866  * and on the requested endpoint is available. If a simple descriptor is not available
1867  * on the requested endpoint of the child indicated by the NWKAddrOfInterest field,
1868  * the remote device shall set the Status field to #ZB_ZDP_STATUS_NO_DESCRIPTOR, set the
1869  * Length field to 0, and not include the SimpleDescriptor field. If a simple descriptor
1870  * is available on the requested endpoint of the child indicated by the
1871  * NWKAddrOfInterest field, the remote device shall set the Status field to
1872  * #ZB_ZDP_STATUS_SUCCESS, set the Length field to the length of the simple descriptor
1873  * on that endpoint, and include the simple descriptor for that
1874  * endpoint of the matching child device in the SimpleDescriptor field.
1875  *
1876  * @since_tizen 4.0
1877  *
1878  * The @a desc can be used only in the callback. To use outside, make a copy using zb_simple_desc_clone().
1879  *
1880  * @param[out] addr16 Network address for the request
1881  * @param[out] len Length in bytes of the simple descriptor to follow
1882  * @param[out] desc Simple descriptor structure this filed shall only be included
1883  *                  if the status field is equal to #ZB_ZDP_STATUS_SUCCESS
1884  * @param[out] user_data user data
1885  *
1886  * @see zb_zdo_simple_desc_req()
1887  */
1888 typedef void (*zb_zdo_simple_desc_cb)(zb_nwk_addr addr16, unsigned char len,
1889                 const zb_zdo_simple_desc_h desc, void *user_data);
1890
1891 /**
1892  * @brief Sends 'simple descriptor request' command.
1893  * @details The Simple_Desc_req command is generated from a local device wishing to
1894  * inquire as to the simple descriptor of a remote device on a specified endpoint. This
1895  * command shall be unicast either to the remote device itself or to an alternative
1896  * device that contains the discovery information of the remote device.
1897  *
1898  * The local device shall generate the Simple_Desc_req command using the format
1899  * illustrated in param list. The NWKAddrOfInterest field shall contain the network
1900  * address of the remote device for which the simple descriptor is required and the
1901  * endpoint field shall contain the endpoint identifier from which to obtain the
1902  * required simple descriptor.
1903  *
1904  * @since_tizen 4.0
1905  * @privlevel public
1906  * @privilege %http://tizen.org/privilege/zigbee
1907  *
1908  * @param[in] handle The handle of zigbee
1909  * @param[in] addr16 Network address for device of interest
1910  * @param[in] ep The endpoint on the destination
1911  * @param[in] cb Response callback
1912  * @param[in] user_data user data
1913  *
1914  * @return 0 on success, otherwise a negative error value.
1915  * @retval #ZIGBEE_ERROR_NONE Successful
1916  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1917  * @retval #ZIGBEE_ERROR_INVALID_ENDPOINT Invalid endpoint. 0 is reserved for ZDP
1918  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
1919  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1920  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
1921  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1922  *
1923  * @see zb_zdo_simple_desc_cb()
1924  */
1925 int zb_zdo_simple_desc_req(zb_zigbee_h handle, zb_nwk_addr addr16, zb_end_point ep,
1926                 zb_zdo_simple_desc_cb cb, void *user_data);
1927
1928 /**
1929  * @}
1930  */
1931
1932 /**
1933  * @addtogroup CAPI_NETWORK_ZIGBEE_ZCL_GLOBAL_COMMAND_MODULE
1934  *
1935  * @{
1936  */
1937
1938 /**
1939  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_ATTRIBUTE_STATUS_RECORD_MODULE
1940  * @brief Creates a read attribute status record.
1941  *
1942  * @since_tizen 4.0
1943  * @privlevel public
1944  * @privilege %http://tizen.org/privilege/zigbee
1945  *
1946  * @param[in] handle The handle of read attribute status record
1947  *
1948  * @return 0 on success, otherwise a negative error value.
1949  * @retval #ZIGBEE_ERROR_NONE Successful
1950  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1951  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1952  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
1953  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1954  *
1955  * @see zb_read_attr_status_record_clone()
1956  * @see zb_read_attr_status_record_destroy()
1957  * @see zb_read_attr_status_record_set_id()
1958  * @see zb_read_attr_status_record_set_status()
1959  * @see zb_read_attr_status_record_set_value()
1960  * @see zb_zcl_global_attr_read_cb()
1961  * @see zb_read_attr_status_record_get_status()
1962  * @see zb_read_attr_status_record_get_type()
1963  * @see zb_read_attr_status_record_get_value()
1964  */
1965 int zb_read_attr_status_record_create(zb_zcl_read_attr_status_record_h *handle);
1966
1967 /**
1968  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_ATTRIBUTE_STATUS_RECORD_MODULE
1969  * @brief Clones a read attribute status record.
1970  *
1971  * @since_tizen 4.0
1972  *
1973  * @remarks The @a dst should be released using zb_read_attr_status_record_destroy().
1974  *
1975  * @param[in] src Source handle of read attribute status record
1976  * @param[in] dst Destination handle of read attribute status record
1977  *
1978  * @return 0 on success, otherwise a negative error value.
1979  * @retval #ZIGBEE_ERROR_NONE Successful
1980  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1981  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
1982  *
1983  * @see zb_read_attr_status_record_create()
1984  * @see zb_read_attr_status_record_destroy()
1985  * @see zb_read_attr_status_record_set_id()
1986  * @see zb_read_attr_status_record_set_status()
1987  * @see zb_read_attr_status_record_set_value()
1988  * @see zb_zcl_global_attr_read_cb()
1989  * @see zb_read_attr_status_record_get_status()
1990  * @see zb_read_attr_status_record_get_type()
1991  * @see zb_read_attr_status_record_get_value()
1992  */
1993 int zb_read_attr_status_record_clone(zb_zcl_read_attr_status_record_h src,
1994                 zb_zcl_read_attr_status_record_h *dst);
1995
1996 /**
1997  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_ATTRIBUTE_STATUS_RECORD_MODULE
1998  * @brief Destroys a read attribute status record.
1999  *
2000  * @since_tizen 4.0
2001  *
2002  * @param[in] handle The handle of read attribute status record
2003  *
2004  * @return 0 on success, otherwise a negative error value.
2005  * @retval #ZIGBEE_ERROR_NONE Successful
2006  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2007  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2008  *
2009  * @see zb_read_attr_status_record_create()
2010  * @see zb_read_attr_status_record_clone()
2011  * @see zb_read_attr_status_record_set_id()
2012  * @see zb_read_attr_status_record_set_status()
2013  * @see zb_read_attr_status_record_set_value()
2014  * @see zb_zcl_global_attr_read_cb()
2015  * @see zb_read_attr_status_record_get_status()
2016  * @see zb_read_attr_status_record_get_type()
2017  * @see zb_read_attr_status_record_get_value()
2018  */
2019 int zb_read_attr_status_record_destroy(zb_zcl_read_attr_status_record_h handle);
2020
2021 /**
2022  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_ATTRIBUTE_STATUS_RECORD_MODULE
2023  * @brief Gets identifier from read attribute status record.
2024  * @details The attribute identifier field is 16 bits in length and shall contain the
2025  * identifier of the attribute that has been read (or of which an element has been read).
2026  *
2027  * This field shall contain the same value that was included in the corresponding
2028  * attribute identifier field of the original read attributes or read attributes
2029  * structured command.
2030  *
2031  * @since_tizen 4.0
2032  *
2033  * @param[in] handle The handle of read attribute status record
2034  * @param[out] id Attribute identifier
2035  *
2036  * @return 0 on success, otherwise a negative error value.
2037  * @retval #ZIGBEE_ERROR_NONE Successful
2038  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2039  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2040  *
2041  * @see zb_read_attr_status_record_create()
2042  * @see zb_read_attr_status_record_destroy()
2043  * @see zb_read_attr_status_record_set_id()
2044  * @see zb_read_attr_status_record_set_status()
2045  * @see zb_read_attr_status_record_set_value()
2046  * @see zb_zcl_global_attr_read_cb()
2047  * @see zb_read_attr_status_record_get_status()
2048  * @see zb_read_attr_status_record_get_type()
2049  * @see zb_read_attr_status_record_get_value()
2050  */
2051 int zb_read_attr_status_record_get_id(
2052                 zb_zcl_read_attr_status_record_h handle, zb_attribute_id* id);
2053
2054 /**
2055  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_ATTRIBUTE_STATUS_RECORD_MODULE
2056  * @brief Sets identifier to read attribute status record.
2057  * @details The attribute identifier field is 16 bits in length and shall contain the
2058  * identifier of the attribute that has been read (or of which an element has been read).
2059  *
2060  * This field shall contain the same value that was included in the corresponding
2061  * attribute identifier field of the original read attributes or read attributes
2062  * structured command.
2063  *
2064  * @since_tizen 4.0
2065  *
2066  * @param[in] handle The handle of read attribute status record
2067  * @param[in] id Attribute identifier
2068  *
2069  * @return 0 on success, otherwise a negative error value.
2070  * @retval #ZIGBEE_ERROR_NONE Successful
2071  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2072  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2073  *
2074  * @see zb_read_attr_status_record_create()
2075  * @see zb_read_attr_status_record_destroy()
2076  * @see zb_read_attr_status_record_set_status()
2077  * @see zb_read_attr_status_record_set_value()
2078  * @see zb_zcl_global_attr_read_cb()
2079  * @see zb_read_attr_status_record_get_id()
2080  * @see zb_read_attr_status_record_get_status()
2081  * @see zb_read_attr_status_record_get_type()
2082  * @see zb_read_attr_status_record_get_value()
2083  */
2084 int zb_read_attr_status_record_set_id(
2085                 zb_zcl_read_attr_status_record_h handle, zb_attribute_id id);
2086
2087 /**
2088  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_ATTRIBUTE_STATUS_RECORD_MODULE
2089  * @brief Gets status from read attribute status record.
2090  * @details The status field is 8 bits in length and specifies the status of the read
2091  * operation on this attribute.
2092  *
2093  * This field shall be set to #ZB_ZCL_STATUS_SUCCESS, if the operation
2094  * was successful, or an error code, as specified in #zb_zcl_status_e if the operation was
2095  * not successful.
2096  *
2097  * @since_tizen 4.0
2098  *
2099  * @param[in] handle The handle of read attribute status record
2100  * @param[out] status error code @see #zb_zcl_status_e
2101  *
2102  * @return 0 on success, otherwise a negative error value.
2103  * @retval #ZIGBEE_ERROR_NONE Successful
2104  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2105  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2106  *
2107  * @see zb_read_attr_status_record_create()
2108  * @see zb_read_attr_status_record_destroy()
2109  * @see zb_read_attr_status_record_set_id()
2110  * @see zb_read_attr_status_record_set_status()
2111  * @see zb_read_attr_status_record_set_value()
2112  * @see zb_zcl_global_attr_read_cb()
2113  * @see zb_read_attr_status_record_get_id()
2114  * @see zb_read_attr_status_record_get_type()
2115  * @see zb_read_attr_status_record_get_value()
2116  */
2117 int zb_read_attr_status_record_get_status(
2118                 zb_zcl_read_attr_status_record_h handle, zb_zcl_status_e* status);
2119
2120 /**
2121  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_ATTRIBUTE_STATUS_RECORD_MODULE
2122  * @brief Sets status to read attribute status record.
2123  * @details The status field is 8 bits in length and specifies the status of the read
2124  * operation on this attribute.
2125  *
2126  * @since_tizen 4.0
2127  *
2128  * @param[in] handle The handle of read attribute status record
2129  * @param[in] status error code @see #zb_zcl_status_e
2130  *
2131  * @return 0 on success, otherwise a negative error value.
2132  * @retval #ZIGBEE_ERROR_NONE Successful
2133  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2134  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2135  *
2136  * @see zb_read_attr_status_record_create()
2137  * @see zb_read_attr_status_record_destroy()
2138  * @see zb_read_attr_status_record_set_id()
2139  * @see zb_read_attr_status_record_set_value()
2140  * @see zb_zcl_global_attr_read_cb()
2141  * @see zb_read_attr_status_record_get_id()
2142  * @see zb_read_attr_status_record_get_status()
2143  * @see zb_read_attr_status_record_get_type()
2144  * @see zb_read_attr_status_record_get_value()
2145  */
2146 int zb_read_attr_status_record_set_status(
2147                 zb_zcl_read_attr_status_record_h handle, zb_zcl_status_e status);
2148
2149 /**
2150  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_ATTRIBUTE_STATUS_RECORD_MODULE
2151  * @brief Gets type from read attribute status record.
2152  * @details The attribute data type field shall contain the data type of the attribute
2153  * in the same read attributes status record.
2154  *
2155  * This field shall only be included if the associated status
2156  * field contains a value of #ZB_ZCL_STATUS_SUCCESS.
2157  *
2158  * @since_tizen 4.0
2159  *
2160  * @param[in] handle The handle of read attribute status record
2161  * @param[out] type Data type
2162  *
2163  * @return 0 on success, otherwise a negative error value.
2164  * @retval #ZIGBEE_ERROR_NONE Successful
2165  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2166  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2167  *
2168  * @see zb_read_attr_status_record_create()
2169  * @see zb_read_attr_status_record_destroy()
2170  * @see zb_read_attr_status_record_set_id()
2171  * @see zb_read_attr_status_record_set_status()
2172  * @see zb_read_attr_status_record_set_value()
2173  * @see zb_zcl_global_attr_read_cb()
2174  * @see zb_read_attr_status_record_get_id()
2175  * @see zb_read_attr_status_record_get_status()
2176  * @see zb_read_attr_status_record_get_value()
2177  */
2178 int zb_read_attr_status_record_get_type(
2179                 zb_zcl_read_attr_status_record_h handle, zb_zcl_data_type_e *type);
2180
2181 /**
2182  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_ATTRIBUTE_STATUS_RECORD_MODULE
2183  * @brief Sets type to read attribute status record.
2184  * @details The attribute data type field shall contain the data type of the attribute
2185  * in the same read attributes status record.
2186  *
2187  * @since_tizen 4.0
2188  *
2189  * @param[in] handle The handle of read attribute status record
2190  * @param[in] type Data type
2191  *
2192  * @return 0 on success, otherwise a negative error value.
2193  * @retval #ZIGBEE_ERROR_NONE Successful
2194  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2195  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2196  *
2197  * @see zb_read_attr_status_record_create()
2198  * @see zb_read_attr_status_record_destroy()
2199  * @see zb_read_attr_status_record_set_id()
2200  * @see zb_read_attr_status_record_set_status()
2201  * @see zb_read_attr_status_record_set_value()
2202  * @see zb_zcl_global_attr_read_cb()
2203  * @see zb_read_attr_status_record_get_id()
2204  * @see zb_read_attr_status_record_get_status()
2205  * @see zb_read_attr_status_record_get_type()
2206  * @see zb_read_attr_status_record_get_value()
2207  */
2208 int zb_read_attr_status_record_set_type(
2209                 zb_zcl_read_attr_status_record_h handle, zb_zcl_data_type_e type);
2210
2211 /**
2212  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_ATTRIBUTE_STATUS_RECORD_MODULE
2213  * @brief Gets data value from read attribute status record.
2214  * @details The attribute value field is variable in length and shall contain the current
2215  * value of this attribute.
2216  *
2217  * This field shall only be included if the associated
2218  * status field contains a value of #ZB_ZCL_STATUS_SUCCESS.
2219  * For an attribute or element of simple type, this
2220  * field has the format shown in the Table of Data Types .
2221  *
2222  * @since_tizen 4.0
2223  *
2224  * @remarks The @a value should be released using free().
2225  *
2226  * @param[in] handle The handle of read attribute status record
2227  * @param[out] type Attribute data type. The attribute data type shall contain the data
2228  *  type of the attribute in the same read attributes status record
2229  *  (see #zb_zcl_data_type_e). This field shall only be included if the status
2230  *  code is #ZB_ZCL_STATUS_SUCCESS.
2231  * @param[out] value Attribute value. The attribute value field is variable in length
2232  *  and shall contain the current value of this attribute. This field shall only be
2233  *  included if the associated status field contains a value of #ZB_ZCL_STATUS_SUCCESS.
2234  *  For an attribute or element of simple type (not array, structure, set or bag), this
2235  *  field has the format shown in the Table of Data Types (see #zb_zcl_data_type_e).
2236  * @param[out] count The number of attribute data
2237  *
2238  * @return 0 on success, otherwise a negative error value.
2239  * @retval #ZIGBEE_ERROR_NONE Successful
2240  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2241  * @retval #ZIGBEE_ERROR_NO_DATA No data available
2242  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
2243  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2244  *
2245  * @see zb_read_attr_status_record_create()
2246  * @see zb_read_attr_status_record_destroy()
2247  * @see zb_read_attr_status_record_set_id()
2248  * @see zb_read_attr_status_record_set_status()
2249  * @see zb_read_attr_status_record_set_value()
2250  * @see zb_zcl_global_attr_read_cb()
2251  * @see zb_read_attr_status_record_get_id()
2252  * @see zb_read_attr_status_record_get_status()
2253  * @see zb_read_attr_status_record_get_type()
2254  */
2255 int zb_read_attr_status_record_get_value(
2256                 zb_zcl_read_attr_status_record_h handle,
2257                 zb_zcl_data_type_e* type,
2258                 unsigned char** value,
2259                 int* count);
2260
2261 /**
2262  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_ATTRIBUTE_STATUS_RECORD_MODULE
2263  * @brief Sets data value to read attribute status record.
2264  * @details The attribute value field is variable in length and shall contain the current
2265  * value of this attribute.
2266  *
2267  * For an attribute or element of simple type, this
2268  * field has the format shown in the #zb_zcl_data_type_e.
2269  *
2270  * @since_tizen 4.0
2271  *
2272  * @param[in] handle The handle of read attribute status record
2273  * @param[in] type Attribute data type
2274  * @param[in] value Attribute data value
2275  * @param[in] count The length of attribute data
2276  *
2277  * @return 0 on success, otherwise a negative error value.
2278  * @retval #ZIGBEE_ERROR_NONE Successful
2279  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2280  * @retval #ZIGBEE_ERROR_NO_DATA No data available
2281  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
2282  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2283  *
2284  * @see zb_read_attr_status_record_create()
2285  * @see zb_read_attr_status_record_destroy()
2286  * @see zb_read_attr_status_record_set_id()
2287  * @see zb_read_attr_status_record_set_status()
2288  * @see zb_zcl_global_attr_read_cb()
2289  * @see zb_read_attr_status_record_get_id()
2290  * @see zb_read_attr_status_record_get_status()
2291  * @see zb_read_attr_status_record_get_type()
2292  * @see zb_read_attr_status_record_get_value()
2293  */
2294 int zb_read_attr_status_record_set_value(
2295                 zb_zcl_read_attr_status_record_h handle,
2296                 zb_zcl_data_type_e type,
2297                 unsigned char* value,
2298                 int count);
2299
2300 /**
2301  * @brief Called with device attributes.
2302  * @details This callback is called when device attributes are requested with
2303  * #zb_zcl_global_attr_read().
2304  *
2305  * @since_tizen 4.0
2306  *
2307  * @remarks The @a records can be used only in the callback.
2308  * If you want to use them outside, copy each of them with #zb_read_attr_status_record_clone().
2309  * @remarks The @a records should not be released.
2310  *
2311  * @param[out] addr16 The source network address
2312  * @param[out] ep The source end-point of the received information (ex. endpoint 1)
2313  * @param[out] clusterid ZCL cluster id
2314  * @param[out] records Attribute status record
2315  * @param[out] count The number of items in @records
2316  * @param[out] user_data User data
2317  *
2318  * @see zb_zcl_global_attr_read()
2319  */
2320 typedef void (*zb_zcl_global_attr_read_cb)(
2321                 zb_nwk_addr addr16,
2322                 zb_end_point ep,
2323                 zb_cluster_id clusterid,
2324                 zb_zcl_read_attr_status_record_h *records,
2325                 int count,
2326                 void *user_data);
2327
2328 /**
2329  * @brief Sends 'read attributes' command.
2330  * @details Call this function to read attributes of devices.
2331  *
2332  * @since_tizen 4.0
2333  * @privlevel public
2334  * @privilege %http://tizen.org/privilege/zigbee
2335  *
2336  * @param[in] handle The handle of zigbee
2337  * @param[in] addr16 target network address
2338  * @param[in] src_ep source end-point (ex. 1)
2339  * @param[in] dst_ep destination end-point (ex. 1)
2340  * @param[in] zcl_fc frame control bits (default 0x00). \n
2341  *            Only OR operation is allowed in ZCL header \n
2342  *            - Frame Type : \n
2343  *            #ZB_ZCL_FC_GLOBALLY_USED (default) \n
2344  *            #ZB_APS_FC_CLUSTER_SPECIFIC \n
2345  *            - Manufacturer Specific : \n
2346  *            - Direction : \n
2347  *            #ZB_ZCL_CLIENT_TO_SERVER (default) \n
2348  *            #ZB_ZCL_SERVER_TO_CLIENT \n
2349  *            - Disable Default Response : \n
2350  *            #ZB_ZCL_DEFAULT_RESPONSE_ENABLED (default) \n
2351  *            #ZB_ZCL_DEFAULT_RESPONSE_DISABLED \n
2352  * @param[in] clusterid ZCL cluster id
2353  * @param[in] attribute_ids Attributes_ids-list
2354  * @param[in] count The number of items in the @a attribute_ids list
2355  * @param[in] cb Response callback function
2356  * @param[in] user_data User data
2357  *
2358  * @return 0 on success, otherwise a negative error value.
2359  * @retval #ZIGBEE_ERROR_NONE Successful
2360  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2361  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
2362  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
2363  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
2364  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
2365  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2366  *
2367  * @see zb_zcl_global_attr_read_cb()
2368  */
2369 int zb_zcl_global_attr_read(
2370                 zb_zigbee_h handle,
2371                 zb_nwk_addr addr16,
2372                 zb_end_point src_ep,
2373                 zb_end_point dst_ep,
2374                 zb_zcl_frame_ctl zcl_fc,
2375                 zb_cluster_id clusterid,
2376                 zb_attribute_id *attribute_ids,
2377                 int count,
2378                 zb_zcl_global_attr_read_cb cb,
2379                 void *user_data);
2380
2381 /**
2382  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_STATUS_RECORD_MODULE
2383  * @brief Creates write attribute status record.
2384  * @details This allocates heap for write attribute status record
2385  *
2386  * @since_tizen 4.0
2387  * @privlevel public
2388  * @privilege %http://tizen.org/privilege/zigbee
2389  *
2390  * @remarks The @a handle should be released using zb_write_attr_status_destroy().
2391  *
2392  * @param[out] handle The handle of write attribute status record
2393  *
2394  * @return 0 on success, otherwise a negative error value.
2395  * @retval #ZIGBEE_ERROR_NONE Successful
2396  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2397  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
2398  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
2399  *
2400  * @see zb_zcl_global_write_attr_cb()
2401  * @see zb_write_attr_status_clone()
2402  * @see zb_write_attr_status_destroy()
2403  * @see zb_write_attr_status_get_status()
2404  * @see zb_write_attr_status_set_status()
2405  * @see zb_write_attr_status_get_id()
2406  * @see zb_write_attr_status_set_id()
2407  */
2408 int zb_write_attr_status_create(zb_zcl_write_attr_status_record_h *handle);
2409
2410 /**
2411  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_STATUS_RECORD_MODULE
2412  * @brief Clones a write attribute status record.
2413  *
2414  * @since_tizen 4.0
2415  *
2416  * @remarks The @a dst should be released using zb_write_attr_status_destroy().
2417  *
2418  * @param[in] src Source handle of write attribute status record
2419  * @param[in] dst Destination handle of write attribute status record
2420  *
2421  * @return 0 on success, otherwise a negative error value.
2422  * @retval #ZIGBEE_ERROR_NONE Successful
2423  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2424  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2425  *
2426  * @see zb_zcl_global_write_attr_cb()
2427  * @see zb_write_attr_status_create()
2428  * @see zb_write_attr_status_destroy()
2429  * @see zb_write_attr_status_get_status()
2430  * @see zb_write_attr_status_set_status()
2431  * @see zb_write_attr_status_get_id()
2432  * @see zb_write_attr_status_set_id()
2433  */
2434 int zb_write_attr_status_clone(zb_zcl_write_attr_status_record_h src,
2435                 zb_zcl_write_attr_status_record_h *dst);
2436
2437 /**
2438  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_STATUS_RECORD_MODULE
2439  * @brief Destroys a write attribute status record.
2440  *
2441  * @since_tizen 4.0
2442  *
2443  * @param[in] handle The handle of write attribute status record
2444  *
2445  * @return 0 on success, otherwise a negative error value.
2446  * @retval #ZIGBEE_ERROR_NONE Successful
2447  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2448  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2449  *
2450  * @see zb_zcl_global_write_attr_cb()
2451  * @see zb_write_attr_status_create()
2452  * @see zb_write_attr_status_clone()
2453  * @see zb_write_attr_status_get_status()
2454  * @see zb_write_attr_status_set_status()
2455  * @see zb_write_attr_status_get_id()
2456  * @see zb_write_attr_status_set_id()
2457  */
2458 int zb_write_attr_status_destroy(zb_zcl_write_attr_status_record_h handle);
2459
2460 /**
2461  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_STATUS_RECORD_MODULE
2462  * @brief Gets the status from a write attribute status record.
2463  * @details The status field is 8 bits in length and specifies the status of the read
2464  * operation on this attribute.
2465  *
2466  * This field shall be set to #ZB_ZCL_STATUS_SUCCESS, if the operation
2467  * was successful, or an error code, as specified in #zb_zcl_status_e if the operation was
2468  * not successful.
2469  *
2470  * @since_tizen 4.0
2471  *
2472  * @param[in] handle The handle of read attribute status record
2473  * @param[out] status error code @see #zb_zcl_status_e
2474  *
2475  * @return 0 on success, otherwise a negative error value.
2476  * @retval #ZIGBEE_ERROR_NONE Successful
2477  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2478  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2479  *
2480  * @see zb_zcl_global_write_attr_cb()
2481  * @see zb_write_attr_status_create()
2482  * @see zb_write_attr_status_clone()
2483  * @see zb_write_attr_status_destroy()
2484  * @see zb_write_attr_status_get_id()
2485  * @see zb_write_attr_status_set_id()
2486  * @see zb_write_attr_status_set_status()
2487  */
2488 int zb_write_attr_status_get_status(
2489                 zb_zcl_write_attr_status_record_h handle,
2490                 zb_zcl_status_e *status);
2491
2492 /**
2493  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_STATUS_RECORD_MODULE
2494  * @brief Sets the status to a write attribute status record.
2495  * @details The status field is 8 bits in length and specifies the status of the read
2496  * operation on this attribute.
2497  *
2498  * @since_tizen 4.0
2499  *
2500  * @param[in] handle The handle of read attribute status record
2501  * @param[in] status error code @see #zb_zcl_status_e
2502  *
2503  * @return 0 on success, otherwise a negative error value.
2504  * @retval #ZIGBEE_ERROR_NONE Successful
2505  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2506  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2507  *
2508  * @see zb_zcl_global_write_attr_cb()
2509  * @see zb_write_attr_status_create()
2510  * @see zb_write_attr_status_clone()
2511  * @see zb_write_attr_status_destroy()
2512  * @see zb_write_attr_status_get_status()
2513  * @see zb_write_attr_status_get_id()
2514  * @see zb_write_attr_status_set_id()
2515  */
2516 int zb_write_attr_status_set_status(
2517                 zb_zcl_write_attr_status_record_h handle,
2518                 zb_zcl_status_e status);
2519
2520 /**
2521  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_STATUS_RECORD_MODULE
2522  * @brief Gets the identifier from a write attribute status record.
2523  * @details The attribute identifier field is 16 bits in length and shall contain the
2524  * identifier of the attribute that has been write (or of which an element has been write).
2525  *
2526  * This field shall contain the same value that was included in the corresponding
2527  * attribute identifier field of the original write attributes or write attributes
2528  * structured command.
2529  *
2530  * @since_tizen 4.0
2531  *
2532  * @param[in] handle The handle of write attribute status record
2533  * @param[out] id Attribute identifier
2534  *
2535  * @return 0 on success, otherwise a negative error value.
2536  * @retval #ZIGBEE_ERROR_NONE Successful
2537  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2538  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2539  *
2540  * @see zb_zcl_global_write_attr_cb()
2541  * @see zb_write_attr_status_create()
2542  * @see zb_write_attr_status_clone()
2543  * @see zb_write_attr_status_destroy()
2544  * @see zb_write_attr_status_get_status()
2545  * @see zb_write_attr_status_set_status()
2546  * @see zb_write_attr_status_set_id()
2547  */
2548 int zb_write_attr_status_get_id(
2549                 zb_zcl_write_attr_status_record_h handle,
2550                 zb_attribute_id *id);
2551
2552 /**
2553  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_STATUS_RECORD_MODULE
2554  * @brief Sets the identifier to a write attribute status record.
2555  * @details The attribute identifier field is 16 bits in length and shall contain the
2556  * identifier of the attribute that has been write (or of which an element has been write).
2557  *
2558  * This field shall contain the same value that was included in the corresponding
2559  * attribute identifier field of the original write attributes or write attributes
2560  * structured command.
2561  *
2562  * @since_tizen 4.0
2563  *
2564  * @param[in] handle The handle of write attribute status record
2565  * @param[in] id Attribute identifier
2566  *
2567  * @return 0 on success, otherwise a negative error value.
2568  * @retval #ZIGBEE_ERROR_NONE Successful
2569  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2570  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2571  *
2572  * @see zb_zcl_global_write_attr_cb()
2573  * @see zb_write_attr_status_create()
2574  * @see zb_write_attr_status_clone()
2575  * @see zb_write_attr_status_destroy()
2576  * @see zb_write_attr_status_get_status()
2577  * @see zb_write_attr_status_set_status()
2578  * @see zb_write_attr_status_get_id()
2579  */
2580 int zb_write_attr_status_set_id(
2581                 zb_zcl_write_attr_status_record_h handle,
2582                 zb_attribute_id id);
2583
2584 /**
2585  * @brief Called when write attributes command are requested.
2586  * @details This callback is called when attributes are written with
2587  * #zb_zcl_global_attr_write() or #zb_zcl_global_attr_write_undivided().
2588  * In other words, the write attributes response is generated in response to the write
2589  * attributes command.
2590  *
2591  * @since_tizen 4.0
2592  *
2593  * @remarks The @a records can be used only in the callback.
2594  * @remarks If you want to use them outside, copy them with #zb_write_attr_status_clone().
2595  * @remarks The @a records should not be released.
2596  *
2597  * @param[out] addr16 The source network address
2598  * @param[out] ep The source end-point of the received information (ex. endpoint 1)
2599  * @param[out] clusterid ZCL cluster id
2600  * @param[out] records Attribute status record
2601  * @param[out] count The number of items in @a records
2602  * @param[out] user_data User data
2603  *
2604  * @see zb_zcl_global_attr_write()
2605  */
2606 typedef void (*zb_zcl_global_attr_write_cb)(
2607                 zb_nwk_addr addr16,
2608                 zb_end_point ep,
2609                 zb_cluster_id clusterid,
2610                 zb_zcl_write_attr_status_record_h *records,
2611                 int count,
2612                 void *user_data);
2613
2614 /**
2615  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_RECORD_MODULE
2616  * @brief Creates a write attribute record.
2617  *
2618  * @since_tizen 4.0
2619  * @privlevel public
2620  * @privilege %http://tizen.org/privilege/zigbee
2621  *
2622  * @param[in] handle The handle of write attribute record
2623  *
2624  * @return 0 on success, otherwise a negative error value.
2625  * @retval #ZIGBEE_ERROR_NONE Successful
2626  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2627  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
2628  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
2629  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2630  *
2631  * @see zb_zcl_global_attr_write()
2632  * @see zb_zcl_global_attr_write_undivided()
2633  * @see zb_zcl_global_write_attr_no_rep()
2634  * @see zb_write_attr_record_destroy()
2635  * @see zb_write_attr_record_set_id()
2636  * @see zb_write_attr_record_set_value()
2637  */
2638 int zb_write_attr_record_create(zb_zcl_write_attr_record_h *handle);
2639
2640 /**
2641  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_RECORD_MODULE
2642  * @brief Destroys a write attribute record handle.
2643  *
2644  * @since_tizen 4.0
2645  *
2646  * @param[in] handle The handle of write attribute record
2647  *
2648  * @return 0 on success, otherwise a negative error value.
2649  * @retval #ZIGBEE_ERROR_NONE Successful
2650  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2651  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2652  *
2653  * @see zb_zcl_global_attr_write()
2654  * @see zb_zcl_global_attr_write_undivided()
2655  * @see zb_zcl_global_write_attr_no_rep()
2656  * @see zb_write_attr_record_create()
2657  * @see zb_write_attr_record_clone()
2658  * @see zb_write_attr_record_set_id()
2659  * @see zb_write_attr_record_set_value()
2660  */
2661 int zb_write_attr_record_destroy(zb_zcl_write_attr_record_h handle);
2662
2663 /**
2664  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_RECORD_MODULE
2665  * @brief Sets the attribute identifier of a write attribute record.
2666  * @details The attribute identifier field is 16 bits in length and shall contain the
2667  * identifier of the attribute that is to be written.
2668  *
2669  * @since_tizen 4.0
2670  *
2671  * @param[in] handle The handle of write attribute record
2672  * @param[in] id Attribute identifier
2673  *
2674  * @return 0 on success, otherwise a negative error value.
2675  * @retval #ZIGBEE_ERROR_NONE Successful
2676  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2677  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2678  *
2679  * @see zb_zcl_global_attr_write()
2680  * @see zb_zcl_global_attr_write_undivided()
2681  * @see zb_zcl_global_write_attr_no_rep()
2682  * @see zb_write_attr_record_create()
2683  * @see zb_write_attr_record_destroy()
2684  * @see zb_write_attr_record_set_value()
2685  */
2686 int zb_write_attr_record_set_id(zb_zcl_write_attr_record_h handle,
2687                 zb_attribute_id id);
2688
2689 /**
2690  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_RECORD_MODULE
2691  * @brief Sets the attribute data type of a write attribute record.
2692  * @details The attribute data type field shall contain the data type of the attribute
2693  * that is to be written.
2694  *
2695  * @since_tizen 4.0
2696  *
2697  * @param[in] handle The handle of write attribute record
2698  * @param[in] type attribute data type
2699  *
2700  * @return 0 on success, otherwise a negative error value.
2701  * @retval #ZIGBEE_ERROR_NONE Successful
2702  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2703  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2704  *
2705  * @see zb_zcl_global_attr_write()
2706  * @see zb_zcl_global_attr_write_undivided()
2707  * @see zb_zcl_global_write_attr_no_rep()
2708  * @see zb_write_attr_record_create()
2709  * @see zb_write_attr_record_destroy()
2710  * @see zb_write_attr_record_set_id()
2711  * @see zb_write_attr_record_set_value()
2712  */
2713 int zb_write_attr_record_set_type(zb_zcl_write_attr_record_h handle,
2714                 zb_zcl_data_type_e type);
2715
2716 /**
2717  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_WRITE_ATTRIBUTE_RECORD_MODULE
2718  * @brief Sets data value to write attribute status record.
2719  * @details The attribute data type field shall contain the data type of the attribute in
2720  * the same attribute report field
2721  *
2722  * @since_tizen 4.0
2723  *
2724  * @param[in] handle The handle of write attribute status record
2725  * @param[in] type Attribute data type
2726  * @param[in] value Attribute data value
2727  * @param[in] count The number of items in @a value
2728
2729  *
2730  * @return 0 on success, otherwise a negative error value.
2731  * @retval #ZIGBEE_ERROR_NONE Successful
2732  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2733  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
2734  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2735  *
2736  * @see zb_zcl_global_attr_write()
2737  * @see zb_zcl_global_attr_write_undivided()
2738  * @see zb_zcl_global_write_attr_no_rep()
2739  * @see zb_write_attr_record_create()
2740  * @see zb_write_attr_record_destroy()
2741  * @see zb_write_attr_record_set_id()
2742  * @see zb_write_attr_record_set_value()
2743  */
2744 int zb_write_attr_record_set_value(
2745                 zb_zcl_write_attr_record_h handle,
2746                 zb_zcl_data_type_e type,
2747                 unsigned char* value,
2748                 int count);
2749
2750 /**
2751  * @brief Sends 'write Attributes' command.
2752  * @details Call this function to write attributes of other devices.
2753  *
2754  * @since_tizen 4.0
2755  * @privlevel public
2756  * @privilege %http://tizen.org/privilege/zigbee
2757  *
2758  * @param[in] handle The handle of zigbee
2759  * @param[in] addr16 target network address
2760  * @param[in] src_ep source end-point (ex. 1)
2761  * @param[in] dst_ep destination end-point (ex. 1)
2762  * @param[in] zcl_fc frame control bits (default 0x00). \n
2763  *            Only OR operation is allowed in ZCL header \n
2764  *            - Frame Type : \n
2765  *            #ZB_ZCL_FC_GLOBALLY_USED (default) \n
2766  *            #ZB_APS_FC_CLUSTER_SPECIFIC \n
2767  *            - Manufacturer Specific : \n
2768  *            - Direction : \n
2769  *            #ZB_ZCL_CLIENT_TO_SERVER (default) \n
2770  *            #ZB_ZCL_SERVER_TO_CLIENT \n
2771  *            - Disable Default Response : \n
2772  *            #ZB_ZCL_DEFAULT_RESPONSE_ENABLED (default) \n
2773  *            #ZB_ZCL_DEFAULT_RESPONSE_DISABLED \n
2774  * @param[in] clusterid ZCL cluster id
2775  * @param[in] records Array of #zb_zcl_write_attr_record_h
2776  * @param[in] count The number of items in @a records array
2777  * @param[in] cb Response callback function
2778  * @param[in] user_data User data
2779  *
2780  * @return 0 on success, otherwise a negative error value.
2781  * @retval #ZIGBEE_ERROR_NONE Successful
2782  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2783  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
2784  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
2785  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
2786  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
2787  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2788  *
2789  * @see zb_zcl_global_attr_write_cb()
2790  */
2791 int zb_zcl_global_attr_write(
2792                 zb_zigbee_h handle,
2793                 zb_nwk_addr addr16,
2794                 zb_end_point src_ep,
2795                 zb_end_point dst_ep,
2796                 zb_zcl_frame_ctl zcl_fc,
2797                 zb_cluster_id clusterid,
2798                 zb_zcl_write_attr_record_h *records,
2799                 int count,
2800                 zb_zcl_global_attr_write_cb cb,
2801                 void *user_data);
2802
2803 /**
2804  * @brief Sends 'write attributes undivided' command.
2805  * @details Call this function to write attributes without fragmentation to other devices.
2806  *
2807  * @since_tizen 4.0
2808  * @privlevel public
2809  * @privilege %http://tizen.org/privilege/zigbee
2810  *
2811  * @param[in] handle The handle of zigbee
2812  * @param[in] addr16 target network address
2813  * @param[in] src_ep source end-point (ex. 1)
2814  * @param[in] dst_ep destination end-point (ex. 1)
2815  * @param[in] zcl_fc frame control bits (default 0x00). \n
2816  *            Only OR operation is allowed in ZCL header \n
2817  *            - Frame Type : \n
2818  *            #ZB_ZCL_FC_GLOBALLY_USED (default) \n
2819  *            #ZB_APS_FC_CLUSTER_SPECIFIC \n
2820  *            - Manufacturer Specific : \n
2821  *            - Direction : \n
2822  *            #ZB_ZCL_CLIENT_TO_SERVER (default) \n
2823  *            #ZB_ZCL_SERVER_TO_CLIENT \n
2824  *            - Disable Default Response : \n
2825  *            #ZB_ZCL_DEFAULT_RESPONSE_ENABLED (default) \n
2826  *            #ZB_ZCL_DEFAULT_RESPONSE_DISABLED \n
2827  * @param[in] clusterid ZCL cluster id
2828  * @param[in] records Array of #zb_zcl_write_attr_record_h
2829  * @param[in] count The number of items in @a records array
2830  * @param[in] cb Response callback function
2831  * @param[in] user_data User data
2832  *
2833  * @return 0 on success, otherwise a negative error value.
2834  * @retval #ZIGBEE_ERROR_NONE Successful
2835  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2836  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
2837  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
2838  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
2839  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
2840  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2841  *
2842  * @see zb_zcl_global_attr_write_cb()
2843  */
2844 int zb_zcl_global_attr_write_undivided(
2845                 zb_zigbee_h handle,
2846                 zb_nwk_addr addr16,
2847                 zb_end_point src_ep,
2848                 zb_end_point dst_ep,
2849                 zb_zcl_frame_ctl zcl_fc,
2850                 zb_cluster_id clusterid,
2851                 zb_zcl_write_attr_record_h *records,
2852                 int count,
2853                 zb_zcl_global_attr_write_cb cb,
2854                 void *user_data);
2855
2856 /**
2857  * @brief Sends 'write Attributes without response' command.
2858  * @details Call this function to write attributes of other devices without receiving any
2859  * response.
2860  *
2861  * @since_tizen 4.0
2862  * @privlevel public
2863  * @privilege %http://tizen.org/privilege/zigbee
2864  *
2865  * @param[in] handle The handle of zigbee
2866  * @param[in] addr16 target network address
2867  * @param[in] src_ep source end-point (ex. 1)
2868  * @param[in] dst_ep destination end-point (ex. 1)
2869  * @param[in] zcl_fc frame control bits (default 0x00). \n
2870  *            Only OR operation is allowed in ZCL header \n
2871  *            - Frame Type : \n
2872  *            #ZB_ZCL_FC_GLOBALLY_USED (default) \n
2873  *            #ZB_APS_FC_CLUSTER_SPECIFIC \n
2874  *            - Manufacturer Specific : \n
2875  *            - Direction : \n
2876  *            #ZB_ZCL_CLIENT_TO_SERVER (default) \n
2877  *            #ZB_ZCL_SERVER_TO_CLIENT \n
2878  *            - Disable Default Response : \n
2879  *            #ZB_ZCL_DEFAULT_RESPONSE_ENABLED (default) \n
2880  *            #ZB_ZCL_DEFAULT_RESPONSE_DISABLED \n
2881  * @param[in] clusterid ZCL cluster id
2882  * @param[in] records Array of #zb_zcl_write_attr_record_h
2883  * @param[in] count The number of items in @a records array
2884  *
2885  * @return 0 on success, otherwise a negative error value.
2886  * @retval #ZIGBEE_ERROR_NONE Successful
2887  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2888  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
2889  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
2890  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
2891  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
2892  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2893  *
2894  */
2895 int zb_zcl_global_attr_write_no_rsp(
2896                 zb_zigbee_h handle,
2897                 zb_nwk_addr addr16,
2898                 zb_end_point src_ep,
2899                 zb_end_point dst_ep,
2900                 zb_zcl_frame_ctl zcl_fc,
2901                 zb_cluster_id clusterid,
2902                 zb_zcl_write_attr_record_h *records,
2903                 int count);
2904
2905 /**
2906  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RESPONSE_RECORD_MODULE
2907  * @brief Clones a report config response record.
2908  *
2909  * @since_tizen 4.0
2910  *
2911  * @remarks The @a dst should be released using zb_report_config_response_record_destroy().
2912  *
2913  * @param[in] src Source handle of report config response record
2914  * @param[in] dst Destination handle of report config response record
2915  *
2916  * @return 0 on success, otherwise a negative error value.
2917  * @retval #ZIGBEE_ERROR_NONE Successful
2918  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2919  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2920  *
2921  * @see zb_zcl_global_config_report_write_cb()
2922  * @see zb_report_config_response_record_destroy()
2923  * @see zb_report_config_response_record_get_status()
2924  * @see zb_report_config_response_record_get_dir()
2925  * @see zb_report_config_response_record_get_id()
2926  */
2927 int zb_report_config_response_record_clone(
2928                 zb_zcl_report_config_response_record_h src,
2929                 zb_zcl_report_config_response_record_h *dst);
2930
2931 /**
2932  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RESPONSE_RECORD_MODULE
2933  * @brief Destroys a reporting configuration response record.
2934  *
2935  * @since_tizen 4.0
2936  *
2937  * @param[in] handle The handle of reporting configuration response record
2938  *
2939  * @return 0 on success, otherwise a negative error value.
2940  * @retval #ZIGBEE_ERROR_NONE Successful
2941  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2942  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2943  *
2944  * @see zb_zcl_global_config_report_write_cb()
2945  * @see zb_report_config_response_record_clone()
2946  * @see zb_report_config_response_record_get_status()
2947  * @see zb_report_config_response_record_get_dir()
2948  * @see zb_report_config_response_record_get_id()
2949  */
2950 int zb_report_config_response_record_destroy(
2951                 zb_zcl_report_config_response_record_h handle);
2952
2953 /**
2954  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RESPONSE_RECORD_MODULE
2955  * @brief Gets status from a reporting configuration response record.
2956  * @details If the attribute is not implemented on the sender or receiver of the command,
2957  * whichever is relevant (depending on direction), the result shall be set to
2958  * #ZB_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE.
2959  *
2960  * If the attribute is supported, but is not capable of
2961  * being reported, this field shall be set to #ZB_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE.
2962  *
2963  * Otherwise, this field shall be set to #ZB_ZCL_STATUS_SUCCESS.
2964  *
2965  * If the status field is not set to #ZB_ZCL_STATUS_SUCCESS, all fields except the
2966  * direction and attribute identifier fields shall be omitted.
2967  *
2968  * @since_tizen 4.0
2969  *
2970  * @param[in] handle The handle of write attribute status record
2971  * @param[out] status status @see #zb_zcl_status_e
2972  *
2973  * @return 0 on success, otherwise a negative error value.
2974  * @retval #ZIGBEE_ERROR_NONE Successful
2975  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
2976  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
2977  *
2978  * @see zb_zcl_global_config_report_write_cb()
2979  * @see zb_report_config_response_record_clone()
2980  * @see zb_report_config_response_record_destroy()
2981  * @see zb_report_config_response_record_get_status()
2982  * @see zb_report_config_response_record_get_dir()
2983  * @see zb_report_config_response_record_get_id()
2984  */
2985 int zb_report_config_response_record_get_status(
2986                 zb_zcl_report_config_response_record_h handle,
2987                 zb_zcl_status_e *status);
2988
2989 /**
2990  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RESPONSE_RECORD_MODULE
2991  * @brief Gets the direction from a reporting configuration response record.
2992  * @details The direction field specifies whether values of the attribute are reported
2993  * (0x00), or whether reports of the attribute are received (0x01).
2994  *
2995  * If this value is set to 0x00, then the attribute data type field, the minimum
2996  * reporting interval field, the maximum reporting interval field and the reportable
2997  * change field are included in the payload, and the timeout period field is omitted. If
2998  * this value is set to 0x01, then the timeout period field is included in the payload,
2999  * and the attribute data type field, the minimum reporting interval field, the
3000  * maximum reporting interval field and the reportable change field are omitted.
3001  *
3002  * All other values of this field are reserved.
3003  *
3004  * @since_tizen 4.0
3005  *
3006  * @param[in] handle The handle of write attribute status record
3007  * @param[out] dir direction 00 : #ZB_ZCL_CLIENT_TO_SERVER \n
3008  *                           01 : #ZB_ZCL_SERVER_TO_CLIENT \n
3009  *
3010  * @return 0 on success, otherwise a negative error value.
3011  * @retval #ZIGBEE_ERROR_NONE Successful
3012  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3013  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3014  *
3015  * @see zb_zcl_global_config_report_write_cb()
3016  * @see zb_report_config_response_record_clone()
3017  * @see zb_report_config_response_record_destroy()
3018  * @see zb_report_config_response_record_get_status()
3019  * @see zb_report_config_response_record_get_dir()
3020  * @see zb_report_config_response_record_get_id()
3021  */
3022 int zb_report_config_response_record_get_dir(
3023                 zb_zcl_report_config_response_record_h handle,
3024                 zb_zcl_fc_direction_e *dir);
3025
3026 /**
3027  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RESPONSE_RECORD_MODULE
3028  * @brief Gets the attribute identifier from a reporting configuration response record.
3029  * @details The attribute identifier field is 16 bits in length and shall contain the
3030  * identifier of the attribute that the reporting configuration details apply to.
3031  *
3032  * @since_tizen 4.0
3033  *
3034  * @param[in] handle The handle of write attribute status record
3035  * @param[out] id Attribute identifier
3036  *
3037  * @return 0 on success, otherwise a negative error value.
3038  * @retval #ZIGBEE_ERROR_NONE Successful
3039  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3040  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3041  *
3042  * @see zb_zcl_global_config_report_write_cb()
3043  * @see zb_report_config_response_record_clone()
3044  * @see zb_report_config_response_record_destroy()
3045  * @see zb_report_config_response_record_get_status()
3046  * @see zb_report_config_response_record_get_dir()
3047  * @see zb_report_config_response_record_get_id()
3048  */
3049 int zb_report_config_response_record_get_id(
3050                 zb_zcl_report_config_response_record_h handle,
3051                 zb_attribute_id *id);
3052
3053 /**
3054  * @brief Called with configure reporting response.
3055  * @details This callback is called after #zb_zcl_global_config_report_write() is called.
3056  *
3057  * @since_tizen 4.0
3058  *
3059  * @remarks The @a records can be used only in the callback.
3060  * @remarks The @a records should not be released.
3061  *
3062  * @param[out] addr16 The source network address
3063  * @param[out] ep The source from which the response was sent (ex. 1)
3064  * @param[out] clusterid ZCL cluster id
3065  * @param[out] records Reporting configuration response record
3066  * @param[out] count The number of reporting configuration response record
3067  * @param[out] user_data User data
3068  *
3069  * @see zb_zcl_global_config_report_write()
3070  */
3071 typedef void (*zb_zcl_global_config_report_write_cb)(
3072                 zb_nwk_addr addr16,
3073                 zb_end_point ep,
3074                 zb_cluster_id clusterid,
3075                 zb_zcl_report_config_response_record_h *records,
3076                 int count,
3077                 void *user_data);
3078
3079 /**
3080  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3081  * @brief Creates a reporting configuration record.
3082  * @details Allocate memory for reporting configuration record
3083  *
3084  * @since_tizen 4.0
3085  * @privlevel public
3086  * @privilege %http://tizen.org/privilege/zigbee
3087  *
3088  * @remarks The @a handle should be released using zb_report_config_record_destroy().
3089  *
3090  * @param[out] handle The handle of reporting configuration record
3091  *
3092  * @return 0 on success, otherwise a negative error value.
3093  * @retval #ZIGBEE_ERROR_NONE Successful
3094  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3095  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
3096  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
3097  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3098  *
3099  * @see zb_zcl_global_read_report_config_cb()
3100  * @see zb_report_config_record_clone()
3101  * @see zb_report_config_record_destroy()
3102  * @see zb_report_config_record_get_id()
3103  * @see zb_report_config_record_set_id()
3104  * @see zb_report_config_record_get_dir()
3105  * @see zb_report_config_record_set_dir()
3106  * @see zb_report_config_record_get_type()
3107  * @see zb_report_config_record_get_min_interval()
3108  * @see zb_report_config_record_set_min_interval()
3109  * @see zb_report_config_record_get_max_interval()
3110  * @see zb_report_config_record_set_max_interval()
3111  * @see zb_report_config_record_get_change()
3112  * @see zb_report_config_record_set_change()
3113  * @see zb_report_config_record_get_timeout()
3114  * @see zb_report_config_record_set_timeout()
3115  */
3116 int zb_report_config_record_create(zb_zcl_reporting_config_record_h *handle);
3117
3118 /**
3119  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3120  * @brief Clones a reporting configuration record.
3121  *
3122  * @since_tizen 4.0
3123  *
3124  * @remarks The @a dst should be released using zb_report_config_record_destroy().
3125  *
3126  * @param[in] src Source handle of reporting configuration record
3127  * @param[in] dst Destination handle of reporting configuration record
3128  *
3129  * @return 0 on success, otherwise a negative error value.
3130  * @retval #ZIGBEE_ERROR_NONE Successful
3131  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3132  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3133  *
3134  * @see zb_zcl_global_read_report_config_cb()
3135  * @see zb_report_config_record_create()
3136  * @see zb_report_config_record_destroy()
3137  * @see zb_report_config_record_get_id()
3138  * @see zb_report_config_record_set_id()
3139  * @see zb_report_config_record_get_dir()
3140  * @see zb_report_config_record_set_dir()
3141  * @see zb_report_config_record_get_type()
3142  * @see zb_report_config_record_get_min_interval()
3143  * @see zb_report_config_record_set_min_interval()
3144  * @see zb_report_config_record_get_max_interval()
3145  * @see zb_report_config_record_set_max_interval()
3146  * @see zb_report_config_record_get_change()
3147  * @see zb_report_config_record_set_change()
3148  * @see zb_report_config_record_get_timeout()
3149  * @see zb_report_config_record_set_timeout()
3150  */
3151 int zb_report_config_record_clone(zb_zcl_reporting_config_record_h src,
3152                 zb_zcl_reporting_config_record_h *dst);
3153
3154 /**
3155  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3156  * @brief Destroys a reporting configuration record.
3157  *
3158  * @since_tizen 4.0
3159  *
3160  * @param[in] handle The handle of reporting configuration record
3161  *
3162  * @return 0 on success, otherwise a negative error value.
3163  * @retval #ZIGBEE_ERROR_NONE Successful
3164  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3165  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3166  *
3167  * @see zb_zcl_global_read_report_config_cb()
3168  * @see zb_report_config_record_create()
3169  * @see zb_report_config_record_clone()
3170  * @see zb_report_config_record_get_id()
3171  * @see zb_report_config_record_set_id()
3172  * @see zb_report_config_record_get_dir()
3173  * @see zb_report_config_record_set_dir()
3174  * @see zb_report_config_record_get_type()
3175  * @see zb_report_config_record_get_min_interval()
3176  * @see zb_report_config_record_set_min_interval()
3177  * @see zb_report_config_record_get_max_interval()
3178  * @see zb_report_config_record_set_max_interval()
3179  * @see zb_report_config_record_get_change()
3180  * @see zb_report_config_record_set_change()
3181  * @see zb_report_config_record_get_timeout()
3182  * @see zb_report_config_record_set_timeout()
3183  */
3184 int zb_report_config_record_destroy(zb_zcl_reporting_config_record_h handle);
3185
3186 /**
3187  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3188  * @brief Gets the direction from a reporting configuration record.
3189  * @details The direction field specifies whether values of the attribute are be reported,
3190  * or whether reports of the attribute are to be received.
3191  *
3192  * If this value is set to 0x00, then the attribute data type field, the minimum
3193  * reporting interval field, the maximum reporting interval field and the reportable
3194  * change field are included in the payload, and the timeout period field is omitted.
3195  * The record is sent to a cluster server (or client) to configure how it sends reports to
3196  * a client (or server) of the same cluster.
3197  *
3198  * If this value is set to 0x01, then the timeout period field is included in the payload,
3199  * and the attribute data type field, the minimum reporting interval field, the
3200  * maximum reporting interval field and the reportable change field are omitted. The
3201  * record is sent to a cluster client (or server) to configure how it should expect
3202  * reports from a server (or client) of the same cluster.
3203  *
3204  * @since_tizen 4.0
3205  *
3206  * @param[in] handle The handle of write attribute status record
3207  * @param[out] dir 00 : The receiver of the Configure Reporting command shall configure
3208  *                     reporting to send to each destination as resolved by
3209  *                   the bindings for the cluster hosting the attributes to be reported.\n
3210  *                 01 : This indicates to the receiver of the Configure Reporting
3211  *                     command that the sender has configured its reporting
3212  *                     mechanism to transmit reports and that, based on the current
3213  *                     state of the sender's bindings, the sender will send reports to the
3214  *                     receiver.\n
3215  *
3216  * @return 0 on success, otherwise a negative error value.
3217  * @retval #ZIGBEE_ERROR_NONE Successful
3218  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3219  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3220  *
3221  * @see zb_zcl_global_read_report_config_cb()
3222  * @see zb_report_config_record_create()
3223  * @see zb_report_config_record_clone()
3224  * @see zb_report_config_record_destroy()
3225  * @see zb_report_config_record_get_id()
3226  * @see zb_report_config_record_set_id()
3227  * @see zb_report_config_record_set_dir()
3228  * @see zb_report_config_record_get_type()
3229  * @see zb_report_config_record_get_min_interval()
3230  * @see zb_report_config_record_set_min_interval()
3231  * @see zb_report_config_record_get_max_interval()
3232  * @see zb_report_config_record_set_max_interval()
3233  * @see zb_report_config_record_get_change()
3234  * @see zb_report_config_record_set_change()
3235  * @see zb_report_config_record_get_timeout()
3236  * @see zb_report_config_record_set_timeout()
3237  */
3238 int zb_report_config_record_get_dir(zb_zcl_reporting_config_record_h handle,
3239                 zb_zcl_fc_direction_e *dir);
3240
3241 /**
3242  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3243  * @brief Sets the direction of a reporting configuration record.
3244  * @details The direction field specifies whether values of the attribute are be reported,
3245  * or whether reports of the attribute are to be received.
3246  *
3247  * If this value is set to 0x00, then the attribute data type field, the minimum
3248  * reporting interval field, the maximum reporting interval field and the reportable
3249  * change field are included in the payload, and the timeout period field is omitted.
3250  * The record is sent to a cluster server (or client) to configure how it sends reports to
3251  * a client (or server) of the same cluster.
3252  *
3253  * If this value is set to 0x01, then the timeout period field is included in the payload,
3254  * and the attribute data type field, the minimum reporting interval field, the
3255  * maximum reporting interval field and the reportable change field are omitted. The
3256  * record is sent to a cluster client (or server) to configure how it should expect
3257  * reports from a server (or client) of the same cluster.
3258  *
3259  * @since_tizen 4.0
3260  *
3261  * @param[in] handle The handle of write attribute status record
3262  * @param[in] dir 00 : The receiver of the Configure Reporting command shall configure
3263  *                     reporting to send to each destination as resolved by
3264  *                   the bindings for the cluster hosting the attributes to be reported.\n
3265  *                01 : This indicates to the receiver of the Configure Reporting
3266  *                     command that the sender has configured its reporting
3267  *                     mechanism to transmit reports and that, based on the current
3268  *                     state of the sender's bindings, the sender will send reports to the
3269  *                     receiver.\n
3270  *
3271  * @return 0 on success, otherwise a negative error value.
3272  * @retval #ZIGBEE_ERROR_NONE Successful
3273  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3274  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3275  *
3276  * @see zb_zcl_global_read_report_config_cb()
3277  * @see zb_report_config_record_create()
3278  * @see zb_report_config_record_clone()
3279  * @see zb_report_config_record_destroy()
3280  * @see zb_report_config_record_get_id()
3281  * @see zb_report_config_record_set_id()
3282  * @see zb_report_config_record_get_dir()
3283  * @see zb_report_config_record_get_type()
3284  * @see zb_report_config_record_get_min_interval()
3285  * @see zb_report_config_record_set_min_interval()
3286  * @see zb_report_config_record_get_max_interval()
3287  * @see zb_report_config_record_set_max_interval()
3288  * @see zb_report_config_record_get_change()
3289  * @see zb_report_config_record_set_change()
3290  * @see zb_report_config_record_get_timeout()
3291  * @see zb_report_config_record_set_timeout()
3292  */
3293 int zb_report_config_record_set_dir(zb_zcl_reporting_config_record_h handle,
3294                 zb_zcl_fc_direction_e dir);
3295
3296 /**
3297  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3298  * @brief Gets the attribute identifier from a reporting configuration record.
3299  * @details If the direction field is 0x00, this field contains the identifier of the
3300  * attribute that is to be reported.
3301  *
3302  * If instead the direction field is 0x01, the device shall expect reports of values
3303  * of this attribute.
3304  *
3305  * @since_tizen 4.0
3306  *
3307  * @param[in] handle The handle of write attribute status record
3308  * @param[out] id Attribute identifier
3309  *
3310  * @return 0 on success, otherwise a negative error value.
3311  * @retval #ZIGBEE_ERROR_NONE Successful
3312  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3313  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3314  *
3315  * @see zb_zcl_global_read_report_config_cb()
3316  * @see zb_report_config_record_create()
3317  * @see zb_report_config_record_clone()
3318  * @see zb_report_config_record_destroy()
3319  * @see zb_report_config_record_set_id()
3320  * @see zb_report_config_record_get_dir()
3321  * @see zb_report_config_record_set_dir()
3322  * @see zb_report_config_record_get_type()
3323  * @see zb_report_config_record_get_min_interval()
3324  * @see zb_report_config_record_set_min_interval()
3325  * @see zb_report_config_record_get_max_interval()
3326  * @see zb_report_config_record_set_max_interval()
3327  * @see zb_report_config_record_get_change()
3328  * @see zb_report_config_record_set_change()
3329  * @see zb_report_config_record_get_timeout()
3330  * @see zb_report_config_record_set_timeout()
3331  */
3332 int zb_report_config_record_get_id(zb_zcl_reporting_config_record_h handle,
3333                 unsigned short *id);
3334
3335 /**
3336  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3337  * @brief Sets the attribute identifier of a reporting configuration record.
3338  * @details If the direction field is 0x00, this field contains the identifier of the
3339  * attribute that is to be reported.
3340  *
3341  * If instead the direction field is 0x01, the device shall expect reports of values
3342  * of this attribute.
3343  *
3344  * @since_tizen 4.0
3345  *
3346  * @param[in] handle The handle of write attribute status record
3347  * @param[in] id Attribute identifier
3348  *
3349  * @return 0 on success, otherwise a negative error value.
3350  * @retval #ZIGBEE_ERROR_NONE Successful
3351  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3352  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3353  *
3354  * @see zb_zcl_global_read_report_config_cb()
3355  * @see zb_report_config_record_create()
3356  * @see zb_report_config_record_clone()
3357  * @see zb_report_config_record_destroy()
3358  * @see zb_report_config_record_get_id()
3359  * @see zb_report_config_record_get_dir()
3360  * @see zb_report_config_record_set_dir()
3361  * @see zb_report_config_record_get_type()
3362  * @see zb_report_config_record_get_min_interval()
3363  * @see zb_report_config_record_set_min_interval()
3364  * @see zb_report_config_record_get_max_interval()
3365  * @see zb_report_config_record_set_max_interval()
3366  * @see zb_report_config_record_get_change()
3367  * @see zb_report_config_record_set_change()
3368  * @see zb_report_config_record_get_timeout()
3369  * @see zb_report_config_record_set_timeout()
3370  */
3371 int zb_report_config_record_set_id(zb_zcl_reporting_config_record_h handle,
3372                 unsigned short id);
3373
3374 /**
3375  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3376  * @brief Gets the attribute data type from a reporting configuration record.
3377  * @details The Attribute data type field contains the data type of the attribute that is
3378  * to be reported.
3379  *
3380  * @since_tizen 4.0
3381  *
3382  * @param[in] handle The handle of write attribute status record
3383  * @param[out] type attribute data type
3384  *
3385  * @return 0 on success, otherwise a negative error value.
3386  * @retval #ZIGBEE_ERROR_NONE Successful
3387  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3388  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3389  *
3390  * @see zb_zcl_global_read_report_config_cb()
3391  * @see zb_report_config_record_create()
3392  * @see zb_report_config_record_clone()
3393  * @see zb_report_config_record_destroy()
3394  * @see zb_report_config_record_get_id()
3395  * @see zb_report_config_record_set_id()
3396  * @see zb_report_config_record_get_dir()
3397  * @see zb_report_config_record_set_dir()
3398  * @see zb_report_config_record_get_min_interval()
3399  * @see zb_report_config_record_set_min_interval()
3400  * @see zb_report_config_record_get_max_interval()
3401  * @see zb_report_config_record_set_max_interval()
3402  * @see zb_report_config_record_get_change()
3403  * @see zb_report_config_record_set_change()
3404  * @see zb_report_config_record_get_timeout()
3405  * @see zb_report_config_record_set_timeout()
3406  */
3407 int zb_report_config_record_get_type(zb_zcl_reporting_config_record_h handle,
3408                 zb_zcl_data_type_e *type);
3409
3410 /**
3411  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3412  * @brief Gets the minimum interval from a reporting configuration record.
3413  * @details The minimum reporting interval field is 16 bits in length and shall contain
3414  * the minimum interval, in seconds, between issuing reports of the specified attribute.
3415  *
3416  * If this value is set to 0x0000, then there is no minimum limit, unless one is
3417  * imposed by the specification of the cluster using this reporting mechanism or by
3418  * the applicable profile.
3419  *
3420  * @since_tizen 4.0
3421  *
3422  * @param[in] handle The handle of write attribute status record
3423  * @param[out] min_i minimum interval time
3424  *
3425  * @return 0 on success, otherwise a negative error value.
3426  * @retval #ZIGBEE_ERROR_NONE Successful
3427  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3428  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3429  *
3430  * @see zb_zcl_global_read_report_config_cb()
3431  * @see zb_report_config_record_create()
3432  * @see zb_report_config_record_clone()
3433  * @see zb_report_config_record_destroy()
3434  * @see zb_report_config_record_get_id()
3435  * @see zb_report_config_record_set_id()
3436  * @see zb_report_config_record_get_dir()
3437  * @see zb_report_config_record_set_dir()
3438  * @see zb_report_config_record_set_min_interval()
3439  * @see zb_report_config_record_get_max_interval()
3440  * @see zb_report_config_record_set_max_interval()
3441  * @see zb_report_config_record_get_change()
3442  * @see zb_report_config_record_set_change()
3443  * @see zb_report_config_record_get_timeout()
3444  * @see zb_report_config_record_set_timeout()
3445  */
3446 int zb_report_config_record_get_min_interval(zb_zcl_reporting_config_record_h handle,
3447                 unsigned short *min_i);
3448
3449 /**
3450  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3451  * @brief Sets the minimum interval of a reporting configuration record.
3452  * @details The minimum reporting interval field is 16 bits in length and shall contain
3453  * the minimum interval, in seconds, between issuing reports of the specified attribute.
3454  *
3455  * If this value is set to 0x0000, then there is no minimum limit, unless one is
3456  * imposed by the specification of the cluster using this reporting mechanism or by
3457  * the applicable profile.
3458  *
3459  * @since_tizen 4.0
3460  *
3461  * @param[in] handle The handle of write attribute status record
3462  * @param[in] min_i minimum interval time
3463  *
3464  * @return 0 on success, otherwise a negative error value.
3465  * @retval #ZIGBEE_ERROR_NONE Successful
3466  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3467  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3468  *
3469  * @see zb_zcl_global_read_report_config_cb()
3470  * @see zb_report_config_record_create()
3471  * @see zb_report_config_record_clone()
3472  * @see zb_report_config_record_destroy()
3473  * @see zb_report_config_record_get_id()
3474  * @see zb_report_config_record_set_id()
3475  * @see zb_report_config_record_get_dir()
3476  * @see zb_report_config_record_set_dir()
3477  * @see zb_report_config_record_get_min_interval()
3478  * @see zb_report_config_record_get_max_interval()
3479  * @see zb_report_config_record_set_max_interval()
3480  * @see zb_report_config_record_get_change()
3481  * @see zb_report_config_record_set_change()
3482  * @see zb_report_config_record_get_timeout()
3483  * @see zb_report_config_record_set_timeout()
3484  */
3485 int zb_report_config_record_set_min_interval(zb_zcl_reporting_config_record_h handle,
3486                 unsigned short min_i);
3487
3488 /**
3489  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3490  * @brief Gets the maximum interval from a reporting configuration record.
3491  * @details The maximum reporting interval field is 16 bits in length and shall contain
3492  * the maximum interval, in seconds, between issuing reports of the specified attribute.
3493  *
3494  * If this value is set to 0xffff, then the device shall not issue reports for the
3495  * specified attribute, and the configuration information for that attribute need not be
3496  * maintained.
3497  *
3498  * @since_tizen 4.0
3499  *
3500  * @param[in] handle The handle of write attribute status record
3501  * @param[out] max_i maximum interval time
3502  *
3503  * @return 0 on success, otherwise a negative error value.
3504  * @retval #ZIGBEE_ERROR_NONE Successful
3505  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3506  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3507  *
3508  * @see zb_zcl_global_read_report_config_cb()
3509  * @see zb_report_config_record_create()
3510  * @see zb_report_config_record_clone()
3511  * @see zb_report_config_record_destroy()
3512  * @see zb_report_config_record_get_id()
3513  * @see zb_report_config_record_set_id()
3514  * @see zb_report_config_record_get_dir()
3515  * @see zb_report_config_record_set_dir()
3516  * @see zb_report_config_record_get_min_interval()
3517  * @see zb_report_config_record_set_min_interval()
3518  * @see zb_report_config_record_set_max_interval()
3519  * @see zb_report_config_record_get_change()
3520  * @see zb_report_config_record_set_change()
3521  * @see zb_report_config_record_get_timeout()
3522  * @see zb_report_config_record_set_timeout()
3523  */
3524 int zb_report_config_record_get_max_interval(zb_zcl_reporting_config_record_h handle,
3525                 unsigned short *max_i);
3526
3527 /**
3528  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3529  * @brief Sets the maximum interval of a reporting configuration record.
3530  * @details The maximum reporting interval field is 16 bits in length and shall contain
3531  * the maximum interval, in seconds, between issuing reports of the specified attribute.
3532  *
3533  * If this value is set to 0xffff, then the device shall not issue reports for the
3534  * specified attribute, and the configuration information for that attribute need not be
3535  * maintained.
3536  *
3537  * @since_tizen 4.0
3538  *
3539  * @param[in] handle The handle of write attribute status record
3540  * @param[in] max_i maximum interval time
3541  *
3542  * @return 0 on success, otherwise a negative error value.
3543  * @retval #ZIGBEE_ERROR_NONE Successful
3544  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3545  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3546  *
3547  * @see zb_zcl_global_read_report_config_cb()
3548  * @see zb_report_config_record_create()
3549  * @see zb_report_config_record_clone()
3550  * @see zb_report_config_record_destroy()
3551  * @see zb_report_config_record_get_id()
3552  * @see zb_report_config_record_set_id()
3553  * @see zb_report_config_record_get_dir()
3554  * @see zb_report_config_record_set_dir()
3555  * @see zb_report_config_record_get_min_interval()
3556  * @see zb_report_config_record_set_min_interval()
3557  * @see zb_report_config_record_get_max_interval()
3558  * @see zb_report_config_record_get_change()
3559  * @see zb_report_config_record_set_change()
3560  * @see zb_report_config_record_get_timeout()
3561  * @see zb_report_config_record_set_timeout()
3562  */
3563 int zb_report_config_record_set_max_interval(zb_zcl_reporting_config_record_h handle,
3564                 unsigned short max_i);
3565
3566 /**
3567  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3568  * @brief Gets the timeout from a reporting configuration record.
3569  * @details The timeout period field is 16 bits in length and shall contain the maximum
3570  * expected time, in seconds, between received reports for the attribute specified in
3571  * the attribute identifier field. If more time than this elapses between reports, this
3572  * may be an indication that there is a problem with reporting.
3573  *
3574  * If this value is set to 0x0000, reports of the attribute are not subject to timeout.
3575  * Note that, for a server/client connection to work properly using automatic
3576  * reporting, the timeout value set for attribute reports to be received by the client (or
3577  * server) cluster must be set somewhat higher than the maximum reporting interval
3578  * set for the attribute on the server (or client) cluster.
3579  *
3580  * @since_tizen 4.0
3581  *
3582  * @param[in] handle The handle of write attribute status record
3583  * @param[out] timeout timeout
3584  *
3585  * @return 0 on success, otherwise a negative error value.
3586  * @retval #ZIGBEE_ERROR_NONE Successful
3587  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3588  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3589  *
3590  * @see zb_zcl_global_read_report_config_cb()
3591  * @see zb_report_config_record_create()
3592  * @see zb_report_config_record_clone()
3593  * @see zb_report_config_record_destroy()
3594  * @see zb_report_config_record_get_id()
3595  * @see zb_report_config_record_set_id()
3596  * @see zb_report_config_record_get_dir()
3597  * @see zb_report_config_record_set_dir()
3598  * @see zb_report_config_record_get_min_interval()
3599  * @see zb_report_config_record_set_min_interval()
3600  * @see zb_report_config_record_get_max_interval()
3601  * @see zb_report_config_record_set_max_interval()
3602  * @see zb_report_config_record_get_change()
3603  * @see zb_report_config_record_set_change()
3604  * @see zb_report_config_record_set_timeout()
3605  */
3606 int zb_report_config_record_get_timeout(zb_zcl_reporting_config_record_h handle,
3607                 unsigned short *timeout);
3608
3609 /**
3610  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3611  * @brief Sets the timeout of a reporting configuration record.
3612  * @details The timeout period field is 16 bits in length and shall contain the maximum
3613  * expected time, in seconds, between received reports for the attribute specified in
3614  * the attribute identifier field. If more time than this elapses between reports, this
3615  * may be an indication that there is a problem with reporting.
3616  *
3617  * If this value is set to 0x0000, reports of the attribute are not subject to timeout.
3618  * Note that, for a server/client connection to work properly using automatic
3619  * reporting, the timeout value set for attribute reports to be received by the client (or
3620  * server) cluster must be set somewhat higher than the maximum reporting interval
3621  * set for the attribute on the server (or client) cluster.
3622  *
3623  * @since_tizen 4.0
3624  *
3625  * @param[in] handle The handle of write attribute status record
3626  * @param[in] timeout timeout
3627  *
3628  * @return 0 on success, otherwise a negative error value.
3629  * @retval #ZIGBEE_ERROR_NONE Successful
3630  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3631  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3632  *
3633  * @see zb_zcl_global_read_report_config_cb()
3634  * @see zb_report_config_record_create()
3635  * @see zb_report_config_record_clone()
3636  * @see zb_report_config_record_destroy()
3637  * @see zb_report_config_record_get_id()
3638  * @see zb_report_config_record_set_id()
3639  * @see zb_report_config_record_get_dir()
3640  * @see zb_report_config_record_set_dir()
3641  * @see zb_report_config_record_get_min_interval()
3642  * @see zb_report_config_record_set_min_interval()
3643  * @see zb_report_config_record_get_max_interval()
3644  * @see zb_report_config_record_set_max_interval()
3645  * @see zb_report_config_record_get_change()
3646  * @see zb_report_config_record_set_change()
3647  * @see zb_report_config_record_get_timeout()
3648  */
3649 int zb_report_config_record_set_timeout(zb_zcl_reporting_config_record_h handle,
3650                 unsigned short timeout);
3651
3652 /**
3653  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3654  * @brief Gets the change from a reporting configuration record.
3655  * @details The reportable change field shall contain the minimum change to the attribute
3656  * that will result in a report being issued. This field is of variable length.
3657  *
3658  * For attributes with 'analog' data type
3659  * the field has the same data type as the attribute.
3660  *
3661  * The sign (if any) of the reportable change field is ignored.
3662  * For attributes of 'discrete' data type
3663  * this field is omitted.
3664  *
3665  * @since_tizen 4.0
3666  *
3667  * @remarks The @a value should be released using free().
3668  *
3669  * @param[in] handle The handle of write attribute status record
3670  * @param[out] type attribute type The attribute data type shall contain the data
3671  *  type of the attribute in the same read attributes status record
3672  *  (see #zb_zcl_data_type_e).
3673  * @param[out] value The reportable change value. The reportable change field shall
3674  *  contain the minimum change to the attribute that will result in a report being issued.
3675  *  For attributes with 'analog' data type (see #zb_zcl_data_type_e) the field has the
3676  *  same data type as the attribute. If the reportable change has not been configured,
3677  *  this field shall contain the invalid value for the relevant data type.
3678  *  For attributes of 'discrete' data type (see #zb_zcl_data_type_e) this field is not
3679  *  permitted.
3680  * @param[out] size attribute data size
3681  *
3682  * @return 0 on success, otherwise a negative error value.
3683  * @retval #ZIGBEE_ERROR_NONE Successful
3684  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3685  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3686  *
3687  * @see zb_zcl_global_read_report_config_cb()
3688  * @see zb_report_config_record_create()
3689  * @see zb_report_config_record_clone()
3690  * @see zb_report_config_record_destroy()
3691  * @see zb_report_config_record_get_id()
3692  * @see zb_report_config_record_set_id()
3693  * @see zb_report_config_record_get_dir()
3694  * @see zb_report_config_record_set_dir()
3695  * @see zb_report_config_record_get_min_interval()
3696  * @see zb_report_config_record_set_min_interval()
3697  * @see zb_report_config_record_get_max_interval()
3698  * @see zb_report_config_record_set_max_interval()
3699  * @see zb_report_config_record_get_change()
3700  * @see zb_report_config_record_set_change()
3701  * @see zb_report_config_record_get_timeout()
3702  * @see zb_report_config_record_set_timeout()
3703  */
3704 int zb_report_config_record_get_change(zb_zcl_reporting_config_record_h handle,
3705                 zb_zcl_data_type_e *type, unsigned char **value, int *size);
3706
3707 /**
3708  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RECORD_MODULE
3709  * @brief Sets the change to a reporting configuration record.
3710  * @details The reportable change field shall contain the minimum change to the attribute
3711  * that will result in a report being issued. This field is of variable length.
3712  * For attributes with 'analog' data type
3713  * the field has the same data type as the attribute.
3714  *
3715  * The sign (if any) of the reportable change field is ignored.
3716  * For attributes of 'discrete' data type
3717  * this field is omitted.
3718  *
3719  * @since_tizen 4.0
3720  *
3721  * @param[in] handle The handle of write attribute status record
3722  * @param[in] type attribute type
3723  * @param[in] value attribute data (only analog data type is allowed)
3724  *
3725  * @return 0 on success, otherwise a negative error value.
3726  * @retval #ZIGBEE_ERROR_NONE Successful
3727  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3728  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3729  *
3730  * @see zb_zcl_global_read_report_config_cb()
3731  * @see zb_report_config_record_create()
3732  * @see zb_report_config_record_clone()
3733  * @see zb_report_config_record_destroy()
3734  * @see zb_report_config_record_get_id()
3735  * @see zb_report_config_record_set_id()
3736  * @see zb_report_config_record_get_dir()
3737  * @see zb_report_config_record_set_dir()
3738  * @see zb_report_config_record_get_type()
3739  * @see zb_report_config_record_get_min_interval()
3740  * @see zb_report_config_record_set_min_interval()
3741  * @see zb_report_config_record_get_max_interval()
3742  * @see zb_report_config_record_set_max_interval()
3743  * @see zb_report_config_record_get_change()
3744  * @see zb_report_config_record_set_change()
3745  * @see zb_report_config_record_get_timeout()
3746  * @see zb_report_config_record_set_timeout()
3747  */
3748 int zb_report_config_record_set_change(zb_zcl_reporting_config_record_h handle,
3749                 zb_zcl_data_type_e type, unsigned char *value);
3750
3751 /**
3752  * @brief Sends 'setting configure reporting' command.
3753  * @details Call this function to set the configuration of attribute status changing reporting.
3754  *
3755  * @since_tizen 4.0
3756  * @privlevel public
3757  * @privilege %http://tizen.org/privilege/zigbee
3758  *
3759  * @param[in] handle The handle of zigbee
3760  * @param[in] addr16 target network address
3761  * @param[in] src_ep source end-point (ex. 1)
3762  * @param[in] dst_ep destination end-point (ex. 1)
3763  * @param[in] zcl_fc frame control bits (default 0x00). \n
3764  *            Only OR operation is allowed in ZCL header \n
3765  *            - Frame Type : \n
3766  *            #ZB_ZCL_FC_GLOBALLY_USED (default) \n
3767  *            #ZB_APS_FC_CLUSTER_SPECIFIC \n
3768  *            - Manufacturer Specific : \n
3769  *            - Direction : \n
3770  *            #ZB_ZCL_CLIENT_TO_SERVER (default) \n
3771  *            #ZB_ZCL_SERVER_TO_CLIENT \n
3772  *            - Disable Default Response : \n
3773  *            #ZB_ZCL_DEFAULT_RESPONSE_ENABLED (default) \n
3774  *            #ZB_ZCL_DEFAULT_RESPONSE_DISABLED \n
3775  * @param[in] clusterid ZCL cluster id
3776  * @param[in] records Array of #zb_zcl_reporting_config_record_h
3777  * @param[in] count The number of items in @a records array
3778  * @param[in] cb Response callback function
3779  * @param[in] user_data User data
3780  *
3781  * @return 0 on success, otherwise a negative error value.
3782  * @retval #ZIGBEE_ERROR_NONE Successful
3783  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3784  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
3785  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
3786  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
3787  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
3788  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3789  *
3790  * @see zb_zcl_global_config_report_write_cb()
3791  */
3792 int zb_zcl_global_config_report_write(
3793                 zb_zigbee_h handle,
3794                 zb_nwk_addr addr16,
3795                 zb_end_point src_ep,
3796                 zb_end_point dst_ep,
3797                 zb_zcl_frame_ctl zcl_fc,
3798                 zb_cluster_id clusterid,
3799                 zb_zcl_reporting_config_record_h *records,
3800                 int count,
3801                 zb_zcl_global_config_report_write_cb cb,
3802                 void *user_data);
3803
3804
3805 /**
3806  * @brief Called with a configuration report.
3807  * @details This callback is called after zb_zcl_global_config_report_read() is called.
3808  *
3809  * @since_tizen 4.0
3810  *
3811  * @remarks The @a records can be used only in the callback.
3812  * @remarks The @a records should not be released.
3813  *
3814  * @param[out] addr16 Source network address
3815  * @param[out] ep The source end-point (ex. 1)
3816  * @param[out] clusterid ZCL cluster id
3817  * @param[out] records Read reporting configuration response record
3818  * @param[out] count The number of items in @a records
3819  * @param[out] user_data User data
3820  *
3821  * @see zb_zcl_global_config_report_read()
3822  */
3823 typedef void (*zb_zcl_global_config_report_read_cb)(
3824                 zb_nwk_addr addr16,
3825                 zb_end_point ep,
3826                 zb_cluster_id clusterid,
3827                 zb_zcl_reporting_config_record_h *records,
3828                 int count,
3829                 void *user_data);
3830
3831 /**
3832  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_REPORTING_CONFIG_RECORD_MODULE
3833  * @brief Creates a read reporting configuration record.
3834  * @details Allocates memory for read reporting configuration record.
3835  *
3836  * @since_tizen 4.0
3837  * @privlevel public
3838  * @privilege %http://tizen.org/privilege/zigbee
3839  *
3840  * @remarks The @a handle should be released using zb_read_report_config_record_destroy().
3841  *
3842  * @param[out] handle The handle of read configuration record
3843  *
3844  * @return 0 on success, otherwise a negative error value.
3845  * @retval #ZIGBEE_ERROR_NONE Successful
3846  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3847  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
3848  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
3849  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3850  *
3851  * @see zb_read_report_config_record_create()
3852  * @see zb_read_report_config_record_destroy()
3853  * @see zb_read_report_config_record_set_id()
3854  * @see zb_read_report_config_record_set_dir()
3855  */
3856 int zb_read_report_config_record_create(
3857                 zb_zcl_read_report_config_record_h *handle);
3858
3859 /**
3860  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_REPORTING_CONFIG_RECORD_MODULE
3861  * @brief Destroys a read reporting configuration record.
3862  * @details Removes allocated memory for read reporting configuration record.
3863  *
3864  * @since_tizen 4.0
3865  *
3866  * @param[in] handle The handle of write attribute record
3867  *
3868  * @return 0 on success, otherwise a negative error value.
3869  * @retval #ZIGBEE_ERROR_NONE Successful
3870  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3871  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3872  *
3873  * @see zb_read_report_config_record_create()
3874  * @see zb_read_report_config_record_destroy()
3875  * @see zb_read_report_config_record_set_id()
3876  * @see zb_read_report_config_record_set_dir()
3877  */
3878 int zb_read_report_config_record_destroy(
3879                 zb_zcl_read_report_config_record_h handle);
3880
3881 /**
3882  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_REPORTING_CONFIG_RECORD_MODULE
3883  * @brief Sets the direction of a read reporting configuration record.
3884  * @details The direction field specifies whether values of the attribute are reported
3885  * (0x00), or whether reports of the attribute are received (0x01).
3886  *
3887  * All other values of this field are reserved.
3888  *
3889  * @since_tizen 4.0
3890  *
3891  * @param[in] handle The handle of write attribute status record
3892  * @param[in] dir direction
3893  *
3894  * @return 0 on success, otherwise a negative error value.
3895  * @retval #ZIGBEE_ERROR_NONE Successful
3896  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3897  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3898  *
3899  * @see zb_read_report_config_record_create()
3900  * @see zb_read_report_config_record_destroy()
3901  * @see zb_read_report_config_record_set_id()
3902  * @see zb_read_report_config_record_set_dir()
3903  */
3904 int zb_read_report_config_record_set_dir(
3905                 zb_zcl_read_report_config_record_h handle,
3906                 zb_zcl_fc_direction_e dir);
3907
3908 /**
3909  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_READ_REPORTING_CONFIG_RECORD_MODULE
3910  * @brief Sets the attribute identifier of a read reporting configuration record.
3911  * @details The attribute identifier field shall contain the identifier of the attribute
3912  * whose reporting configuration details are to be read.
3913  *
3914  * @since_tizen 4.0
3915  *
3916  * @param[in] handle The handle of write attribute status record
3917  * @param[in] id Attribute identifier
3918  *
3919  * @return 0 on success, otherwise a negative error value.
3920  * @retval #ZIGBEE_ERROR_NONE Successful
3921  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3922  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3923  *
3924  * @see zb_read_report_config_record_create()
3925  * @see zb_read_report_config_record_destroy()
3926  * @see zb_read_report_config_record_set_id()
3927  * @see zb_read_report_config_record_set_dir()
3928  */
3929 int zb_read_report_config_record_set_id(
3930                 zb_zcl_read_report_config_record_h handle,
3931                 unsigned short id);
3932
3933 /**
3934  * @brief Sends 'reading configure reporting' command.
3935  * @details Call this function to read the configuration of attribute status changing
3936  * reporting.
3937  *
3938  * @since_tizen 4.0
3939  * @privlevel public
3940  * @privilege %http://tizen.org/privilege/zigbee
3941  *
3942  * @param[in] handle The handle of zigbee
3943  * @param[in] addr16 target network address
3944  * @param[in] src_ep source end-point (ex. 1)
3945  * @param[in] dst_ep destination end-point (ex. 1)
3946  * @param[in] zcl_fc frame control bits (default 0x00). \n
3947  *            Only OR operation is allowed in ZCL header \n
3948  *            - Frame Type : \n
3949  *            #ZB_ZCL_FC_GLOBALLY_USED (default) \n
3950  *            #ZB_APS_FC_CLUSTER_SPECIFIC \n
3951  *            - Manufacturer Specific : \n
3952  *            - Direction : \n
3953  *            #ZB_ZCL_CLIENT_TO_SERVER (default) \n
3954  *            #ZB_ZCL_SERVER_TO_CLIENT \n
3955  *            - Disable Default Response : \n
3956  *            #ZB_ZCL_DEFAULT_RESPONSE_ENABLED (default) \n
3957  *            #ZB_ZCL_DEFAULT_RESPONSE_DISABLED \n
3958  * @param[in] clusterid ZCL cluster id
3959  * @param[in] records Array of #zb_zcl_read_report_config_record_h
3960  * @param[in] count The number of items in @a records array
3961  * @param[in] cb Response callback function
3962  * @param[in] user_data User data
3963  *
3964  * @return 0 on success, otherwise a negative error value.
3965  * @retval #ZIGBEE_ERROR_NONE Successful
3966  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
3967  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
3968  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
3969  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
3970  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
3971  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
3972  *
3973  * @see zb_zcl_global_config_report_read_cb()
3974  */
3975 int zb_zcl_global_config_report_read(
3976                 zb_zigbee_h handle,
3977                 zb_nwk_addr addr16,
3978                 zb_end_point src_ep,
3979                 zb_end_point dst_ep,
3980                 zb_zcl_frame_ctl zcl_fc,
3981                 zb_cluster_id clusterid,
3982                 zb_zcl_read_report_config_record_h *records,
3983                 int count,
3984                 zb_zcl_global_config_report_read_cb cb,
3985                 void *user_data);
3986
3987 /**
3988  * @}
3989  */
3990
3991 /**
3992  * @addtogroup CAPI_NETWORK_ZIGBEE_ZCL_IAS_ZONE_CLUSTER_MODULE
3993  *
3994  * @{
3995  */
3996
3997 /* Generated Command IDs for the IAS Zone Cluster in Zigbee Cluster Library
3998  * +--------------------------------+--------------------------------------+------------+
3999  * |Command Identifier Field Value  |              Description             | Mandatory/ |
4000  * |                                |                                      | Optional   |
4001  * +--------------------------------+--------------------------------------+------------+
4002  * |             0x00               | Zone Status Change Notification      |     M      |
4003  * |             0x01               | Zone Enroll Request                  |     M      |
4004  * |             0x11               | Zone Status Change Notification (Ext)|     M      |
4005  * +--------------------------------+--------------------------------------+------------+
4006  */
4007
4008
4009 /* Received Command IDs for the IAS Zone Cluster in Zigbee Cluster Library
4010  * +--------------------------------+--------------------------------------+------------+
4011  * |Command Identifier Field Value  |              Description             | Mandatory/ |
4012  * |                                |                                      | Optional   |
4013  * +--------------------------------+--------------------------------------+------------+
4014  * |             0x00               | Zone Enroll Response                 |     M      |
4015  * +--------------------------------+--------------------------------------+------------+
4016  */
4017
4018 /**
4019  * @brief Values of the Enroll Response Code in Zigbee Cluster Library.
4020  *
4021  * @since_tizen 4.0
4022  */
4023 typedef enum {
4024         ZB_ZCL_IAS_ZONE_ENROLL_SUCCESS = 0x00, /**< Success */
4025         ZB_ZCL_IAS_ZONE_ENROLL_NOT_SUPPORTED = 0x01, /**< This specific Zone type is not known to the CIE and is not supported */
4026         ZB_ZCL_IAS_ZONE_ENROLL_NO_ENROLL_PERMITTED = 0x02, /**< CIE does not permit new zones to enroll at this time. */
4027         ZB_ZCL_IAS_ZONE_ENROLL_TOO_MANY_ZONES = 0x03, /**< CIE reached its limit of number of enrolled zones */
4028 } zb_ias_zone_enroll_response_e;
4029
4030 /**
4031  * @brief Sends 'zone enroll response' command.
4032  * @details On receipt, the device embodying the Zone server is notified that it is now
4033  * enrolled as an active alarm device.
4034  *
4035  * The device embodying the Zone server must authenticate received messages by
4036  * checking the address of their sender against IAS_CIE_Address. This is to ensure
4037  * that only messages from the correct CIE are accepted.
4038  *
4039  * @since_tizen 4.0
4040  * @privlevel public
4041  * @privilege %http://tizen.org/privilege/zigbee
4042  *
4043  * @param[in] handle The handle of zigbee
4044  * @param[in] addr16 Network address
4045  * @param[in] ep Endpoint ID
4046  * @param[in] enroll_response_code #ZB_ZCL_IAS_ZONE_ENROLL_SUCCESS \n
4047  *                                 #ZB_ZCL_IAS_ZONE_ENROLL_NOT_SUPPORTED \n
4048  *                                 #ZB_ZCL_IAS_ZONE_ENROLL_NO_ENROLL_PERMITTED \n
4049  *                                 #ZB_ZCL_IAS_ZONE_ENROLL_TOO_MANY_ZONES \n
4050  * @param[in] zone_id The Zone ID field is the index into the zone table of the CIE. This
4051  *                    field is only relevant if the response code is success.
4052  *
4053  * @return 0 on success, otherwise a negative error value.
4054  * @retval #ZIGBEE_ERROR_NONE Successful
4055  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
4056  * @retval #ZIGBEE_ERROR_INVALID_ENDPOINT Invalid endpoint. 0 is reserved for ZDP
4057  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
4058  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
4059  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
4060  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
4061  *
4062  */
4063 int zb_zcl_zone_enroll_response(
4064                 zb_zigbee_h handle,
4065                 zb_nwk_addr addr16,
4066                 zb_end_point ep,
4067                 unsigned char enroll_response_code,
4068                 unsigned char zone_id);
4069
4070 /**
4071  * @}
4072  */
4073
4074 /**
4075  * @addtogroup CAPI_NETWORK_ZIGBEE_ZCL_ON_OFF_CLUSTER_MODULE
4076  *
4077  * @{
4078  */
4079
4080 /* Command IDs for the On/Off Cluster in Zigbee Cluster Library
4081  * +--------------------------------+--------------------------------------+------------+
4082  * |Command Identifier Field Value  |              Description             | Mandatory/ |
4083  * |                                |                                      | Optional   |
4084  * +--------------------------------+--------------------------------------+------------+
4085  * |             0x00               | Off                                  |     M      |
4086  * |             0x01               | On                                   |     M      |
4087  * |             0x02               | Toggle                               |     M      |
4088  * +--------------------------------+--------------------------------------+------------+
4089  */
4090
4091 /**
4092  * @brief On/Off/Toggle value.
4093  *
4094  * @since_tizen 4.0
4095  */
4096 typedef enum {
4097         ZB_ZCL_OFF = 0x00, /**< Off */
4098         ZB_ZCL_ON = 0x01, /**< On */
4099         ZB_ZCL_TOGGLE = 0x02, /**< Toggle */
4100 } zb_zcl_on_off_e;
4101
4102 /**
4103  * @brief Sends 'on/off/toggle' command.
4104  * @details On receipt of 'on' command, a device shall enter its 'Off' state.
4105  * This state is device dependent, but it is recommended that it is used for power off or
4106  * similar functions.
4107  *
4108  * On receipt of 'off' command, a device shall enter its 'On' state. This state is
4109  * device dependent, but it is recommended that it is used for power on or similar
4110  * functions.
4111  *
4112  * On receipt of 'toggle' command, if a device is in its 'Off' state it shall enter
4113  * its 'On' state. Otherwise, if it is in its 'On' state it shall enter its 'Off' state.
4114  *
4115  * @since_tizen 4.0
4116  * @privlevel public
4117  * @privilege %http://tizen.org/privilege/zigbee
4118  *
4119  * @param[in] handle The handle of zigbee
4120  * @param[in] addr16 Network address
4121  * @param[in] ep Endpoint ID
4122  * @param[in] on_off_type #ZB_ZCL_OFF \n
4123  *                        #ZB_ZCL_ON \n
4124  *                        #ZB_ZCL_TOGGLE \n
4125  *
4126  * @return 0 on success, otherwise a negative error value.
4127  * @retval #ZIGBEE_ERROR_NONE Successful
4128  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
4129  * @retval #ZIGBEE_ERROR_INVALID_ENDPOINT Invalid endpoint. 0 is reserved for ZDP
4130  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
4131  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
4132  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
4133  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
4134  *
4135  */
4136 int zb_zcl_on_off_control(zb_zigbee_h handle, zb_nwk_addr addr16, zb_end_point ep,
4137                 zb_zcl_on_off_e on_off_type);
4138
4139 /**
4140  * @}
4141  */
4142
4143 #ifdef __cplusplus
4144 }
4145 #endif
4146
4147 #endif /* __TIZEN_CAPI_NETWORK_ZIGBEE_H__ */