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