2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef __TIZEN_NETWORK_ZIGBEE_ZDO_DEVICE_DISCOVERY_H__
17 #define __TIZEN_NETWORK_ZIGBEE_ZDO_DEVICE_DISCOVERY_H__
19 #include <zdo/zb-zdo-type.h>
26 * @file zb-zdo-dev-disc.h
30 * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
31 * @defgroup CAPI_NETWORK_ZIGBEE_ZDO_DEVICE_DISCOVERY_MODULE Device Discovery
33 * @brief zigbee provides API for Device Discovery.
35 * @section CAPI_NETWORK_ZIGBEE_ZDO_DEVICE_DISCOVERY_HEADER Header
36 * \#include <zigbee.h>
38 * @section CAPI_NETWORK_ZIGBEE_ZDO_DEVICE_DISCOVERY_OVERVIEW Overview
39 * This API set consists of ZDP device discovery API
46 * @brief Network / IEEE address response
47 * @details The NWK_addr_rsp is generated by a Remote Device in response to a\n
48 * NWK_addr_req or IEEE_addr_req command inquiring as to the NWK address of the Remote
49 * Device or the NWK address of an address held in a local discovery cache.\n
50 * The destination addressing on this command is unicast.\n
54 * @param[out] status #ZB_ZDP_SUCCESS \n
55 * #ZB_ZDP_INV_REQUESTTYPE \n
56 * #ZB_ZDP_DEVICE_NOT_FOUND
57 * @param[out] remote_dev_addr64 64-bit address for the remote device
58 * @param[out] remote_dev_addr16 16-bit address for the remote device
59 * @param[out] num_of_assoc_dev Count of the number of 16-bit short addresses to follow.
60 * If the RequestType in the request is Extended Response
61 * and there are no associated devices on the Remote Device,
62 * this field shall be set to 0.
63 * If an error occurs or the RequestType in the request is
64 * for a Single Device Response, this field shall not
65 * be included in the frame.
66 * @param[out] start_idx Starting index into the list of associated devices for this
67 * report. If the RequestType in the request is Extended Response
68 * and there are no associated devices on the Remote Device,
69 * this field shall not be included in the frame.
70 * If an error occurs or the RequestType in the request is
71 * for a Single Device Response, this field shall not
72 * be included in the frame.
73 * @param[out] assoc_dev_addr_list A list of 16-bit addresses, one corresponding to each
74 * associated device to Remote Device; The number of 16-bit
75 * network addresses contained in this field is specified
76 * in the NumAssocDev field.
77 * If the RequestType in the request is Extended Response
78 * and there are no associated devices on the Remote Device,
79 * this field shall not be included in the frame.
80 * If an error occurs or the RequestType in the request is
81 * for a Single Device Response, this field shall not
82 * be included in the frame.
83 * @param[out] user_data user data
85 * @see zb_zdo_nwk_addr_req()
87 typedef void (*zb_zdo_addr_rsp)(
89 ieee_addr remote_dev_addr64,
90 nwk_addr remote_dev_addr16,
91 unsigned char num_of_assoc_dev,
92 unsigned char start_idx,
93 unsigned short *assoc_dev_addr_list,
97 * @brief Network address request
98 * @details The NWK_addr_req is generated from a Local Device wishing to inquire as to the\n
99 * 16-bit address of the Remote Device based on its known IEEE address. The\n
100 * destination addressing on this command shall be unicast or broadcast to all\n
101 * devices for which macRxOnWhenIdle = TRUE.\n
105 * @param[in] handle The handle of zigbee
106 * @param[in] addr64 IEEE address for device of interest
107 * @param[in] request_type \n
108 * 0x00 - Single device response \n
109 * 0x01 - Extended response \n
110 * @param[in] start_idx If the Request type for this command is Extended response,
111 * is StartIndex provides the starting index for the requested
112 * elements of the associated devices list
113 * @param[in] cb Response callback
114 * @param[in] user_data user data
116 * @return 0 on success, otherwise a negative error value.
117 * @retval #ZIGBEE_ERROR_NONE Successful
118 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
119 * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
120 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
122 * @see zb_zdo_nwk_addr_rsp()
124 int zb_zdo_nwk_addr_req(
127 unsigned char request_type,
128 unsigned char start_idx,
133 * @brief IEEE address request
134 * @details The IEEE_addr_req is generated from a Local Device wishing to inquire as to
135 * the 64-bit IEEE address of the Remote Device based on their known 16-bit address.
136 * The destination addressing on this command shall be unicast.
140 * @param[in] handle The handle of zigbee
141 * @param[in] addr16 Network address for device of interest
142 * @param[in] cb Response callback
143 * @param[in] user_data user data
145 * @return 0 on success, otherwise a negative error value.
146 * @retval #ZIGBEE_ERROR_NONE Successful
147 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
148 * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
149 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
151 * @see zb_zdo_ieee_addr_rsp()
153 int zb_zdo_ieee_addr_req(
160 * @brief Active endpoint response
161 * @details The Active_EP_rsp is generated by a remote device in response to an
162 * Active_EP_req directed to the remote device. This command shall be unicast to
163 * the originator of the Active_EP_req command.\n\n
164 * The remote device shall generate the Active_EP_rsp command using the format
165 * illustrated param list. The NWKAddrOfInterest field shall match that specified
166 * in the original Active_EP_req command. If the NWKAddrOfInterest field
167 * matches the network address of the remote device, it shall set the Status field to
168 * SUCCESS, set the ActiveEPCount field to the number of active endpoints on that
169 * device and include an ascending list of all the identifiers of the active endpoints on
170 * that device in the ActiveEPList field.\n\n
171 * If the NWKAddrOfInterest field does not match the network address of the
172 * remote device and it is an end device, it shall set the Status field to
173 * INV_REQUESTTYPE, set the ActiveEPCount field to 0, and not include the
174 * ActiveEPList field.\n\n If the NWKAddrOfInterest field does not match the network
175 * address of the remote device and it is the coordinator or a router, it shall determine
176 * whether the NWKAddrOfInterest field matches the network address of a device it
177 * holds in a discovery cache. \n\n If the NWKAddrOfInterest field does not match the
178 * network address of a device it holds in a discovery cache, it shall set the Status
179 * field to DEVICE_NOT_FOUND, set the ActiveEPCount field to 0, and not
180 * include the ActiveEPList field.\n\n If the NWKAddrOfInterest matches the network
181 * address of a device held in a discovery cache on the remote device, it shall
182 * determine whether that device has any active endpoints. If the discovery
183 * information corresponding to the ActiveEP request has not yet been uploaded to
184 * the discovery cache, the remote device shall set the Status field to
185 * NO_DESCRIPTOR, set the ActiveEPCount field to 0 and not include the
186 * ActiveEPList field.\n\n If the cached device has no active endpoints, the remote
187 * device shall set the Status field to SUCCESS, set the ActiveEPCount field to 0,
188 * and not include the ActiveEPList field.\n\n If the cached device has active endpoints,
189 * the remote device shall set the Status field to SUCCESS, set the ActiveEPCount
190 * field to the number of active endpoints on that device, and include an ascending
191 * list of all the identifiers of the active endpoints on that device in the ActiveEPList
196 * @param[out] status #ZB_ZDP_SUCCESS \n
197 * #ZB_ZDP_INV_REQUESTTYPE \n
198 * #ZB_ZDP_DEVICE_NOT_FOUND \n
199 * #ZB_ZDP_NO_DESCRIPTOR \n
200 * @param[out] addr16 Network address for the request
201 * @param[out] count The count of active endpoint on the remote device
202 * @param[out] ep_list List of bytes each of which represents an 8-bit endpoint
203 * @param[out] user_data user data
205 * @see zb_zdo_active_ep()
207 typedef void (*zb_zdo_active_ep_rsp)(
208 unsigned char status,
211 unsigned char *ep_list,
215 * @brief Active EP request
216 * @details The Active_EP_req command is generated from a local device wishing to acquire
217 * the list of endpoints on a remote device with simple descriptors. This command
218 * shall be unicast either to the remote device itself or to an alternative device that
219 * contains the discovery information of the remote device.\n\n
220 * The local device shall generate the Active_EP_req command using the format
221 * illustrated in param list. The NWKAddrOfInterest field shall contain the network
222 * address of the remote device for which the active endpoint list is required.
226 * @param[in] handle The handle of zigbee
227 * @param[in] addr16 Network address for device of interest
228 * @param[in] cb Response callback
229 * @param[in] user_data user data
231 * @return 0 on success, otherwise a negative error value.
232 * @retval #ZIGBEE_ERROR_NONE Successful
233 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
234 * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
235 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
237 * @see zb_zdo_active_ep_rsp()
239 int zb_zdo_active_ep(
242 zb_zdo_active_ep_rsp cb,
246 * @brief Simple descriptor response
247 * @details The Simple_Desc_rsp is generated by a remote device in response to a
248 * Simple_Desc_req directed to the remote device. This command shall be unicast to
249 * the originator of the Simple_Desc_req command.
250 * The remote device shall generate the Simple_Desc_rsp command using the format
251 * illustrated in Table 2.94. The NWKAddrOfInterest field shall match that specified
252 * in the original Simple_Desc_req command. If the endpoint field specified in the
253 * original Simple_Desc_req command does not fall within the correct range
254 * specified in param list, the remote device shall set the Status field to
255 * INVALID_EP, set the Length field to 0 and not include the SimpleDescriptor
257 * If the NWKAddrOfInterest field matches the network address of the remote
258 * device, it shall determine whether the endpoint field specifies the identifier of an
259 * active endpoint on the device. If the endpoint field corresponds to an active
260 * endpoint, the remote device shall set the Status field to SUCCESS, set the Length
261 * field to the length of the simple descriptor on that endpoint, and include the simple
262 * descriptor for that endpoint in the SimpleDescriptor field.
263 * If the endpoint field does not correspond to an active endpoint, the remote device
264 * shall set the Status field to NOT_ACTIVE, set the Length field to 0, and not
265 * include the SimpleDescriptor field.\n\n
266 * If the NWKAddrOfInterest field does not match the network address of the
267 * remote device and it is an end device, it shall set the Status field to
268 * INV_REQUESTTYPE, set the Length field to 0, and not include the
269 * SimpleDescriptor field. If the NWKAddrOfInterest field does not match the
270 * network address of the remote device and it is the coordinator or a router, it shall
271 * determine whether the NWKAddrOfInterest field matches the network address of
272 * one of its children. If the NWKAddrOfInterest field does not match the network
273 * address of one of the children of the remote device, it shall set the Status field to
274 * DEVICE_NOT_FOUND, set the Length field to 0, and not include the
275 * SimpleDescriptor field.\n\n
276 * If the NWKAddrOfInterest matches the network address of one of the children of
277 * the remote device, it shall determine whether a simple descriptor for that device
278 * and on the requested endpoint is available. If a simple descriptor is not available
279 * on the requested endpoint of the child indicated by the NWKAddrOfInterest field,
280 * the remote device shall set the Status field to NO_DESCRIPTOR, set the Length
281 * field to 0, and not include the SimpleDescriptor field. If a simple descriptor is
282 * available on the requested endpoint of the child indicated by the
283 * NWKAddrOfInterest field, the remote device shall set the Status field to
284 * SUCCESS, set the Length field to the length of the simple descriptor on that
285 * endpoint, and include the simple descriptor for that
286 * endpoint of the matching child device in the SimpleDescriptor field.
290 * @param[out] status #ZB_ZDP_SUCCESS \n
291 * #ZB_ZDP_INVALID_EP \n
292 * #ZB_ZDP_NOT_ACTIVE \n
293 * #ZB_ZDP_DEVICE_NOT_FOUND \n
294 * #ZB_ZDP_INV_REQUESTTYPE \n
295 * #ZB_ZDP_NO_DESCRIPTOR
296 * @param[out] addr16 Network address for the request
297 * @param[out] len Length in bytes of the simple descriptor to follow
298 * @param[out] handle Simple descriptor structure this filed shall only be included
299 * in the frame if the status field is equal to ZB_ZDP_SUCCESS
300 * @param[out] user_data user data
302 * @see zb_zdo_simple_desc_req()
304 typedef void (*zb_zdo_simple_desc_rsp)(
307 const zb_zdo_simple_desc_h handle,
311 * @brief Simple descriptor request
312 * @details The Simple_Desc_req command is generated from a local device wishing to
313 * inquire as to the simple descriptor of a remote device on a specified endpoint. This
314 * command shall be unicast either to the remote device itself or to an alternative
315 * device that contains the discovery information of the remote device.\n\n
316 * The local device shall generate the Simple_Desc_req command using the format
317 * illustrated in param list. The NWKAddrOfInterest field shall contain the network
318 * address of the remote device for which the simple descriptor is required and the
319 * endpoint field shall contain the endpoint identifier from which to obtain the
320 * required simple descriptor.
324 * @param[in] handle The handle of zigbee
325 * @param[in] addr16 Network address for device of interest
326 * @param[in] ep The endpoint on the destination
327 * @param[in] cb Response callback
328 * @param[in] user_data user data
330 * @return 0 on success, otherwise a negative error value.
331 * @retval #ZIGBEE_ERROR_NONE Successful
332 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
333 * @retval #ZIGBEE_ERROR_INVALID_ENDPOINT Invalid endpoint. 0 is reserved for ZDP
334 * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
335 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
337 * @see zb_zdo_simple_desc_rsp()
339 int zb_zdo_simple_desc_req(
343 zb_zdo_simple_desc_rsp cb,
346 #ifdef ZB_SUPPORT_PRIORITY_5
348 * @brief Extended simple descriptor response
349 * @details The Extended_Simple_Desc_rsp is generated by a remote device in response to an
350 * Extended_Simple_Desc_req directed to the remote device. This command shall
351 * be unicast to the originator of the Extended_Simple_Desc_req command.
352 * The remote device shall generate the Extended_Simple_Desc_rsp command using
353 * the format illustrated in param list. The NWKAddrOfInterest field shall match
354 * that specified in the original Extended_Simple_Desc_req command. If the
355 * endpoint field specified in the original Extended_Simple_Desc_req command
356 * does not fall within the correct range specified in Table 2.49, the remote device
357 * shall set the Status field to INVALID_EP, set the Endpoint and StartIndex fields to
358 * their respective values supplied in the request, and not include the AppClusterList
360 * If the NWKAddrOfInterest field matches the network address of the remote
361 * device, it shall determine whether the endpoint field specifies the identifier of an
362 * active endpoint on the device.\n\n If the endpoint field corresponds to an active
363 * endpoint, the remote device shall set the Status field to SUCCESS, set the
364 * AppClusterList field to the sequence of octets from the concatenated AppInput
365 * ClusterList and AppOutputClusterList from the Simple Descriptor (Tables 2.39),
366 * and supply that field as AppClusterList in the response. Note that dependent on
367 * the value of StartIndex in the request, the results in AppClusterList may be empty
368 * (for example, the StartIndex begins after the sequence of octets given by the
369 * concatenation of AppInputClusterList and AppOutputClusterList).\n\n If the endpoint
370 * field does not correspond to an active endpoint, the remote device shall set the
371 * Status field to NOT_ACTIVE, set the StartIndex field to the value supplied in the
372 * request, and not include the AppClusterList field.
376 * @param[out] status #ZB_ZDP_SUCCESS \n
377 * #ZB_ZDP_INVALID_EP \n
378 * #ZB_ZDP_NOT_ACTIVE \n
379 * #ZB_ZDP_DEVICE_NOT_FOUND \n
380 * #ZB_ZDP_INV_REQUESTTYPE \n
381 * #ZB_ZDP_NO_DESCRIPTOR
382 * @param[out] addr16 Network address for the request
383 * @param[out] ep The endpoint on the destination
384 * @param[out] app_input_cluster_count The total count of application input cluster in
385 * the simple descriptor for this endpoint
386 * @param[out] app_output_cluster_count The total count of application output cluster in
387 * the simple descriptor for this endpoint
388 * @param[out] start_idx Starting index within the AppClusterList of the response
389 * represented by an ordered list of the Application Input
390 * Cluster List and Application Output Cluster List from the
391 * Simple Descriptor for this endpoint.
392 * @param[out] app_cluster_list A concatenated, ordered list of the AppInputClusterList
393 * and AppOutputClusterList, beginning with StartIndex,
394 * from the Simple Descriptor.
395 * This field shall only be included in the frame if the
396 * status field is equal to ZB_ZDP_SUCCESS.
397 * @param[out] user_data user data
399 * @see zb_zdo_extended_simple_desc_req()
401 typedef void (*zb_zdo_extended_simple_desc_rsp)(
402 unsigned char status,
405 unsigned char app_input_cluster_count,
406 unsigned char app_output_cluster_count,
407 unsigned char start_idx,
408 const unsigned char *app_cluster_list,
412 * @brief Extended simple descriptor request
413 * @details The Extended_Active_EP_req command is generated from a local device wishing
414 * to acquire the list of endpoints on a remote device with simple descriptors. This
415 * command shall be unicast either to the remote device itself or to an alternative
416 * device that contains the discovery information of the remote device.n\n The
417 * Extended_Active_EP_req is used for devices which support more active
418 * endpoints than can be returned by a single Active_EP_req.
419 * The local device shall generate the Extended_Active_EP_req command using the
420 * format illustrated in Table 2.66.\n\n The NWKAddrOfInterest field shall contain the
421 * network address of the remote device for which the active endpoint list is
422 * required.\n\n The StartIndex field shall be set in the request to enable retrieval of
423 * lists of active endpoints from devices whose list exceeds the size of a single ASDU and
424 * where fragmentation is not supported.
428 * @param[in] handle The handle of zigbee
429 * @param[in] addr16 Network address for device of interest
430 * @param[in] start_idx Starting index within the active endpoint list in the response
431 * @param[in] cb Response callback
432 * @param[in] user_data user data
434 * @return 0 on success, otherwise a negative error value.
435 * @retval #ZIGBEE_ERROR_NONE Successful
436 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
437 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
439 * @see zb_zdo_extended_simple_desc_rsp()
441 int zb_zdo_extended_simple_desc_req(
444 unsigned char start_idx,
445 zb_zdo_extended_simple_desc_rsp cb,
448 #endif /* ZB_SUPPORT_PRIORITY_5 */
451 * @brief Matching descriptor response
452 * @details The Match_Desc_rsp is generated by a remote device in response to a
453 * Match_Desc_req either broadcast or directed to the remote device. This command
454 * shall be unicast to the originator of the Match_Desc_req command.
455 * The remote device shall generate the Match_Desc_rsp command using the format
456 * illustrated in Table 2.96. If the NWKAddrOfInterest field of the original
457 * Match_Desc_req was equal to the broadcast network address for all devices for
458 * which macRxOnWhenIdle = TRUE (0xfffd), the remote device shall apply the
459 * match criterion, as described below, that was specified in the original
460 * Match_Desc_req command to each of its simple descriptors. If the remote device
461 * is the coordinator or a router, it shall also apply the match criterion, as described
462 * below, to each simple descriptor that it may have obtained from each of its
465 * If the NWKAddrOfInterest field of the original Match_Desc_req was not equal to
466 * the broadcast network address for all devices for which macRxOnWhenIdle =
467 * TRUE (0xfffd), the remote device shall set the NWKAddrOfInterest field to the
468 * same network address that was specified in the original Match_Desc_req
471 * If the NWKAddrOfInterest field matches the network address of the remote
472 * device, it shall apply the match criterion, as described below, that was specified in
473 * the original Match_Desc_req command to each of its simple descriptors.
474 * If the NWKAddrOfInterest field does not match the network address of the
475 * remote device and it is an end device, it shall set the Status field to
476 * INV_REQUESTTYPE, set the MatchLength field to 0, and not include the
477 * MatchList field. If the NWKAddrOfInterest field does not match the network
478 * address of the remote device and it is the coordinator or a router, it shall determine
479 * whether the NWKAddrOfInterest field matches the network address of one of its
480 * children. If the NWKAddrOfInterest field does not match the network address of
481 * one of the children of the remote device, it shall set the Status field to
482 * DEVICE_NOT_FOUND, set the MatchLength field to 0, and not include the
485 * If the NWKAddrOfInterest matches the network address of one of the children of
486 * the remote device, it shall determine whether any simple descriptors for that
487 * device are available. If no simple descriptors are available for the child indicated
488 * by the NWKAddrOfInterest field, the remote device shall set the Status field to
489 * NO_DESCRIPTOR, set the MatchLength field to 0, and not include the
490 * MatchList field. If any simple descriptors are available for the child indicated by
491 * the NWKAddrOfInterest field, the remote device shall apply the match criterion,
492 * as described below, that was specified in the original Match_Desc_req command
493 * to each of these simple descriptors.
495 * The remote device shall apply the match criteria to each simple descriptor as follows.
496 * The remote device shall first check if the ProfileID
497 * field matches exactly the application profile identifier field of the simple
498 * descriptor. If the profileID field does not match exactly the remote device shall
499 * check if the Profile ID of the Match_desc_req matches the wildcard profile
500 * (0xFFFF) and the Profile ID of the Simple Descriptor is within the Standard range
501 * (a public profile) as dictated by document [B25]. 14 If the profile identifiers do not
502 * match, the remote device shall assume the match to be unsuccessful and perform
503 * no further matching.
505 * If the profile identifiers match, the remote device shall determine whether the
506 * match criteria contains a list of input clusters (the NumInClusters field is not equal
507 * to 0). If the match criteria contains a list of input clusters, the remote device shall
508 * check that at least one of the cluster identifiers listed in the InClusterList field
509 * matches one of the cluster identifiers in the application input cluster list field of
510 * the simple descriptor. If at least one matching input cluster is found, the remote
511 * device shall assume the match to be successful, note the identifier of the endpoint
512 * to which this simple descriptor refers and perform no further matching.
513 * If the remote device is unable to find any matching input clusters, it shall
514 * determine whether the match criterion contains a list of output clusters (the
515 * NumOutClusters field is not equal to 0). If the match criterion contains a list of
516 * output clusters, the remote device shall check that at least one of the cluster
517 * identifiers listed in the OutClusterList field matches one of the cluster identifiers
518 * in the application output cluster list field of the simple descriptor. If at least one
519 * matching output cluster is found, the remote device shall assume the match to be
520 * successful and note the identifier of the endpoint to which this simple descriptor
521 * refers. If the remote device is unable to find any output matching clusters, it shall
522 * assume the match to be unsuccessful.
524 * If the above procedure produces one or more matches, the remote device shall
525 * construct a separate Match_Desc_rsp command for each matching device
526 * (including itself). For each response, the Status field shall be set to SUCCESS, the
527 * NWKAddrOfInterest field shall be set to the address of the appropriate matching
528 * device, the MatchLength field shall be set to the number of simple descriptors that
529 * matched the criteria for the appropriate matching device, and the MatchList field
530 * shall contain an ascending list of the endpoints on which a simple descriptor
531 * matched the criteria for the appropriate matching device.
535 * @param[out] status #ZB_ZDP_SUCCESS \n
536 * #ZB_ZDP_DEVICE_NOT_FOUND \n
537 * #ZB_ZDP_INV_REQUESTTYPE \n
538 * #ZB_ZDP_NO_DESCRIPTOR
539 * @param[out] addr16 Network address for the request
540 * @param[out] match_length The count of endpoint on the remote device that match the
541 * match the request criteria
542 * @param[out] match_list List of bytes each of which represents an 8-bit endpoint
543 * @param[out] user_data user data
545 * @see zb_zdo_match_desc_req()
547 typedef void (*zb_zdo_match_desc_rsp)(
548 unsigned char status,
550 unsigned char match_length,
551 unsigned char *match_list,
555 * @brief Matching descriptor request
556 * @details The Match_Desc_req command is generated from a local device wishing to find
557 * remote devices supporting a specific simple descriptor match criterion. This
558 * command shall either be broadcast to all devices for which macRxOnWhenIdle =
559 * TRUE, or unicast. If the command is unicast, it shall be directed either to the
560 * remote device itself or to an alternative device that contains the discovery
561 * information of the remote device.
563 * The local device shall generate the Match_Desc_req command using the format
564 * illustrated in param list. The NWKAddrOfInterest field shall contain the network
565 * address indicating a broadcast to all devices for which macRxOnWhenIdle =
566 * TRUE (0xfffd) if the command is to be broadcast, or the network address of the
567 * remote device for which the match is required.
568 * The remaining fields shall contain the required criterion for which the simple
569 * descriptor match is requested. The ProfileID field shall contain the identifier of
570 * the profile for which the match is being sought or the wildcard profile ID of
573 * The NumInClusters field shall contain the number of elements in the InClusterList
574 * field. If the value of this field is 0, the InClusterList field shall not be included. If
575 * the value of the NumInClusters field is not equal to 0, the InClusterList field shall
576 * contain the list of input cluster identifiers for which the match is being sought.
577 * The NumOutClusters field shall contain the number of elements in the
578 * OutClusterList field. If the value of this field is 0, the OutClusterList field shall
579 * not be included. If the value of the NumOutClusters field is not equal to 0, the
580 * OutClusterList field shall contain the list of output cluster identifiers for which the
581 * match is being sought.
585 * @param[in] handle The handle of zigbee
586 * @param[in] addr16 Network address for device of interest
587 * @param[in] profile_id Profile ID to be matched at the destination
588 * @param[in] num_in_clusters The number of input clusters provided for matching within
589 * the in_cluster_list
590 * @param[in] in_cluster_list List of input cluster ids to b used for matching
591 * @param[in] num_out_clusters The number of output clusters provided for matching within
592 * the out_cluster_list
593 * @param[in] out_cluster_list List of output cluster ids to b used for matching
594 * @param[in] cb Response callback
595 * @param[in] user_data user data
597 * @return 0 on success, otherwise a negative error value.
598 * @retval #ZIGBEE_ERROR_NONE Successful
599 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
600 * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
601 * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
602 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
604 * @see zb_zdo_match_desc_rsp()
606 int zb_zdo_match_desc_req(
609 unsigned short profile_id,
610 unsigned char num_in_clusters,
611 unsigned short *in_cluster_list,
612 unsigned char num_out_clusters,
613 unsigned short *out_cluster_list,
614 zb_zdo_match_desc_rsp cb,
618 * @brief Node descriptor response
619 * @details The Node_Desc_rsp is generated by a remote device in response to a
620 * Node_Desc_req directed to the remote device. This command shall be unicast to
621 * the originator of the Node_Desc_req command.
623 * The remote device shall generate the Node_Desc_rsp command using the format
624 * illustrated in param list. The NWKAddrOfInterest field shall match that specified
625 * in the original Node_Desc_req command. If the NWKAddrOfInterest field
626 * matches the network address of the remote device, it shall set the Status field to
627 * SUCCESS and include its node descriptor in the NodeDescriptor field.
628 * If the NWKAddrOfInterest field does not match the network address of the
629 * remote device and it is an end device, it shall set the Status field to
630 * INV_REQUESTTYPE and not include the NodeDescriptor field.\n\n If the
631 * NWKAddrOfInterest field does not match the network address of the remote
632 * device and it is the coordinator or a router, it shall determine whether the
633 * NWKAddrOfInterest field matches the network address of one of its children. If
634 * the NWKAddrOfInterest field does not match the network address of one of the
635 * children of the remote device, it shall set the Status field to
636 * DEVICE_NOT_FOUND and not include the NodeDescriptor field.\n\n If the
637 * NWKAddrOfInterest matches the network address of one of the children of the
638 * remote device, it shall determine whether a node descriptor for that device is
639 * available. If a node descriptor is not available for the child indicated by the
640 * NWKAddrOfInterest field, the remote device shall set the Status field to
641 * NO_DESCRIPTOR and not include the NodeDescriptor field.\n\n If a node descriptor
642 * is available for the child indicated by the NWKAddrOfInterest field, the remote
643 * device shall set the Status field to SUCCESS and include the node descriptor
644 * of the matching child device in the NodeDescriptor field.
648 * @param[out] status #ZB_ZDP_SUCCESS \n
649 * #ZB_ZDP_DEVICE_NOT_FOUND \n
650 * #ZB_ZDP_INV_REQUESTTYPE \n
651 * #ZB_ZDP_NO_DESCRIPTOR
652 * @param[out] addr16 Network address for the request
653 * @param[out] node_desc This field shall only be included in the frame if the
654 * status field is equal to ZB_ZDP_SUCCESS.
655 * @param[out] user_data user data
657 * @see zb_zdo_node_desc_req()
659 typedef void (*zb_zdo_node_desc_rsp)(
660 unsigned char status,
662 const zb_zdo_node_descriptor_h node_desc,
666 * @brief Node descriptor request
667 * @details The Node_Desc_req command is generated from a local device wishing to inquire
668 * as to the node descriptor of a remote device. This command shall be unicast either
669 * to the remote device itself or to an alternative device that contains the discovery
670 * information of the remote device.
672 * The local device shall generate the Node_Desc_req command using the format
673 * illustrated in param list. The NWKAddrOfInterest field shall contain the network
674 * address of the remote device for which the node descriptor is required.
678 * @param[in] handle The handle of zigbee
679 * @param[in] addr16 Network address for device of interest
680 * @param[in] cb Response callback
681 * @param[in] user_data user data
683 * @return 0 on success, otherwise a negative error value.
684 * @retval #ZIGBEE_ERROR_NONE Successful
685 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
686 * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
687 * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
688 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
690 * @see zb_zdo_node_desc_rsp()
692 int zb_zdo_node_desc_req(
695 zb_zdo_node_desc_rsp cb,
699 * @brief Power descriptor response
700 * @details The Power_Desc_rsp is generated by a remote device in response to a
701 * Power_Desc_req directed to the remote device. This command shall be unicast to
702 * the originator of the Power_Desc_req command.\n
704 * The remote device shall generate the Power_Desc_rsp command using the format
705 * illustrated in Table 2.93. The NWKAddrOfInterest field shall match that specified
706 * in the original Power_Desc_req command. If the NWKAddrOfInterest field
707 * matches the network address of the remote device, it shall set the Status field to
708 * SUCCESS and include its power descriptor in the PowerDescriptor field.
709 * If the NWKAddrOfInterest field does not match the network address of the
710 * remote device and it is an end device, it shall set the Status field to
711 * INV_REQUESTTYPE and not include the PowerDescriptor field. If the
712 * NWKAddrOfInterest field does not match the network address of the remote
713 * device and it is the coordinator or a router, it shall determine whether the
714 * NWKAddrOfInterest field matches the network address of one of its children. If
715 * the NWKAddrOfInterest field does not match the network address of one of the
716 * children of the remote device, it shall set the Status field to
717 * DEVICE_NOT_FOUND and not include the PowerDescriptor field.\n\n If the
718 * NWKAddrOfInterest matches the network address of one of the children of the
719 * remote device, it shall determine whether a power descriptor for that device is
720 * available. If a power descriptor is not available for the child indicated by the
721 * NWKAddrOfInterest field, the remote device shall set the Status field to
722 * NO_DESCRIPTOR and not include the PowerDescriptor field.\n\n If a power
723 * descriptor is available for the child indicated by the NWKAddrOfInterest field,
724 * the remote device shall set the Status field to SUCCESS and include the power
725 * descriptor of the matching child device in the PowerDescriptor field.
729 * @param[out] status #ZB_ZDP_SUCCESS \n
730 * #ZB_ZDP_DEVICE_NOT_FOUND \n
731 * #ZB_ZDP_INV_REQUESTTYPE \n
732 * #ZB_ZDP_NO_DESCRIPTOR
733 * @param[out] addr16 Network address for the request
734 * @param[out] power_desc This field shall only be included in the frame if the
735 * @ status field is equal to ZB_ZDP_SUCCESS.
736 * @param[out] user_data user data
738 * @see zb_zdo_power_desc_req()
740 typedef void (*zb_zdo_power_desc_rsp)(
741 unsigned char status,
743 const zb_zdo_node_power_descriptor_h power_desc,
747 * @brief Power descriptor request
748 * @details The Power_Desc_req command is generated from a local device wishing to
749 * inquire as to the power descriptor of a remote device. This command shall be
750 * unicast either to the remote device itself or to an alternative device that contains
751 * the discovery information of the remote device.
753 * The local device shall generate the Power_Desc_req command using the format
754 * illustrated in param list. The NWKAddrOfInterest field shall contain the network
755 * address of the remote device for which the power descriptor is required.
759 * @param[in] handle The handle of zigbee
760 * @param[in] addr16 Network address for device of interest
761 * @param[in] cb Response callback
762 * @param[in] user_data user data
764 * @return 0 on success, otherwise a negative error value.
765 * @retval #ZIGBEE_ERROR_NONE Successful
766 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
767 * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
768 * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
769 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
771 * @see zb_zdo_power_desc_rsp()
773 int zb_zdo_power_desc_req(
776 zb_zdo_power_desc_rsp cb,
780 * @brief Complex descriptor response
781 * @details The Complex_Desc_rsp is generated by a remote device in response to a
782 * Complex_Desc_req directed to the remote device. This command shall be unicast
783 * to the originator of the Complex_Desc_req command.
784 * The remote device shall generate the Complex_Desc_rsp command using the
785 * format illustrated in param list. The NWKAddrOfInterest field shall match that
786 * specified in the original Complex_Desc_req command. If the
787 * NWKAddrOfInterest field matches the network address of the remote device but a
788 * complex descriptor does not exist, it shall set the Status field to
789 * NOT_SUPPORTED, set the Length field to 0, and not include the
790 * ComplexDescriptor field. If the NWKAddrOfInterest field matches the network
791 * address of the remote device and a complex descriptor exists, it shall set the Status
792 * field to SUCCESS, set the Length field to the length of the complex descriptor,
793 * and include its complex descriptor (see sub-clause 2.3.2.6) in the
794 * ComplexDescriptor field.\n
796 * If the NWKAddrOfInterest field does not match the network address of the
797 * remote device and it is an end device, it shall set the Status field to
798 * INV_REQUESTTYPE, set the Length field to 0, and not include the
799 * ComplexDescriptor field. If the NWKAddrOfInterest field does not match the
800 * network address of the remote device and it is the coordinator or a router, it shall
801 * determine whether the NWKAddrOfInterest field matches the network address of
802 * one of its children. If the NWKAddrOfInterest field does not match the network
803 * address of one of the children of the remote device, it shall set the Status field to
804 * DEVICE_NOT_FOUND, set the Length field to 0, and not include the
805 * ComplexDescriptor field.\n\n If the NWKAddrOfInterest matches the network
806 * address of one of the children of the remote device, it shall determine whether a
807 * complex descriptor for that device is available. If a complex descriptor is not
808 * available for the child indicated by the NWKAddrOfInterest field, the remote
809 * device shall set the Status field to NO_DESCRIPTOR, set the Length field to 0,
810 * and not include the ComplexDescriptor field.\n\n If a complex descriptor is available
811 * for the child indicated by the NWKAddrOfInterest field, the remote device shall
812 * set the Status field to SUCCESS, set the Length field to the length of the complex
813 * descriptor for that device, and include the complex descriptor of the matching
814 * child device in the ComplexDescriptor field.
818 * @param[out] status #ZB_ZDP_SUCCESS \n
819 * #ZB_ZDP_NOT_SUPPORTED \n
820 * #ZB_ZDP_DEVICE_NOT_FOUND \n
821 * #ZB_ZDP_INV_REQUESTTYPE \n
822 * #ZB_ZDP_NO_DESCRIPTOR
823 * @param[out] addr16 Network address for the request
824 * @param[out] length Length in bytes of the complex_desc field
825 * @param[out] complex_desc This field shall only be included in the frame if the
826 * @ status field is equal to ZB_ZDP_SUCCESS.
827 * @param[out] user_data user data
829 * @see zb_zdo_complex_desc_req()
831 typedef void (*zb_zdo_complex_desc_rsp)(
832 unsigned char status,
834 unsigned char length,
835 unsigned char *complex_desc,
839 * @brief Complex descriptor request
840 * @details The Complex_Desc_req command is generated from a local device wishing to
841 * inquire as to the complex descriptor of a remote device. This command shall be
842 * unicast either to the remote device itself or to an alternative device that contains
843 * the discovery information of the remote device.
845 * The local device shall generate the Complex_Desc_req command using the
846 * format illustrated in param list. The NWKAddrOfInterest field shall contain the
847 * network address of the remote device for which the complex descriptor is
852 * @param[in] handle The handle of zigbee
853 * @param[in] addr16 Network address for device of interest
854 * @param[in] cb Response callback
855 * @param[in] user_data user data
857 * @return 0 on success, otherwise a negative error value.
858 * @retval #ZIGBEE_ERROR_NONE Successful
859 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
860 * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
861 * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
862 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
864 * @see zb_zdo_complex_desc_rsp()
866 int zb_zdo_complex_desc_req(
869 zb_zdo_complex_desc_rsp cb,
873 * @brief User descriptor response
874 * @details The User_Desc_rsp is generated by a remote device in response to a
875 * User_Desc_req directed to the remote device. This command shall be unicast to
876 * the originator of the User_Desc_req command.\n
878 * The remote device shall generate the User_Desc_rsp command using the format
879 * illustrated in Table 2.98. The NWKAddrOfInterest field shall match that specified
880 * in the original User_Desc_req command. If the NWKAddrOfInterest field
881 * matches the network address of the remote device but a user descriptor does not
882 * exist, it shall set the Status field to NO_DESCRIPTOR, set the Length field to 0,
883 * and not include the UserDescriptor field. If the NWKAddrOfInterest field
884 * matches the network address of the remote device and a user descriptor exists, it
885 * shall set the Status field to SUCCESS, set the Length field to the length of the user
886 * descriptor, and include its user descriptor in the UserDescriptor field.
887 * If the NWKAddrOfInterest field does not match the network address of the
888 * remote device and it is an end device, it shall set the Status field to
889 * INV_REQUESTTYPE, set the Length field to 0, and not include the
890 * UserDescriptor field.\n\n If the NWKAddrOfInterest field does not match the network
891 * address of the remote device and it is the coordinator or a router, it shall determine
892 * whether the NWKAddrOfInterest field matches the network address of one of its
893 * children.\n\n If the NWKAddrOfInterest field does not match the network address of
894 * one of the children of the remote device, it shall set the Status field to
895 * DEVICE_NOT_FOUND, set the Length field to 0, and not include the
896 * UserDescriptor field.\n\n If the NWKAddrOfInterest matches the network address of
897 * one of the children of the remote device, it shall determine whether a user
898 * descriptor for that device is available.\n\n If a user descriptor is not available for the
899 * child indicated by the NWKAddrOfInterest field, the remote device shall set the
900 * Status field to NO_DESCRIPTOR, set the Length field to 0, and not include the
901 * UserDescriptor field.\n\n If a user descriptor is available for the child indicated by the
902 * NWKAddrOfInterest field, the remote device shall set the Status field to
903 * SUCCESS, set the Length field to the length of the user descriptor for that device,
904 * and include the user descriptor of the matching child device in the UserDescriptor
909 * @param[out] status #ZB_ZDP_SUCCESS \n
910 * #ZB_ZDP_NOT_SUPPORTED \n
911 * #ZB_ZDP_DEVICE_NOT_FOUND \n
912 * #ZB_ZDP_INV_REQUESTTYPE \n
913 * #ZB_ZDP_NO_DESCRIPTOR
914 * @param[out] addr16 Network address for the request
915 * @param[out] length Length in bytes of the user_desc field
916 * @param[out] user_desc This field shall only be included in the frame if the
917 * status field is equal to ZB_ZDP_SUCCESS.
918 * @param[out] user_data user data
920 * @see zb_zdo_user_desc_req()
922 typedef void (*zb_zdo_user_desc_rsp)(
923 unsigned char status,
926 unsigned char *user_desc,
930 * @brief Complex descriptor request
931 * @details The User_Desc_req command is generated from a local device wishing to inquire
932 * as to the user descriptor of a remote device. This command shall be unicast either
933 * to the remote device itself or to an alternative device that contains the discovery
934 * information of the remote device.
936 * The local device shall generate the User_Desc_req command using the format
937 * illustrated in Table 2.53. The NWKAddrOfInterest field shall contain the network
938 * address of the remote device for which the user descriptor is required.
942 * @param[in] handle The handle of zigbee
943 * @param[in] addr16 Network address for device of interest
944 * @param[in] cb Response callback
945 * @param[in] user_data user data
947 * @return 0 on success, otherwise a negative error value.
948 * @retval #ZIGBEE_ERROR_NONE Successful
949 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
950 * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
951 * @retval #ZIGBEE_ERROR_OUT_OF_MEMORY Out-of-memory
952 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
954 * @see zb_zdo_complex_desc_rsp()
956 int zb_zdo_user_desc_req(
959 zb_zdo_user_desc_rsp cb,
962 * @brief User descriptor confirm response
963 * @details The User_Desc_conf is generated by a remote device in response to a
964 * User_Desc_set directed to the remote device. This command shall be unicast to
965 * the originator of the User_Desc_set command.
967 * The remote device shall generate the User_Desc_conf command using the format
968 * illustrated in param list. The NWKAddrOfInterest field shall match that
969 * specified in the original User_Desc_set command. If the NWKAddrOfInterest
970 * field matches the network address of the remote device but a user descriptor does
971 * not exist, it shall set the Status field to NOT_SUPPORTED. If the
972 * NWKAddrOfInterest field matches the network address of the remote device and
973 * a user descriptor exists, it shall set the Status field to SUCCESS and configure the
974 * user descriptor with the ASCII character string specified in the original
975 * User_Desc_set command.\n
977 * If the NWKAddrOfInterest field does not match the network address of the
978 * remote device and it is an end device, it shall set the Status field to
979 * INV_REQUESTTYPE.\n\n If the NWKAddrOfInterest field does not match the
980 * network address of the remote device and it is the coordinator or a router, it shall
981 * determine whether the NWKAddrOfInterest field matches the network address of
982 * one of its children. If the NWKAddrOfInterest field does not match the network
983 * address of one of the children of the remote device, it shall set the Status field to
984 * DEVICE_NOT_FOUND.\n\n If the NWKAddrOfInterest matches the network
985 * address of one of the children of the remote device, it shall determine whether a
986 * user descriptor for that device is available. If a user descriptor is not available for
987 * the child indicated by the NWKAddrOfInterest field, the remote device shall set
988 * the Status field to NO_DESCRIPTOR.\n\n If a user descriptor is available for the
989 * child indicated by the NWKAddrOfInterest field, the remote device shall set the
990 * Status field to SUCCESS and configure the user descriptor with the ASCII
991 * character string specified in the original User_Desc_set command.
995 * @param[out] status #ZB_ZDP_SUCCESS \n
996 * returned value from NLME-GET.confirm primitive \n
997 * @param[out] user_data user data
999 * @see zb_zdo_user_desc_req()
1001 typedef void (*zb_zdo_user_desc_conf)(
1002 unsigned char status,
1006 * @brief User descriptor set request
1007 * @details The User_Desc_set command is generated from a local device wishing to
1008 * configure the user descriptor on a remote device. This command shall be unicast
1009 * either to the remote device itself or to an alternative device that contains the
1010 * discovery information of the remote device.
1012 * The local device shall generate the User_Desc_set command using the format
1013 * illustrated in param list. The NWKAddrOfInterest field shall contain the network
1014 * address of the remote device for which the user descriptor is to be configured and
1015 * the UserDescription field shall contain the ASCII character string that is to be
1016 * configured in the user descriptor. Characters with ASCII codes numbered 0x00
1017 * through 0x1f are not permitted to be included in this string.
1021 * @param[in] handle The handle of zigbee
1022 * @param[in] addr16 Network address for device of interest
1023 * @param[in] len Length of the user_desc filed in bytes
1024 * @param[in] user_desc Pointer of user description
1025 * @param[in] cb Response callback
1026 * @param[in] user_data user data
1028 * @return 0 on success, otherwise a negative error value.
1029 * @retval #ZIGBEE_ERROR_NONE Successful
1030 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1031 * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
1032 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1034 * @see zb_zdo_user_desc_conf()
1036 int zb_zdo_user_desc_set(
1040 unsigned char *user_desc,
1041 zb_zdo_user_desc_conf cb,
1045 * @brief device announce request
1046 * @details The Device_annce is provided to enable ZigBee devices on the network to notify
1047 * other ZigBee devices that the device has joined or re-joined the network,
1048 * identifying the device's 64-bit IEEE address and new 16-bit NWK address, and
1049 * informing the Remote Devices of the capability of the ZigBee device.\n\n This
1050 * command shall be invoked for all ZigBee end devices upon join or rejoin. This
1051 * command may also be invoked by ZigBee routers upon join or rejoin as part of
1052 * NWK address conflict resolution.\n\n The destination addressing on this primitive is
1053 * broadcast to all devices for which macRxOnWhenIdle = TRUE.
1057 * @param[in] handle The handle of zigbee
1058 * @param[in] addr16 Network address for device of interest
1059 * @param[in] addr64 The IEEE address for device of interest
1060 * @param[in] capability See zb_zdo_mac_capability_field_e in zb-zdo.h header file
1062 * @return 0 on success, otherwise a negative error value.
1063 * @retval #ZIGBEE_ERROR_NONE Successful
1064 * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
1065 * @retval #ZIGBEE_ERROR_INVALID_ADDRESS Invalid address
1066 * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error
1068 * @see zb_zdo_user_desc_conf()
1070 int zb_zdo_device_annce(
1074 unsigned char capability);
1084 #endif /* __TIZEN_NETWORK_ZIGBEE_ZDO_DEVICE_DISCOVERY_H__ */