Fixed build error
[platform/core/api/zigbee.git] / include / zigbee-zcl_private.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_ZCL_PRIVATE_H__
17 #define __TIZEN_CAPI_NETWORK_ZIGBEE_ZCL_PRIVATE_H__
18
19 #include <zigbee-zcl-type.h>
20
21 /**
22  * @internal
23  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE
24  * @brief Format of the Structure for Read Structured Attribute Record in Zigbee Cluster Library.
25  *
26  * @since_tizen 4.0
27  */
28 typedef void* zb_zcl_read_structured_attr_record_h;
29
30 /**
31  * @internal
32  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE
33  * @brief Format of the write attribute structured status record in Zigbee Cluster Library.
34  *
35  * @since_tizen 4.0
36  */
37 typedef void* zb_zcl_write_attr_structured_status_record_h;
38
39 /**
40  * @internal
41  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE
42  * @brief Format of the write attribute structured record in Zigbee Cluster Library.
43  *
44  * @since_tizen 4.0
45  */
46 typedef void* zb_zcl_write_attr_structured_record_h;
47
48 /**
49  * @internal
50  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE
51  * @brief Format of Attribute Value Field for an array, Set or Bag in Zigbee Cluster Library.
52  *
53  * @since_tizen 4.0
54  */
55 typedef void* zb_zcl_attribute_array_h;
56
57 /**
58  * @internal
59  * @brief Sends 'read attributes structured' command
60  * details The read attributes command is generated when a device wishes to determine the
61  * values of one or more attributes, or elements of attributes, located on another
62  * device. Each attribute identifier field shall contain the identifier of the attribute
63  * to be read.
64  *
65  * @since_tizen 4.0
66  * @privilege %http://tizen.org/privilege/zigbee
67  *
68  * @param[in] handle The handle of zigbee
69  * @param[in] addr16 target network address
70  * @param[in] src_ep source end-point (ex. 1)
71  * @param[in] dst_ep destination end-point (ex. 1)
72  * @param[in] zcl_fc frame control bits (default 0x00). \n
73  *            Only OR operation is allowed in ZCL header \n
74  *            - Frame Type : \n
75  *            #ZB_ZCL_FC_GLOBALLY_USED (default) \n
76  *            #ZB_APS_FC_CLUSTER_SPECIFIC \n
77  *            - Manufacturer Specific : \n
78  *            - Direction : \n
79  *            #ZB_ZCL_CLIENT_TO_SERVER (default) \n
80  *            #ZB_ZCL_SERVER_TO_CLIENT \n
81  *            - Disable Default Response : \n
82  *            #ZB_ZCL_DEFAULT_RESPONSE_ENABLED (default) \n
83  *            #ZB_ZCL_DEFAULT_RESPONSE_DISABLED \n
84  * @param[in] clusterid ZCL cluster id
85  * @param[in] records Array of #zb_zcl_read_structured_attr_record_h
86  * @param[in] count The number of items in @a records array
87  * @param[in] cb Response callback function
88  * @param[in] user_data User data
89  *
90  * @return 0 on success, otherwise a negative error value.
91  * @retval #ZIGBEE_ERROR_NONE Successful
92  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
93  * @retval #ZIGBEE_ERROR_INVALID_ENDPOINT Invalid endpoint. 0 is reserved for ZDP
94  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
95  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
96  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
97  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
98  *
99  * @see zb_zcl_global_attr_read_cb()
100  */
101 int zb_zcl_global_attr_read_structured(
102                 zb_zigbee_h handle,
103                 zb_nwk_addr addr16,
104                 zb_end_point src_ep,
105                 zb_end_point dst_ep,
106                 zb_zcl_frame_ctl zcl_fc,
107                 zb_cluster_id clusterid,
108                 zb_zcl_read_structured_attr_record_h *records,
109                 int count,
110                 zb_zcl_global_attr_read_cb cb,
111                 void *user_data);
112
113 /**
114  * @internal
115  * @brief Sends 'write attributes structured' command.
116  * @details When writing an element to an array or structure, the Indicator subfield indicates
117  * the number of index fields that follow it. This number is limited to the range 0 - 15
118  * (i.e. the upper 4 bits of the Indicator field are set to zero). It may be further limited
119  * by any relevant profile or application.
120  * If the Indicator subfield is 0, there are no index fields, and the whole of the
121  * attribute value is to be written.
122  * If this subfield is 1 or greater, the index fields indicate which element is to be
123  * written, nested to a depth of m. For example, if the attribute is an array of arrays
124  * (or structures), then if m = 2, index 1 = 5 and index 2 = 3, the third element of the
125  * fifth element of the attribute will be written.
126  * Note that elements are numbered from 1 upwards for both arrays and structures.
127  * The zeroth element of an array or structure has type 16 bit unsigned integer, and
128  * holds the number of elements in the array or structure. The zeroth element of an
129  * array may optionally be written (this is application dependent) and has the effect
130  * of changing the number of elements of the array. If the number is reduced, the
131  * array is truncated. If the number is increased, the content of new elements is
132  * application dependent.
133  * The zeroth element of a structure may not be written to. Writing to an element
134  * with an index greater than the number of elements in an array or structure is
135  * always an error.
136  *
137  * @since_tizen 4.0
138  * @privilege %http://tizen.org/privilege/zigbee
139  *
140  * @param[in] handle The handle of zigbee
141  * @param[in] addr16 target network address
142  * @param[in] src_ep source end-point (ex. 1)
143  * @param[in] dst_ep destination end-point (ex. 1)
144  * @param[in] zcl_fc frame control bits (default 0x00). \n
145  *            Only OR operation is allowed in ZCL header \n
146  *            - Frame Type : \n
147  *            #ZB_ZCL_FC_GLOBALLY_USED (default) \n
148  *            #ZB_APS_FC_CLUSTER_SPECIFIC \n
149  *            - Manufacturer Specific : \n
150  *            - Direction : \n
151  *            #ZB_ZCL_CLIENT_TO_SERVER (default) \n
152  *            #ZB_ZCL_SERVER_TO_CLIENT \n
153  *            - Disable Default Response : \n
154  *            #ZB_ZCL_DEFAULT_RESPONSE_ENABLED (default) \n
155  *            #ZB_ZCL_DEFAULT_RESPONSE_DISABLED \n
156  * @param[in] clusterid ZCL cluster id
157  * @param[in] records Array of #zb_zcl_write_attr_structured_record_h
158  * @param[in] count The number of items in @a records array
159  * @param[in] cb Response callback function
160  * @param[in] user_data User data
161  *
162  * @return 0 on success, otherwise a negative error value.
163  * @retval #ZIGBEE_ERROR_NONE Successful
164  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
165  * @retval #ZIGBEE_ERROR_INVALID_ENDPOINT Invalid endpoint. 0 is reserved for ZDP
166  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
167  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
168  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
169  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
170  *
171  * @see zb_zcl_global_attr_write_cb()
172  */
173 int zb_zcl_global_attr_write_structured(
174                 zb_zigbee_h handle,
175                 zb_nwk_addr addr16,
176                 zb_end_point src_ep,
177                 zb_end_point dst_ep,
178                 zb_zcl_frame_ctl zcl_fc,
179                 zb_cluster_id clusterid,
180                 zb_zcl_write_attr_structured_record_h *records,
181                 int count,
182                 zb_zcl_global_attr_write_cb cb,
183                 void *user_data);
184
185 /**
186  * @brief Creates reporting configuration response record.
187  * @details Allocate memory for reporting configuration response record
188  *
189  * @since_tizen 4.0
190  * @privlevel public
191  * @privilege %http://tizen.org/privilege/zigbee
192  *
193  * @remarks The @a handle should be released using zb_report_config_response_record_destroy().
194  *
195  * @param[out] handle The handle of reporting configuration response record
196  *
197  * @return 0 on success, otherwise a negative error value.
198  * @retval #ZIGBEE_ERROR_NONE Successful
199  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
200  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
201  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
202  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
203  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
204  *
205  * @see zb_zcl_global_config_report_write_cb()
206  * @see zb_report_config_response_record_create()
207  * @see zb_report_config_response_record_clone()
208  * @see zb_report_config_response_record_get_status()
209  * @see zb_report_config_response_record_set_status()
210  * @see zb_report_config_response_record_get_dir()
211  * @see zb_report_config_response_record_set_dir()
212  * @see zb_report_config_response_record_get_id()
213  * @see zb_report_config_response_record_set_id()
214  */
215 int zb_report_config_response_record_create(
216                 zb_zcl_report_config_response_record_h *handle);
217
218 /**
219  * @brief Sets status to reporting configuration response record.
220  * @details If the attribute is not implemented on the sender or receiver of the command,
221  * whichever is relevant (depending on direction), this field shall be set to
222  * #ZB_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE.
223  *
224  * If the attribute is supported, but is not capable of
225  * being reported, this field shall be set to #ZB_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE.
226  * Otherwise, this field shall be set to #ZB_ZCL_STATUS_SUCCESS.
227  *
228  * If the status field is not set to #ZB_ZCL_STATUS_SUCCESS, all fields except the
229  * direction and attribute identifier fields shall be omitted.
230  *
231  * @since_tizen 4.0
232  *
233  * @param[in] handle The handle of write attribute status record
234  * @param[in] status status @see #zb_zcl_status_e
235  *
236  * @return 0 on success, otherwise a negative error value.
237  * @retval #ZIGBEE_ERROR_NONE Successful
238  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
239  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
240  *
241  * @see zb_zcl_global_config_report_write_cb()
242  * @see zb_report_config_response_record_create()
243  * @see zb_report_config_response_record_clone()
244  * @see zb_report_config_response_record_destroy()
245  * @see zb_report_config_response_record_get_status()
246  * @see zb_report_config_response_record_set_status()
247  * @see zb_report_config_response_record_get_dir()
248  * @see zb_report_config_response_record_set_dir()
249  * @see zb_report_config_response_record_get_id()
250  * @see zb_report_config_response_record_set_id()
251  */
252 int zb_report_config_response_record_set_status(
253                 zb_zcl_report_config_response_record_h handle,
254                 zb_zcl_status_e status);
255
256 /**
257  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RESPONSE_RECORD_MODULE
258  * @brief Sets the attribute identifier to a reporting configuration response record.
259  * @details The attribute identifier field is 16 bits in length and shall contain the
260  * identifier of the attribute that the reporting configuration details apply to.
261  *
262  * @since_tizen 4.0
263  *
264  * @param[in] handle The handle of write attribute status record
265  * @param[out] id Attribute identifier
266  *
267  * @return 0 on success, otherwise a negative error value.
268  * @retval #ZIGBEE_ERROR_NONE Successful
269  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
270  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
271  *
272  * @see zb_zcl_global_config_report_write_cb()
273  * @see zb_report_config_response_record_clone()
274  * @see zb_report_config_response_record_destroy()
275  * @see zb_report_config_response_record_get_status()
276  * @see zb_report_config_response_record_get_dir()
277  * @see zb_report_config_response_record_get_id()
278  * @see zb_report_config_response_record_set_status()
279  * @see zb_report_config_response_record_set_dir()
280  * @see zb_report_config_response_record_set_id()
281  */
282 int zb_report_config_response_record_set_id(
283                 zb_zcl_report_config_response_record_h handle,
284                 zb_attribute_id id);
285
286 /**
287  * @brief Sets direction to reporting configuration response record.
288  * @details The direction field specifies whether values of the attribute are reported
289  * (0x00), or whether reports of the attribute are received (0x01).
290  *
291  * If this value is set to 0x00, then the attribute data type field, the minimum
292  * reporting interval field, the maximum reporting interval field and the reportable
293  * change field are included in the payload, and the timeout period field is omitted. If
294  * this value is set to 0x01, then the timeout period field is included in the payload,
295  * and the attribute data type field, the minimum reporting interval field, the
296  * maximum reporting interval field and the reportable change field are omitted.
297  *
298  * All other values of this field are reserved.
299  *
300  * @since_tizen 4.0
301  *
302  * @param[in] handle The handle of write attribute status record
303  * @param[in] dir direction 00 : #ZB_ZCL_CLIENT_TO_SERVER \n
304  *                          01 : #ZB_ZCL_SERVER_TO_CLIENT \n
305  *
306  * @return 0 on success, otherwise a negative error value.
307  * @retval #ZIGBEE_ERROR_NONE Successful
308  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
309  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
310  *
311  * @see zb_zcl_global_config_report_write_cb()
312  * @see zb_report_config_response_record_create()
313  * @see zb_report_config_response_record_clone()
314  * @see zb_report_config_response_record_destroy()
315  * @see zb_report_config_response_record_get_status()
316  * @see zb_report_config_response_record_set_status()
317  * @see zb_report_config_response_record_get_dir()
318  * @see zb_report_config_response_record_set_dir()
319  * @see zb_report_config_response_record_get_id()
320  * @see zb_report_config_response_record_set_id()
321  */
322 int zb_report_config_response_record_set_dir(
323                 zb_zcl_report_config_response_record_h handle,
324                 zb_zcl_fc_direction_e dir);
325
326 /**
327  * @brief Gets direction from read reporting configuration record.
328  * @details The direction field specifies whether values of the attribute are reported
329  * (0x00), or whether reports of the attribute are received (0x01).
330  *
331  * All other values of this field are reserved.
332  *
333  * @since_tizen 4.0
334  *
335  * @param[in] handle The handle of write attribute status record
336  * @param[out] dir direction
337  *
338  * @return 0 on success, otherwise a negative error value.
339  * @retval #ZIGBEE_ERROR_NONE Successful
340  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
341  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
342  *
343  * @see zb_read_report_config_record_create()
344  * @see zb_read_report_config_record_destroy()
345  * @see zb_read_report_config_record_get_id()
346  * @see zb_read_report_config_record_set_id()
347  * @see zb_read_report_config_record_get_dir()
348  * @see zb_read_report_config_record_set_dir()
349  */
350 int zb_read_report_config_record_get_dir(
351                 zb_zcl_read_report_config_record_h handle,
352                 zb_zcl_fc_direction_e *dir);
353
354 /**
355  * @brief Gets attribute identifier from read reporting configuration record.
356  * @details The attribute identifier field shall contain the identifier of the attribute
357  * whose reporting configuration details are to be read.
358  *
359  * @since_tizen 4.0
360  *
361  * @param[in] handle The handle of write attribute status record
362  * @param[out] id Attribute identifier
363  *
364  * @return 0 on success, otherwise a negative error value.
365  * @retval #ZIGBEE_ERROR_NONE Successful
366  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
367  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
368  *
369  * @see zb_read_report_config_record_create()
370  * @see zb_read_report_config_record_destroy()
371  * @see zb_read_report_config_record_get_id()
372  * @see zb_read_report_config_record_set_id()
373  * @see zb_read_report_config_record_get_dir()
374  * @see zb_read_report_config_record_set_dir()
375  */
376 int zb_read_report_config_record_get_id(
377                 zb_zcl_read_report_config_record_h handle,
378                 unsigned short *id);
379
380 /**
381  * @brief Called after zb_zcl_global_discover_commands_received() and
382  *        zb_zcl_global_discover_cmds_generated().
383  * @details The ZCL provides the facility to discover the commands that a cluster
384  * instance on a remote device can receive and generate. This is useful since an
385  * individual cluster instance may not be able to receive or generate all of the commands
386  * that are theoretically supported by the cluster.
387  *
388  * @since_tizen 4.0
389  *
390  * @remarks The @a commandids can be used only in the callback. To use outside, make a copy.
391  * @remarks The @a commandids should not be released.
392  *
393  * @param[out] addr16 source network address
394  * @param[out] ep where is sent from (ex. 1)
395  * @param[out] clusterid ZCL cluster id
396  * @param[out] discovery_complete which indicates whether the Command Discovery is
397  *             complete, i.e. whether there are any commands remaining to be discovered:\n
398  *             - TRUE - all commands have been discovered\n
399  *             - FALSE - there are further commands to be discovered\n
400  * @param[out] commandids Discovered commands list
401  * @param[out] commandids_len The number of discovered commands reported in this response
402  * @param[out] user_data User data
403  *
404  * @see zb_zcl_global_discover_cmd_received()
405  */
406 typedef void (*zb_zcl_global_discover_cmds_cb)(
407                 zb_nwk_addr addr16,
408                 zb_end_point ep,
409                 zb_cluster_id clusterid,
410                 unsigned char discovery_complete,
411                 zb_command_id *commandids,
412                 int commandids_len,
413                 void *user_data);
414
415 /**
416  * @brief Sends 'discover command recevied' command.
417  * @details This function to know remote cluster on remote device can handle specific commands.
418  * The ZCL provides the facility to discover the commands that a cluster
419  * instance on a remote device can receive and generate. This is useful since an
420  * individual cluster instance may not be able to receive or generate all of the commands
421  *  that are theoretically supported by the cluster.
422  *
423  * @since_tizen 4.0
424  * @privlevel public
425  * @privilege %http://tizen.org/privilege/zigbee
426  *
427  * @param[in] handle The handle of zigbee
428  * @param[in] addr16 target network address
429  * @param[in] src_ep source end-point (ex. 1)
430  * @param[in] dst_ep destination end-point (ex. 1)
431  * @param[in] zcl_fc frame control bits (default 0x00). \n
432  *            Only OR operation is allowed in ZCL header \n
433  *            - Frame Type : \n
434  *            #ZB_ZCL_FC_GLOBALLY_USED (default) \n
435  *            #ZB_APS_FC_CLUSTER_SPECIFIC \n
436  *            - Manufacturer Specific : \n
437  *            - Direction : \n
438  *            #ZB_ZCL_CLIENT_TO_SERVER (default) \n
439  *            #ZB_ZCL_SERVER_TO_CLIENT \n
440  *            - Disable Default Response : \n
441  *            #ZB_ZCL_DEFAULT_RESPONSE_ENABLED (default) \n
442  *            #ZB_ZCL_DEFAULT_RESPONSE_DISABLED \n
443  * @param[in] clusterid ZCL cluster id
444  * @param[in] start_command_id Start command id .
445  * @param[in] max_command_ids Last command id
446  * @param[in] cb Response callback function
447  * @param[in] user_data User data
448  *
449  * @return 0 on success, otherwise a negative error value.
450  * @retval #ZIGBEE_ERROR_NONE Successful
451  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
452  * @retval #ZIGBEE_ERROR_INVALID_ENDPOINT Invalid endpoint. 0 is reserved for ZDP
453  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
454  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
455  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
456  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
457  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
458  *
459  * @see zb_zcl_global_discover_cmd_received_cb()
460  */
461 int zb_zcl_global_discover_cmds_received(
462                 zb_zigbee_h handle,
463                 zb_nwk_addr addr16,
464                 zb_end_point src_ep,
465                 zb_end_point dst_ep,
466                 zb_zcl_frame_ctl zcl_fc,
467                 zb_cluster_id clusterid,
468             zb_command_id start_command_id,
469             unsigned char max_command_ids,
470             zb_zcl_global_discover_cmds_cb cb,
471             void *user_data);
472
473 /**
474  * @brief Sends 'discover command generated' command.
475  * @details The ZCL provides the facility to discover the commands that a cluster
476  * instance on a remote device can receive and generate. This is useful since an
477  * individual cluster instance may not be able to receive or generate all of the commands
478  *  that are theoretically supported by the cluster.
479  *
480  * @since_tizen 4.0
481  * @privlevel public
482  * @privilege %http://tizen.org/privilege/zigbee
483  *
484  * @param[in] handle The handle of zigbee
485  * @param[in] addr16 target network address
486  * @param[in] src_ep source end-point (ex. 1)
487  * @param[in] dst_ep destination end-point (ex. 1)
488  * @param[in] zcl_fc frame control bits (default 0x00). \n
489  *            Only OR operation is allowed in ZCL header \n
490  *            - Frame Type : \n
491  *            #ZB_ZCL_FC_GLOBALLY_USED (default) \n
492  *            #ZB_APS_FC_CLUSTER_SPECIFIC \n
493  *            - Manufacturer Specific : \n
494  *            - Direction : \n
495  *            #ZB_ZCL_CLIENT_TO_SERVER (default) \n
496  *            #ZB_ZCL_SERVER_TO_CLIENT \n
497  *            - Disable Default Response : \n
498  *            #ZB_ZCL_DEFAULT_RESPONSE_ENABLED (default) \n
499  *            #ZB_ZCL_DEFAULT_RESPONSE_DISABLED \n
500  * @param[in] clusterid ZCL cluster id
501  * @param[in] start_command_id Start command id .
502  * @param[in] max_command_ids Last command id
503  * @param[in] cb Response callback function
504  * @param[in] user_data User data
505  *
506  * @return 0 on success, otherwise a negative error value.
507  * @retval #ZIGBEE_ERROR_NONE Successful
508  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
509  * @retval #ZIGBEE_ERROR_INVALID_ENDPOINT Invalid endpoint. 0 is reserved for ZDP
510  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
511  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
512  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
513  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
514  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
515  *
516  * @see zb_zcl_global_discover_cmds_cb()
517  */
518 int zb_zcl_global_discover_cmds_generated(
519                 zb_zigbee_h handle,
520                 zb_nwk_addr addr16,
521                 zb_end_point src_ep,
522                 zb_end_point dst_ep,
523                 zb_zcl_frame_ctl zcl_fc,
524                 zb_cluster_id clusterid,
525                 zb_command_id start_command_id,
526                 unsigned char max_command_ids,
527                 zb_zcl_global_discover_cmds_cb cb,
528                 void *user_data);
529
530 /**
531  * @brief Called after zb_zcl_global_attr_extended_discover().
532  * @details The ZCL provides the facility to discover the commands that a cluster
533  * instance on a remote device can receive and generate. This is useful since an
534  * individual cluster instance may not be able to receive or generate all of the commands
535  *  that are theoretically supported by the cluster.
536  *
537  * @since_tizen 4.0
538  *
539  * @remarks The @a records can be used only in the callback. To use outside, make a copy.
540  * @remarks The @a records should not be released.
541  *
542  * @param[out] addr16 source network address
543  * @param[out] ep where is sent from (ex. 1)
544  * @param[out] clusterid ZCL cluster id
545  * @param[out] discovery_complete which indicates whether the Command Discovery is
546  *             complete, i.e. whether there are any commands remaining to be discovered:\n
547  *             - TRUE - all commands have been discovered\n
548  *             - FALSE - there are further commands to be discovered\n
549  * @param[out] records Discovered attribute information list
550  * @param[out] count Len The length of discovered information reported in this response
551  * @param[in] user_data User data
552  *
553  * @see zb_zcl_global_attr_extended_discover()
554  */
555 typedef void (*zb_zcl_global_attr_extended_discover_cb)(
556                 zb_nwk_addr addr16,
557                 zb_end_point ep,
558                 zb_cluster_id clusterid,
559                 unsigned char discovery_complete,
560                 zb_zcl_extended_attr_info_h *records,
561                 unsigned short count,
562                 void *user_data);
563
564 /**
565  * @brief Sends 'discover attributes extended' command.
566  * @details This function to know remote cluster on remote device has extended commands.
567  * The ZCL provides the facility to discover the commands that a cluster
568  * instance on a remote device can receive and generate. This is useful since an
569  * individual cluster instance may not be able to receive or generate all of the commands
570  *  that are theoretically supported by the cluster.
571  *
572  * @since_tizen 4.0
573  * @privlevel public
574  * @privilege %http://tizen.org/privilege/zigbee
575  *
576  * @param[in] handle The handle of zigbee
577  * @param[in] addr16 target network address
578  * @param[in] src_ep source end-point (ex. 1)
579  * @param[in] dst_ep destination end-point (ex. 1)
580  * @param[in] zcl_fc frame control bits (default 0x00). \n
581  *            Only OR operation is allowed in ZCL header \n
582  *            - Frame Type : \n
583  *            #ZB_ZCL_FC_GLOBALLY_USED (default) \n
584  *            #ZB_APS_FC_CLUSTER_SPECIFIC \n
585  *            - Manufacturer Specific : \n
586  *            - Direction : \n
587  *            #ZB_ZCL_CLIENT_TO_SERVER (default) \n
588  *            #ZB_ZCL_SERVER_TO_CLIENT \n
589  *            - Disable Default Response : \n
590  *            #ZB_ZCL_DEFAULT_RESPONSE_ENABLED (default) \n
591  *            #ZB_ZCL_DEFAULT_RESPONSE_DISABLED \n
592  * @param[in] clusterid ZCL cluster id
593  * @param[in] start_id Start id .
594  * @param[in] max_attribute_ids Last command id
595  * @param[in] cb Response callback function
596  * @param[in] user_data User data
597  *
598  * @return 0 on success, otherwise a negative error value.
599  * @retval #ZIGBEE_ERROR_NONE Successful
600  * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
601  * @retval #ZIGBEE_ERROR_INVALID_ENDPOINT Invalid endpoint. 0 is reserved for ZDP
602  * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
603  * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
604  * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
605  * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied
606  * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
607  *
608  * @see zb_zcl_global_attr_extended_discover_cb()
609  */
610 int zb_zcl_global_attr_extended_discover(
611                 zb_zigbee_h handle,
612                 zb_nwk_addr addr16,
613                 zb_end_point src_ep,
614                 zb_end_point dst_ep,
615                 zb_zcl_frame_ctl zcl_fc,
616                 zb_cluster_id clusterid,
617                 zb_cluster_id start_id,
618                 unsigned char max_attribute_ids,
619                 zb_zcl_global_attr_extended_discover_cb cb,
620                 void *user_data);
621
622
623 #endif /* __TIZEN_CAPI_NETWORK_ZIGBEE_ZCL_PRIVATE_H__ */