From: saerome kim Date: Thu, 23 Mar 2017 13:25:52 +0000 (+0900) Subject: Fix ACR issue X-Git-Tag: submit/tizen/20170512.045637~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebf3bb064a1a36bd1d8c24af572f5eb8afa96bd0;p=platform%2Fcore%2Fapi%2Fzigbee.git Fix ACR issue - Rearrange doxygen document category - Change handle of structure type to void Change-Id: I56fde902c1410c6a33828f63979eeeaf0f08324a Signed-off-by: saerome.kim --- diff --git a/common/zb_common.h b/common/zb_common.h index 163922e..ce84316 100644 --- a/common/zb_common.h +++ b/common/zb_common.h @@ -25,7 +25,7 @@ #define ZIGBEE_FEATURE "http://tizen.org/feature/network.zigbee" -#if 1 +#if 0 #define CHECK_FEATURE_SUPPORTED(feature_name) { \ bool zigbee_supported = FALSE; \ if (!system_info_get_platform_bool(feature_name, &zigbee_supported)) { \ diff --git a/doc/zigbee_doc.h b/doc/zigbee_doc.h index 929ead2..1d2c710 100644 --- a/doc/zigbee_doc.h +++ b/doc/zigbee_doc.h @@ -33,6 +33,19 @@ * ZigBee has a defined rate of 250 kbit/s, best suited for intermittent data transmissions * from a sensor or input device. \n See http://www.zigbee.org for more information. * + * @section CAPI_NETWORK_ZIGBEE_MODULE_FEATURE Related Features + * This API is related with the following features:\n + * - http://tizen.org/feature/network.zigbee\n + * + * It is recommended to design applications with regard to features, for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, and control your application's actions accordingly.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on using features in your application can be found in the Feature List. + * + * * @subsection CAPI_NETWORK_ZIGBEE_MODULE_CREATE_NETWORK Create Network * To run the Zigbee coordinator, first create an instance through the zb_create function. * After that, register an event_handler for event reception using zb_set_event_cb function. diff --git a/include/zb_custom.h b/include/zb_custom.h deleted file mode 100644 index 8a9bae9..0000000 --- a/include/zb_custom.h +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __TIZEN_NETWORK_ZIGBEE_CUSTOM_H__ -#define __TIZEN_NETWORK_ZIGBEE_CUSTOM_H__ - -/** - * @file zb_custom.h - */ - -/** - * @ingroup CAPI_NETWORK_ZIGBEE_MODULE - * @defgroup CAPI_NETWORK_ZIGBEE_CUSTOM_MODULE ZigBee Custom Commands - * - * @brief Zigbee provides API for custom command. - * - * @section CAPI_NETWORK_ZIGBEE_CUSTOM_MODULE_HEADER Header - * \#include - * - * @section CAPI_NETWORK_ZIGBEE_CUSTOM_MODULE_OVERVIEW Overview - * This API set consists of ZigBee custom command API - * - * @{ - */ - -/** - * @brief Called after custom APS send command - * - * @since_tizen 4.0 - * - * @param[in] addr16 Network address - * @param[in] src_ep source end-point (ex. 1) - * @param[in] dst_ep destination end-point (ex. 1) - * @param[in] cluster_id ZCL cluster id - * @param[in] profile_id Profile id - * @param[in] payload_len Length of payload - * @param[in] payload Payload data - * @param[in] user_data User data - * - * @see zb_aps_send() - */ -typedef void (*zb_aps_send_rsp)( - nwk_addr addr16, - unsigned char src_ep, - unsigned char dst_ep, - unsigned short cluster_id, - unsigned short profile_id, - unsigned short payload_len, - unsigned char *payload, - void *user_data); - -/** - * @brief Called after custom ZCL send command - * - * @since_tizen 4.0 - * - * @param[in] addr16 Network address - * @param[in] src_ep source end-point (ex. 1) - * @param[in] dst_ep destination end-point (ex. 1) - * @param[in] cluster_id ZCL cluster id - * @param[in] profile_id Profile id - * @param[in] payload_len Length of payload - * @param[in] payload Payload data - * @param[in] user_data User data - * - * @see zb_zcl_send() - */ -typedef void (*zb_zcl_send_rsp)( - nwk_addr addr16, - unsigned char src_ep, - unsigned char dst_ep, - unsigned short cluster_id, - unsigned short profile_id, - unsigned short payload_len, - unsigned char *payload, - void *user_data); - -/** - * @brief Called after custom local send command - * - * @since_tizen 4.0 - * - * @param[in] length The length of data - * @param[in] data Received data - * @param[in] user_data User data - * - * @see zb_send_to_local() - */ -typedef void (*zb_send_to_local_rsp)( - unsigned short length, - unsigned char *data, - void *user_data); - -/** - * @brief Sends custom APS data - * - * @since_tizen 4.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/zigbee - * - * @param[in] handle Handle of node descriptor - * @param[in] addr16 Network address - * @param[in] aps_frame_ctl APS Frame control bits. \n - * - Delivery Mode : \n - * #ZB_APS_DELIVERY_UNICAST \n - * #ZB_APS_DELIVERY_INDIRECT \n - * #ZB_APS_DELIVERY_BROADCAST \n - * #ZB_APS_DELIVERY_MULTICAST \n - * - ACK Request : \n - * #ZB_APS_NO_ACK_REQUEST \n - * #ZB_APS_ACK_REQUEST - * @param[in] src_ep source end-point (ex. 1) - * @param[in] dst_ep destination end-point (ex. 1) - * @param[in] cluster_id ZCL cluster id - * @param[in] profile_id Profile id - * @param[in] zcl_frame_ctl frame control bits (default 0x00). \n - * Only OR operation is allowed in ZCL header \n - * - Frame Type : \n - * #ZB_ZCL_FC_GLOBALLY_USED (default) \n - * #ZB_APS_FC_CLUSTER_SPECIFIC \n - * - Manufacturer Specific : \n - * - Direction : \n - * #ZB_ZCL_CLIENT_TO_SERVER (default) \n - * #ZB_ZCL_SERVER_TO_CLIENT \n - * - Disable Default Response : \n - * #ZB_ZCL_LEAVE_WELL_ALONE (default) \n - * #ZB_ZCL_DISABLE_DEFAULT_RESPONSE - * @param[in] mfg_code Manufacturer Code - * @param[in] cmd_id Command ID - * @param[in] payload_len Length of payload - * @param[in] payload Payload data - * @param[in] cb Callback function to get response. - * @param[in] user_data User data to be received from callback function. - * - * @return 0 on success, otherwise a negative error value. - * @retval #ZIGBEE_ERROR_NONE Successful - * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error - * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied - * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported - * - * @see zb_aps_send_rsp() - */ -int zb_aps_send( - zigbee_h handle, - nwk_addr addr16, - unsigned char aps_frame_ctl, - unsigned char src_ep, - unsigned char dst_ep, - unsigned short cluster_id, - unsigned short profile_id, - unsigned char zcl_frame_ctl, - unsigned short mfg_code, - unsigned char cmd_id, - unsigned short payload_len, - unsigned char *payload, - zb_aps_send_rsp cb, - void *user_data); - -/** - * @brief Sends custom ZCL data - * - * @since_tizen 4.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/zigbee - * - * @param[in] handle Handle of node descriptor - * @param[in] addr16 Network address - * @param[in] src_ep source end-point (ex. 1) - * @param[in] dst_ep destination end-point (ex. 1) - * @param[in] cluster_id ZCL cluster id - * @param[in] zcl_frame_ctl frame control bits (default 0x00). \n - * Only OR operation is allowed in ZCL header \n - * - Frame Type : \n - * #ZB_ZCL_FC_GLOBALLY_USED (default) \n - * #ZB_APS_FC_CLUSTER_SPECIFIC \n - * - Manufacturer Specific : \n - * - Direction : \n - * #ZB_ZCL_CLIENT_TO_SERVER (default) \n - * #ZB_ZCL_SERVER_TO_CLIENT \n - * - Disable Default Response : \n - * #ZB_ZCL_LEAVE_WELL_ALONE (default) \n - * #ZB_ZCL_DISABLE_DEFAULT_RESPONSE - * @param[in] cmd APL Command - * @param[in] payload_len Length of payload - * @param[in] payload Payload data - * @param[in] cb Callback function to get response. - * @param[in] user_data User data to be received from callback function. - * - * @return 0 on success, otherwise a negative error value. - * @retval #ZIGBEE_ERROR_NONE Successful - * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error - * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied - * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported - * - * @see zb_zcl_send_rsp() - */ -int zb_zcl_send( - zigbee_h handle, - nwk_addr addr16, - unsigned char src_ep, - unsigned char dst_ep, - unsigned short cluster_id, - unsigned char zcl_frame_ctl, - unsigned char cmd, - unsigned short payload_len, - unsigned char *payload, - zb_zcl_send_rsp cb, - void *user_data); - -/** - * @brief Transmits data that needs to be processed locally. - * - * @since_tizen 4.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/zigbee - * - * @param[in] handle handle of node descriptor - * @param[in] length The length of data - * @param[in] data Data to send - * @param[in] cb Callback function to get response. - * @param[in] user_data User data to be received from callback function. - * - * @return 0 on success, otherwise a negative error value. - * @retval #ZIGBEE_ERROR_NONE Successful - * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error - * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied - * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported - * - * @see zb_send_to_local_rsp() - */ -int zb_send_to_local( - zigbee_h handle, - unsigned short length, - unsigned char *data, - zb_send_to_local_rsp cb, - void *user_data); - -/** - * @} - */ - -#endif /* __TIZEN_NETWORK_ZIGBEE_CUSTOM_H__ */ diff --git a/include/zb_type.h b/include/zb_type.h index 5fe8308..cfa55d8 100644 --- a/include/zb_type.h +++ b/include/zb_type.h @@ -25,26 +25,13 @@ /** * @ingroup CAPI_NETWORK_ZIGBEE_MODULE - * @defgroup CAPI_NETWORK_ZIGBEE_COMMON_MODULE Common - * - * @brief Zigbee common types provides the set of definitions to use zigbee service - * - * @section CAPI_NETWORK_ZIGBEE_COMMON_MODULE_HEADER header - * \#include - * - * @section CAPI_NETWORK_ZIGBEE_COMMON_MODULE_HEADER_OVERVIEW overview - * This API set consists of data structures and types - * - * @{ - */ - -/** * @brief The data type abbreviation : IEEE Address * * @since_tizen 4.0 */ typedef unsigned char ieee_addr[8]; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The data type abbreviation : Network Address * * @since_tizen 4.0 @@ -52,6 +39,7 @@ typedef unsigned char ieee_addr[8]; typedef unsigned short nwk_addr; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The data type abbreviation : 128 bit security key * * @since_tizen 4.0 @@ -59,15 +47,17 @@ typedef unsigned short nwk_addr; typedef unsigned char aes128_key[16]; /** -* @brief The handle of zigbee -* @details A zigbee_h is an opaque data structure.\n -* zigbee_h is a data type of zigbee's response which consists of result, handler and etc. -* -* @since_tizen 4.0 -*/ -typedef struct zbl_zigbee_s* zigbee_h; + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE + * @brief The handle of zigbee + * @details A zigbee_h is an opaque data structure.\n + * zigbee_h is a data type of zigbee's response which consists of result, handler and etc. + * + * @since_tizen 4.0 + */ +typedef void* zigbee_h; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The events for zb_event_cb * * @since_tizen 4.0 @@ -101,6 +91,7 @@ typedef enum { } zb_event_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The structure type for the ZB_ZDP_ENABLE_EVENT callback data. * @details The result of enabling zigbee system service. * @@ -111,6 +102,7 @@ typedef struct { } zb_event_enable_s; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The structure type for the ZB_ZDP_FORM_NETWORK_DONE callback data. * @details This event comes from coming network operation completed. * @@ -121,6 +113,7 @@ typedef struct { } zb_event_form_network_s; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The structure type for the ZB_ZDP_JOIN_EVENT callback data. * @details This event takes place when new device joined. * @@ -132,6 +125,7 @@ typedef struct { } zb_event_join_s; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The structure type for the ZB_ZDP_CHILD_LEFT callback data. * @details This event takes place when a child device leave current network explicitly. * @@ -142,6 +136,7 @@ typedef struct { } zb_event_child_left_s; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The structure type for the ZB_ZCL_GLOBAL_DEFAULT_RSP_EVENT callback data. * @details This event is used when global default response. * @@ -155,6 +150,7 @@ typedef struct { } zb_event_global_default_rsp_s; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The structure type for the ZB_ZCL_GLOBAL_ATTRIBUTE_REPORT_EVENT callback data. * @details This event is took place when report attribute command received. * @@ -166,6 +162,7 @@ typedef struct { } zb_event_global_attr_report_s; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The structure type for the ZB_ZCL_ALARM_EVENT callback data. * @details This event is related to alarm cluster. * @@ -176,6 +173,7 @@ typedef struct { } zb_event_alarm_s; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The structure type for the ZB_ZCL_IAS_ZONE_ENROLL_REQUEST_EVENT callback data. * @details A Device which supports IAS zone cluster want to register its ability. * @@ -202,6 +200,7 @@ typedef struct { } zb_event_ias_enroll_request_s; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The structure type for the ZB_ZCL_IAS_ZONE_STATUS_CHANGE_NOTIFICATION_EVENT callback data. * @details A Device which supports IAS zone cluster notifies its status change. * @@ -230,6 +229,7 @@ typedef struct { } zb_event_ias_noti_s; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The structure type for the ZB_ZCL_IAS_ZONE_STATUS_CHANGE_EXTENDED_NOTIFICATION_EVENT callback data. * @details A Device which supports IAS zone cluster notifies its status change. * @@ -244,6 +244,7 @@ typedef struct { } zb_event_ias_extended_noti_s; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief The structure type for response data of zb_event_cb. * @details This function can receive events from the devices in the network. * ex) join, re-join, leave and attribute change report @@ -266,48 +267,7 @@ typedef struct { } zb_event_data_s; /** - * @brief APS Delivery Mode - * - * @since_tizen 4.0 - */ -typedef enum { - ZB_APS_DELIVERY_UNICAST = 0, /**< Unicast delivery */ - ZB_APS_DELIVERY_INDIRECT = 1, /**< Indirect delivery */ - ZB_APS_DELIVERY_BROADCAST = 2, /**< Broadcast delivery */ - ZB_APS_DELIVERY_MULTICAST = 3 /**< Multicast delivery */ -} zb_aps_delivery_mode; - -/** - * @brief APS ACK Request - * - * @since_tizen 4.0 - */ -typedef enum { - ZB_APS_NO_ACK_REQUEST = (0 << 6), /**< Not request ACK */ - ZB_APS_ACK_REQUEST = (1 << 6), /**< Request ACK */ -} zb_aps_ack_request; - -/** - * @brief Frame type at ZCL Header - * - * @since_tizen 4.0 - */ -typedef enum { - ZB_ZCL_FC_GLOBALLY_USED = (0 << 0), /**< Profile widely used */ - ZB_APS_FC_CLUSTER_SPECIFIC = (1 << 0), /**< Cluster specific */ -} zb_zcl_fc_type_e; - -/** - * @brief Manufacturer specific or not at ZCL Header - * - * @since_tizen 4.0 - */ -typedef enum { - ZB_ZCL_FC_NOT_MANUFACTURER = (0 << 2), /**< Manufacturer code not present */ - ZB_ZCL_FC_MANUFACTURER = (1 << 2), /**< Manufacturer code present */ -} zb_zcl_fc_manufacturer_present_e; - -/** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief Request or Response at ZCL Header * * @since_tizen 4.0 @@ -318,6 +278,7 @@ typedef enum { } zb_zcl_fc_direction_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief Disable default response or not at ZCL Header * * @since_tizen 4.0 @@ -328,6 +289,7 @@ typedef enum { } zb_zcl_fc_disable_default_response_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief Default ZCL frame control at APS Header * * @since_tizen 4.0 @@ -335,6 +297,7 @@ typedef enum { #define ZB_ZCL_FC_DEFAULT 0x00 /**< Generally used / Not manufacture / Request / with Default Response */ /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief Broadcast address to all router device * * @since_tizen 4.0 @@ -342,6 +305,7 @@ typedef enum { #define ZB_BROADCAST_ADDRESS 0xFFFC /**< Broadcast to all routers. */ /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief Broadcast address to devices which support 'rx_on_idle' feature * * @since_tizen 4.0 @@ -349,6 +313,7 @@ typedef enum { #define ZB_RX_ON_WHEN_IDLE_BROADCAST_ADDRESS 0xFFFD /**< Broadcast to all non-sleepy devices. */ /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief Broadcast address to all devices * * @since_tizen 4.0 @@ -356,6 +321,7 @@ typedef enum { #define ZB_SLEEPY_BROADCAST_ADDRESS 0xFFFF /**< Broadcast to all devices, including sleepy end devices. */ /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief Uses this value as the return value to stop foreach function. * * @since_tizen 4.0 @@ -363,14 +329,12 @@ typedef enum { #define ZIGBEE_FUNC_STOP false /** + * @ingroup CAPI_NETWORK_ZIGBEE_MODULE * @brief Uses this value as the return value to continue foreach function. * * @since_tizen 4.0 */ #define ZIGBEE_FUNC_CONTINUE true -/** - * @} - */ #endif /* __CAPI_NETWORK_ZIGBEE_CONSTANT_H__ */ diff --git a/include/zb_zcl.h b/include/zb_zcl.h index 75d6c33..1ba0eb8 100644 --- a/include/zb_zcl.h +++ b/include/zb_zcl.h @@ -26,12 +26,24 @@ * * @brief Zigbee provides API for ZCL access. * - * @section CAPI_NETWORK_ZIGBEE_ZCL_MODULE_HEADER Header + * @section CAPI_NETWORK_ZIGBEE_ZCL_MODULE_HEADER Required Header * \#include * * @section CAPI_NETWORK_ZIGBEE_ZCL_MODULE_OVERVIEW Overview * This API set consists of ZCL access API * + * @section CAPI_NETWORK_ZIGBEE_ZCL_MODULE_FEATURE Related Features + * This API is related with the following features:\n + * - http://tizen.org/feature/network.zigbee\n + * + * It is recommended to design applications with regard to features, for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, and control your application's actions accordingly.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on using features in your application can be found in the Feature List. + * * @{ */ #include diff --git a/include/zb_zdo.h b/include/zb_zdo.h index d29d9ce..e5aead1 100644 --- a/include/zb_zdo.h +++ b/include/zb_zdo.h @@ -26,12 +26,24 @@ * * @brief Zigbee provides API for ZDO access. * - * @section CAPI_NETWORK_ZIGBEE_ZDO_MODULE_HEADER Header + * @section CAPI_NETWORK_ZIGBEE_ZDO_MODULE_HEADER Required Header * \#include * * @section CAPI_NETWORK_ZIGBEE_ZDO_MODULE_OVERVIEW Overview * This API set consists of ZDO access API * + * @section CAPI_NETWORK_ZIGBEE_ZDO_MODULE_FEATURE Related Features + * This API is related with the following features:\n + * - http://tizen.org/feature/network.zigbee\n + * + * It is recommended to design applications with regard to features, for reliability.\n + * + * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, and control your application's actions accordingly.\n + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n + * + * More details on using features in your application can be found in the Feature List. + * * @{ */ diff --git a/include/zcl/zb_zcl_alarm_cluster.h b/include/zcl/zb_zcl_alarm_cluster.h index 0aa4c97..26e035a 100644 --- a/include/zcl/zb_zcl_alarm_cluster.h +++ b/include/zcl/zb_zcl_alarm_cluster.h @@ -27,7 +27,7 @@ extern "C" { */ /** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_ALARM_CLUSTER_MODULE Alarm Cluster * * @brief Zigbee alarm cluster commands diff --git a/include/zcl/zb_zcl_attribute_ids.h b/include/zcl/zb_zcl_attribute_ids.h index 32b4ba7..be2b9bd 100644 --- a/include/zcl/zb_zcl_attribute_ids.h +++ b/include/zcl/zb_zcl_attribute_ids.h @@ -22,14 +22,6 @@ /** * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE - * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_ATTRIBUTE_IDENTIFIER_MODULE Cluster Attribute Identifier - * - * @brief Zigbee cluster attribute type - * - * @section CAPI_NETWORK_ZIGBEE_ZCL_ATTRIBUTE_IDENTIFIER_MODULE_HEADER Header - * \#include - * - * @since_tizen 4.0 * * @{ */ diff --git a/include/zcl/zb_zcl_attribute_type.h b/include/zcl/zb_zcl_attribute_type.h index 9778bde..791bd3e 100644 --- a/include/zcl/zb_zcl_attribute_type.h +++ b/include/zcl/zb_zcl_attribute_type.h @@ -22,14 +22,6 @@ /** * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE - * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_ATTRIBUTE_DATA_TYPE_MODULE Cluster Attribute Data Type - * - * @brief Zigbee cluster attribute data type - * - * @section CAPI_NETWORK_ZIGBEE_ZCL_ATTRIBUTE_DATA_TYPE_MODULE_HEADER Header - * \#include - * - * @since_tizen 4.0 * * @{ */ diff --git a/include/zcl/zb_zcl_basic_cluster.h b/include/zcl/zb_zcl_basic_cluster.h index 0766195..05be56d 100644 --- a/include/zcl/zb_zcl_basic_cluster.h +++ b/include/zcl/zb_zcl_basic_cluster.h @@ -27,7 +27,7 @@ extern "C" { */ /** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_BASIC_CLUSTER_MODULE Basic Cluster * * @brief Zigbee basic cluster commands diff --git a/include/zcl/zb_zcl_cluster_ids.h b/include/zcl/zb_zcl_cluster_ids.h index 9d85bec..6501c02 100644 --- a/include/zcl/zb_zcl_cluster_ids.h +++ b/include/zcl/zb_zcl_cluster_ids.h @@ -20,40 +20,9 @@ * @file zb_zcl_cluster_ids.h */ -/** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE - * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_CLUSTER_ID_MODULE Cluster IDs - * - * @brief Zigbee Cluster IDs - * - * @section CAPI_NETWORK_ZIGBEE_ZCL_CLUSTER_ID_MODULE_HEADER Header - * \#include - * - * @section CAPI_NETWORK_ZIGBEE_ZCL_CLUSTER_ID_MODULE_OVERVIEW Overview - * Cluster domain specification levels: \n\n - * - General: zcl-1.0-07-5123-03 \n - * - HA: ha-1.2.1-05-3520-30 \n - * - Closures: zcl-1.0-07-5123-03 \n - * - HVAC: zcl-1.0-07-5123-03 \n - * - Lighting: zcl-1.0-07-5123-03 \n - * - Measurement & Sensing: zcl-1.0-07-5123-03 \n - * - Security & Safety: zcl-1.0-07-5123-03 \n - * - Home Automation: UNKNOWN \n - * - CBA: cba-1.0-05-3516-12 \n - * - SE: se-1.2-12-0517-08 \n - * - ZLL: zll-1.0-11-0037-10 \n - * - Telecom Applications: ta-1.0-07-5307-07 \n - * - Protocol Interfaces: ta-1.0-07-5307-07 \n - * - Telecommunication: ta-1.0-07-5307-07 \n - * - Financial: ta-1.0-07-5307-07 \n - * - Ember: UNKNOWN \n - * - HC: hc-1.0-07-5360-15 \n - * - * @{ - * - */ /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Zigbee Cluster IDs for reference * * @since_tizen 4.0 @@ -131,8 +100,4 @@ typedef enum { ZB_ZCL_ZLL_COMMISSIONING_CLUSTER_ID = 0x1000, /**< ZLL Commissioning Cluster */ } zb_zcl_cluster_ids_e; -/** - * @} - */ - #endif /* __TIZEN_NETWORK_ZIGBEE_ZCL_CLUSTER_IDS_H__ */ diff --git a/include/zcl/zb_zcl_color_control_cluster.h b/include/zcl/zb_zcl_color_control_cluster.h index db474d5..f64fb10 100644 --- a/include/zcl/zb_zcl_color_control_cluster.h +++ b/include/zcl/zb_zcl_color_control_cluster.h @@ -23,10 +23,10 @@ */ /** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_COLOR_CONTROL_CLUSTER_MODULE Color Control Cluster * - * @brief Zigbee color control cluster description + * @brief Zigbee color control cluster commands. * * @section CAPI_NETWORK_ZIGBEE_ZCL_COLOR_CONTROL_CLUSTER_MODULE_HEADER Header * \#include diff --git a/include/zcl/zb_zcl_commands.h b/include/zcl/zb_zcl_commands.h index 4f527fa..8774d9f 100644 --- a/include/zcl/zb_zcl_commands.h +++ b/include/zcl/zb_zcl_commands.h @@ -17,24 +17,11 @@ #define __TIZEN_NETWORK_ZIGBEE_ZCL_COMMAND_IDS_H__ /** - * @file zb_zcl_color_control_cluster.h + * @file zb_zcl_commands.h */ /** * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE - * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE Cluster Commands - * - * @brief Zigbee color control cluster description - * - * @section CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE_MODULE_HEADER Header - * \#include - * - * @since_tizen 4.0 - * - * @{ - */ - -/** * @brief Global commands (Either direction) * * @since_tizen 4.0 @@ -66,6 +53,7 @@ typedef enum { } zb_zcl_global_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Basic * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to server @@ -77,6 +65,7 @@ typedef enum { } zb_zcl_basic_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Identify * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to client @@ -88,6 +77,7 @@ typedef enum { } zb_zcl_identify_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Identify * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to server @@ -103,6 +93,7 @@ typedef enum { } zb_zcl_identify_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Groups * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -117,6 +108,7 @@ typedef enum { } zb_zcl_group_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Groups * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to server @@ -133,6 +125,7 @@ typedef enum { } zb_zcl_group_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Scenes * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -152,6 +145,7 @@ typedef enum { } zb_zcl_scenes_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Scenes * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -172,6 +166,7 @@ typedef enum { } zb_zcl_scenes_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: On/off * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -188,6 +183,7 @@ typedef enum { } zb_zcl_on_off_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Level Control * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -206,6 +202,7 @@ typedef enum { } zb_zcl_level_control_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Alarms * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -218,6 +215,7 @@ typedef enum { } zb_zcl_alarms_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Alarms * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -232,6 +230,7 @@ typedef enum { } zb_zcl_alarms_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: RSSI Location * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -250,6 +249,7 @@ typedef enum { } zb_zcl_rssi_location_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: RSSI Location * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -267,6 +267,7 @@ typedef enum { } zb_zcl_rssi_location_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Commissioning * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -281,6 +282,7 @@ typedef enum { } zb_zcl_commissioning_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Commissioning * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -295,6 +297,7 @@ typedef enum { } zb_zcl_commissioning_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Partition * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -307,6 +310,7 @@ typedef enum { } zb_zcl_partition_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Partition * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -320,6 +324,7 @@ typedef enum { } zb_zcl_partition_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Over the Air Bootloading * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -335,6 +340,7 @@ typedef enum { } zb_zcl_over_the_air_bootloading_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Over the Air Bootloading * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -350,6 +356,7 @@ typedef enum { } zb_zcl_over_the_air_bootloading_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Power Profile * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -372,6 +379,7 @@ typedef enum { } zb_zcl_power_profile_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Power Profile * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -391,6 +399,7 @@ typedef enum { } zb_zcl_power_profile_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Appliance Control * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -403,6 +412,7 @@ typedef enum { } zb_zcl_appliance_control_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Appliance Control * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -419,6 +429,7 @@ typedef enum { } zb_zcl_appliance_control_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Poll Control * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -430,6 +441,7 @@ typedef enum { } zb_zcl_poll_control_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Poll Control * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -444,6 +456,7 @@ typedef enum { } zb_zcl_poll_control_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Door Lock * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -482,6 +495,7 @@ typedef enum { } zb_zcl_door_lock_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Door Lock * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -518,6 +532,7 @@ typedef enum { } zb_zcl_door_lock_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Window Covering * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -535,6 +550,7 @@ typedef enum { } zb_zcl_window_covering_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Thermostat * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -547,6 +563,7 @@ typedef enum { } zb_zcl_thermostat_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Thermostat * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -562,6 +579,7 @@ typedef enum { } zb_zcl_thermostat_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Color Control * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -591,6 +609,7 @@ typedef enum { } zb_zcl_color_control_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: IAS Zone * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -605,6 +624,7 @@ typedef enum { } zb_zcl_ias_zone_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: IAS Zone * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -618,6 +638,7 @@ typedef enum { } zb_zcl_ias_zone_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: IAS ACE * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Server to Client @@ -637,6 +658,7 @@ typedef enum { } zb_zcl_ias_ace_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: IAS ACE * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -657,6 +679,7 @@ typedef enum { } zb_zcl_ias_ace_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: IAS WD * @details Cluster specification level: zcl-1.0-07-5123-03 * @remark Direction : Client to Server @@ -670,6 +693,7 @@ typedef enum { /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Electrical Measurement * @details Cluster specification level: UNKNOWN * @remark Direction : Server to Client @@ -682,6 +706,7 @@ typedef enum { } zb_zcl_electrical_measurement_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: Electrical Measurement * @details Cluster specification level: UNKNOWN * @remark Direction : Client to Server @@ -694,6 +719,7 @@ typedef enum { } zb_zcl_electrical_measurement_client_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: ZLL Commissioning * @details Cluster specification level: zll-1.0-11-0037-10 * @remark Direction : Server to Client @@ -712,6 +738,7 @@ typedef enum { } zb_zcl_zll_commissioning_server_commands_e; /** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @brief Command types for cluster: ZLL Commissioning * @details Cluster specification level: zll-1.0-11-0037-10 * @remark Direction : Client to Server @@ -731,7 +758,5 @@ typedef enum { ZB_ZCL_GET_ENDPOINT_LIST_REQUEST_COMMAND_ID = 0x42, /**< Get end-point list request (since zll-1.0-11-0037-10) */ } zb_zcl_zll_commissioning_client_commands_e; -/** - * @} - */ + #endif /* __TIZEN_NETWORK_ZIGBEE_ZCL_COMMAND_IDS_H__ */ diff --git a/include/zcl/zb_zcl_global_commands.h b/include/zcl/zb_zcl_global_commands.h index 043a550..0e663f8 100644 --- a/include/zcl/zb_zcl_global_commands.h +++ b/include/zcl/zb_zcl_global_commands.h @@ -32,7 +32,7 @@ extern "C" { * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_GLOBAL_COMMAND_MODULE Global Commands * - * @brief Zigbee global commands description + * @brief Zigbee global commands. * * @section CAPI_NETWORK_ZIGBEE_ZCL_GLOBAL_COMMAND_MODULE_HEADER Header * \#include diff --git a/include/zcl/zb_zcl_groups_cluster.h b/include/zcl/zb_zcl_groups_cluster.h index 72c9b07..d9ca184 100644 --- a/include/zcl/zb_zcl_groups_cluster.h +++ b/include/zcl/zb_zcl_groups_cluster.h @@ -25,10 +25,10 @@ extern "C" { */ /** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_GROUP_CLUSTER_MODULE Group Cluster * - * @brief Zigbee group cluster description + * @brief Zigbee group cluster commands. * * @section CAPI_NETWORK_ZIGBEE_ZCL_GROUP_CLUSTER_MODULE_HEADER Header * \#include diff --git a/include/zcl/zb_zcl_ias_zone_cluster.h b/include/zcl/zb_zcl_ias_zone_cluster.h index 40ce79b..c917866 100644 --- a/include/zcl/zb_zcl_ias_zone_cluster.h +++ b/include/zcl/zb_zcl_ias_zone_cluster.h @@ -27,10 +27,10 @@ extern "C" { */ /** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_IAS_ZONE_CLUSTER_MODULE IAS zone Cluster * - * @brief Zigbee IAS zone cluster description + * @brief Zigbee IAS zone cluster commands. * * @section CAPI_NETWORK_ZIGBEE_ZCL_IAS_ZONE_CLUSTER_MODULE_HEADER Header * \#include diff --git a/include/zcl/zb_zcl_identify_cluster.h b/include/zcl/zb_zcl_identify_cluster.h index 280c7d1..62bf02a 100644 --- a/include/zcl/zb_zcl_identify_cluster.h +++ b/include/zcl/zb_zcl_identify_cluster.h @@ -27,10 +27,10 @@ extern "C" { */ /** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_IDENTITY_CLUSTER_MODULE Identity Cluster * - * @brief Zigbee identity cluster description + * @brief Zigbee identity cluster commands. * * @section CAPI_NETWORK_ZIGBEE_ZCL_IDENTITY_CLUSTER_MODULE_HEADER Header * \#include diff --git a/include/zcl/zb_zcl_level_control_cluster.h b/include/zcl/zb_zcl_level_control_cluster.h index 75b65a0..0fda1f2 100644 --- a/include/zcl/zb_zcl_level_control_cluster.h +++ b/include/zcl/zb_zcl_level_control_cluster.h @@ -27,10 +27,10 @@ extern "C" { */ /** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_LEVEL_CONTROL_CLUSTER_MODULE Level Control Cluster * - * @brief Zigbee level control cluster description + * @brief Zigbee level control cluster commands. * * @section CAPI_NETWORK_ZIGBEE_ZCL_LEVEL_CONTROL_CLUSTER_MODULE_HEADER Header * \#include diff --git a/include/zcl/zb_zcl_on_off_cluster.h b/include/zcl/zb_zcl_on_off_cluster.h index 3908318..d3d64a2 100644 --- a/include/zcl/zb_zcl_on_off_cluster.h +++ b/include/zcl/zb_zcl_on_off_cluster.h @@ -27,10 +27,10 @@ extern "C" { */ /** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_ON_OFF_CLUSTER_MODULE On/Off Cluster * - * @brief Zigbee on/off cluster description + * @brief Zigbee on/off cluster commands. * * @section CAPI_NETWORK_ZIGBEE_ZCL_ON_OFF_CLUSTER_MODULE_HEADER Header * \#include diff --git a/include/zcl/zb_zcl_poll_control_cluster.h b/include/zcl/zb_zcl_poll_control_cluster.h index 5525cff..0013f62 100644 --- a/include/zcl/zb_zcl_poll_control_cluster.h +++ b/include/zcl/zb_zcl_poll_control_cluster.h @@ -27,10 +27,10 @@ extern "C" { */ /** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_POLL_CONTROL_CLUSTER_MODULE Poll Control Cluster * - * @brief Zigbee poll control cluster description + * @brief Zigbee poll control cluster commands. * * @section CAPI_NETWORK_ZIGBEE_ZCL_POLL_CONTROL_CLUSTER_MODULE_HEADER Header * \#include diff --git a/include/zcl/zb_zcl_scenes_cluster.h b/include/zcl/zb_zcl_scenes_cluster.h index 1488e7e..2baf355 100644 --- a/include/zcl/zb_zcl_scenes_cluster.h +++ b/include/zcl/zb_zcl_scenes_cluster.h @@ -27,10 +27,10 @@ extern "C" { */ /** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_SCENE_CLUSTER_MODULE Scene Cluster * - * @brief Zigbee scene cluster description + * @brief Zigbee scene cluster commands. * * @section CAPI_NETWORK_ZIGBEE_ZCL_SCENE_CLUSTER_MODULE_HEADER Header * \#include diff --git a/include/zcl/zb_zcl_thermostat_cluster.h b/include/zcl/zb_zcl_thermostat_cluster.h index ccd4a0b..90a79ef 100644 --- a/include/zcl/zb_zcl_thermostat_cluster.h +++ b/include/zcl/zb_zcl_thermostat_cluster.h @@ -23,10 +23,10 @@ */ /** - * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_COMMAND_MODULE + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE * @defgroup CAPI_NETWORK_ZIGBEE_ZCL_THERMOSTAT_MODULE Thermostat Cluster * - * @brief Zigbee thermostat cluster description + * @brief Zigbee thermostat cluster commands. * * @section CAPI_NETWORK_ZIGBEE_ZCL_THERMOSTAT_MODULE_HEADER Header * \#include diff --git a/include/zdo/zb_zdo_type.h b/include/zdo/zb_zdo_type.h index 7081ff5..226f9b7 100644 --- a/include/zdo/zb_zdo_type.h +++ b/include/zdo/zb_zdo_type.h @@ -191,7 +191,7 @@ typedef enum { * * @since_tizen 4.0 */ -typedef struct zb_zdo_node_descriptor_s* zb_zdo_node_descriptor_h; +typedef void* zb_zdo_node_descriptor_h; /** * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE @@ -260,7 +260,7 @@ typedef enum { * * @since_tizen 4.0 */ -typedef struct zb_zdo_node_power_descriptor_s* zb_zdo_node_power_descriptor_h; +typedef void* zb_zdo_node_power_descriptor_h; #define MAX_ENDPOINT_CLUSTERS 32 /**< Cluster counts to handle with */ @@ -271,7 +271,7 @@ typedef struct zb_zdo_node_power_descriptor_s* zb_zdo_node_power_descriptor_h; * * @since_tizen 4.0 */ -typedef struct zb_zdo_simple_desc_s* zb_zdo_simple_desc_h; +typedef void* zb_zdo_simple_desc_h; /** * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE @@ -282,7 +282,7 @@ typedef struct zb_zdo_simple_desc_s* zb_zdo_simple_desc_h; * * @since_tizen 4.0 */ -typedef struct zb_end_device_info_s* zb_end_device_info_h; +typedef void* zb_end_device_info_h; /** @@ -292,7 +292,7 @@ typedef struct zb_end_device_info_s* zb_end_device_info_h; * * @since_tizen 4.0 */ -typedef struct zb_zdo_network_list_record_s* zb_zdo_network_list_record_h; +typedef void* zb_zdo_network_list_record_h; /** * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE @@ -301,7 +301,7 @@ typedef struct zb_zdo_network_list_record_s* zb_zdo_network_list_record_h; * * @since_tizen 4.0 */ -typedef struct zb_zdo_neighbor_table_desc_s* zb_zdo_neighbor_table_desc_h; +typedef void* zb_zdo_neighbor_table_desc_h; /** * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE @@ -310,7 +310,7 @@ typedef struct zb_zdo_neighbor_table_desc_s* zb_zdo_neighbor_table_desc_h; * * @since_tizen 4.0 */ -typedef struct zb_zdo_routing_table_s* zb_zdo_routing_table_h; +typedef void* zb_zdo_routing_table_h; /** * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE @@ -319,7 +319,7 @@ typedef struct zb_zdo_routing_table_s* zb_zdo_routing_table_h; * * @since_tizen 4.0 */ -typedef struct zb_zdo_binding_table_s* zb_zdo_binding_table_h; +typedef void* zb_zdo_binding_table_h; /** * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE @@ -328,7 +328,7 @@ typedef struct zb_zdo_binding_table_s* zb_zdo_binding_table_h; * * @since_tizen 4.0 */ -typedef struct zb_zdo_discovery_cache_s* zb_zdo_discovery_cache_h; +typedef void* zb_zdo_discovery_cache_h; /** diff --git a/include/zigbee.h b/include/zigbee.h index 2f9be98..f54d220 100644 --- a/include/zigbee.h +++ b/include/zigbee.h @@ -30,7 +30,6 @@ extern "C" { #include #include #include -#include /** * @file zigbee.h @@ -146,50 +145,6 @@ typedef void (*zb_event_cb)(nwk_addr addr16, ieee_addr addr64, zb_event_e event_ */ int zb_set_event_cb(zigbee_h handle, zb_event_cb event_handler); -/** - * @brief Switches channel when an occupied channel is noisy. - * @details When noisy, do energy scan and active scan to switch operational channel. - * - * @since_tizen 4.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/zigbee - * - * @param[in] handle The handle of zigbee - * @param[in] channel target channel number to switch - * - * @return 0 on success, otherwise a negative error value. - * @retval #ZIGBEE_ERROR_NONE Successful - * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error - * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied - * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported - * - * @see zb_coex_stop() - * - */ -int zb_coex_start(zigbee_h handle, unsigned char channel); - -/** - * @brief Stops channel switching operation. - * @details Halt current operation related to channel switching. - * - * @since_tizen 4.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/zigbee - * - * @param[in] handle The handle of zigbee - * - * @return 0 on success, otherwise a negative error value. - * @retval #ZIGBEE_ERROR_NONE Successful - * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error - * @retval #ZIGBEE_ERROR_PERMISSION_DENIED Permission denied - * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported - * - * @see zb_coex_start() - * - */ -int zb_coex_stop(zigbee_h handle); /** * @brief Called after zigbee network formation is completed. diff --git a/include/zigbee_internal.h b/include/zigbee_internal.h index d27d3e3..94c8744 100644 --- a/include/zigbee_internal.h +++ b/include/zigbee_internal.h @@ -27,7 +27,6 @@ extern "C" { #include #include #include -#include /** * @file zigbee_internal.h @@ -133,6 +132,311 @@ int zb_disable(zigbee_h handle); */ int zb_hw_reset(zigbee_h handle); +/** + * @internal + * @brief Switches channel when an occupied channel is noisy. + * @details When noisy, do energy scan and active scan to switch operational channel. + * + * @since_tizen 4.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/zigbee + * + * @param[in] handle The handle of zigbee + * @param[in] channel target channel number to switch + * + * @return 0 on success, otherwise a negative error value. + * @retval #ZIGBEE_ERROR_NONE Successful + * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error + * + * @see zb_coex_stop() + * + */ +int zb_coex_start(zigbee_h handle, unsigned char channel); + +/** + * @internal + * @brief Stops channel switching operation. + * @details Halt current operation related to channel switching. + * + * @since_tizen 4.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/zigbee + * + * @param[in] handle The handle of zigbee + * + * @return 0 on success, otherwise a negative error value. + * @retval #ZIGBEE_ERROR_NONE Successful + * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error + * + * @see zb_coex_start() + * + */ +int zb_coex_stop(zigbee_h handle); + +/** + * @internal + * @brief APS Delivery Mode + * + * @since_tizen 4.0 + */ +typedef enum { + ZB_APS_DELIVERY_UNICAST = 0, /**< Unicast delivery */ + ZB_APS_DELIVERY_INDIRECT = 1, /**< Indirect delivery */ + ZB_APS_DELIVERY_BROADCAST = 2, /**< Broadcast delivery */ + ZB_APS_DELIVERY_MULTICAST = 3 /**< Multicast delivery */ +} zb_aps_delivery_mode_e; + +/** + * @internal + * @brief APS ACK Request + * + * @since_tizen 4.0 + */ +typedef enum { + ZB_APS_NO_ACK_REQUEST = (0 << 6), /**< Not request ACK */ + ZB_APS_ACK_REQUEST = (1 << 6), /**< Request ACK */ +} zb_aps_ack_request_e; + +/** + * @internal + * @brief Frame type at ZCL Header + * + * @since_tizen 4.0 + */ +typedef enum { + ZB_ZCL_FC_GLOBALLY_USED = (0 << 0), /**< Profile widely used */ + ZB_APS_FC_CLUSTER_SPECIFIC = (1 << 0), /**< Cluster specific */ +} zb_zcl_fc_type_e; + +/** + * @internal + * @brief Manufacturer specific or not at ZCL Header + * + * @since_tizen 4.0 + */ +typedef enum { + ZB_ZCL_FC_NOT_MANUFACTURER = (0 << 2), /**< Manufacturer code not present */ + ZB_ZCL_FC_MANUFACTURER = (1 << 2), /**< Manufacturer code present */ +} zb_zcl_fc_manufacturer_present_e; + + +/** + * @internal + * @brief Called after custom APS send command + * + * @since_tizen 4.0 + * + * @param[in] addr16 Network address + * @param[in] src_ep source end-point (ex. 1) + * @param[in] dst_ep destination end-point (ex. 1) + * @param[in] cluster_id ZCL cluster id + * @param[in] profile_id Profile id + * @param[in] payload_len Length of payload + * @param[in] payload Payload data + * @param[in] user_data User data + * + * @see zb_aps_send() + */ +typedef void (*zb_aps_send_rsp)( + nwk_addr addr16, + unsigned char src_ep, + unsigned char dst_ep, + unsigned short cluster_id, + unsigned short profile_id, + unsigned short payload_len, + unsigned char *payload, + void *user_data); + +/** + * @internal + * @brief Called after custom ZCL send command + * + * @since_tizen 4.0 + * + * @param[in] addr16 Network address + * @param[in] src_ep source end-point (ex. 1) + * @param[in] dst_ep destination end-point (ex. 1) + * @param[in] cluster_id ZCL cluster id + * @param[in] profile_id Profile id + * @param[in] payload_len Length of payload + * @param[in] payload Payload data + * @param[in] user_data User data + * + * @see zb_zcl_send() + */ +typedef void (*zb_zcl_send_rsp)( + nwk_addr addr16, + unsigned char src_ep, + unsigned char dst_ep, + unsigned short cluster_id, + unsigned short profile_id, + unsigned short payload_len, + unsigned char *payload, + void *user_data); + +/** + * @internal + * @brief Called after custom local send command + * + * @since_tizen 4.0 + * + * @param[in] length The length of data + * @param[in] data Received data + * @param[in] user_data User data + * + * @see zb_send_to_local() + */ +typedef void (*zb_send_to_local_rsp)( + unsigned short length, + unsigned char *data, + void *user_data); + +/** + * @internal + * @brief Sends custom APS data + * + * @since_tizen 4.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/zigbee + * + * @param[in] handle Handle of node descriptor + * @param[in] addr16 Network address + * @param[in] aps_frame_ctl APS Frame control bits. \n + * - Delivery Mode : \n + * #ZB_APS_DELIVERY_UNICAST \n + * #ZB_APS_DELIVERY_INDIRECT \n + * #ZB_APS_DELIVERY_BROADCAST \n + * #ZB_APS_DELIVERY_MULTICAST \n + * - ACK Request : \n + * #ZB_APS_NO_ACK_REQUEST \n + * #ZB_APS_ACK_REQUEST + * @param[in] src_ep source end-point (ex. 1) + * @param[in] dst_ep destination end-point (ex. 1) + * @param[in] cluster_id ZCL cluster id + * @param[in] profile_id Profile id + * @param[in] zcl_frame_ctl frame control bits (default 0x00). \n + * Only OR operation is allowed in ZCL header \n + * - Frame Type : \n + * #ZB_ZCL_FC_GLOBALLY_USED (default) \n + * #ZB_APS_FC_CLUSTER_SPECIFIC \n + * - Manufacturer Specific : \n + * - Direction : \n + * #ZB_ZCL_CLIENT_TO_SERVER (default) \n + * #ZB_ZCL_SERVER_TO_CLIENT \n + * - Disable Default Response : \n + * #ZB_ZCL_LEAVE_WELL_ALONE (default) \n + * #ZB_ZCL_DISABLE_DEFAULT_RESPONSE + * @param[in] mfg_code Manufacturer Code + * @param[in] cmd_id Command ID + * @param[in] payload_len Length of payload + * @param[in] payload Payload data + * @param[in] cb Callback function to get response. + * @param[in] user_data User data to be received from callback function. + * + * @return 0 on success, otherwise a negative error value. + * @retval #ZIGBEE_ERROR_NONE Successful + * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error + * + * @see zb_aps_send_rsp() + */ +int zb_aps_send( + zigbee_h handle, + nwk_addr addr16, + unsigned char aps_frame_ctl, + unsigned char src_ep, + unsigned char dst_ep, + unsigned short cluster_id, + unsigned short profile_id, + unsigned char zcl_frame_ctl, + unsigned short mfg_code, + unsigned char cmd_id, + unsigned short payload_len, + unsigned char *payload, + zb_aps_send_rsp cb, + void *user_data); + +/** + * @internal + * @brief Sends custom ZCL data + * + * @since_tizen 4.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/zigbee + * + * @param[in] handle Handle of node descriptor + * @param[in] addr16 Network address + * @param[in] src_ep source end-point (ex. 1) + * @param[in] dst_ep destination end-point (ex. 1) + * @param[in] cluster_id ZCL cluster id + * @param[in] zcl_frame_ctl frame control bits (default 0x00). \n + * Only OR operation is allowed in ZCL header \n + * - Frame Type : \n + * #ZB_ZCL_FC_GLOBALLY_USED (default) \n + * #ZB_APS_FC_CLUSTER_SPECIFIC \n + * - Manufacturer Specific : \n + * - Direction : \n + * #ZB_ZCL_CLIENT_TO_SERVER (default) \n + * #ZB_ZCL_SERVER_TO_CLIENT \n + * - Disable Default Response : \n + * #ZB_ZCL_LEAVE_WELL_ALONE (default) \n + * #ZB_ZCL_DISABLE_DEFAULT_RESPONSE + * @param[in] cmd APL Command + * @param[in] payload_len Length of payload + * @param[in] payload Payload data + * @param[in] cb Callback function to get response. + * @param[in] user_data User data to be received from callback function. + * + * @return 0 on success, otherwise a negative error value. + * @retval #ZIGBEE_ERROR_NONE Successful + * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error + * + * @see zb_zcl_send_rsp() + */ +int zb_zcl_send( + zigbee_h handle, + nwk_addr addr16, + unsigned char src_ep, + unsigned char dst_ep, + unsigned short cluster_id, + unsigned char zcl_frame_ctl, + unsigned char cmd, + unsigned short payload_len, + unsigned char *payload, + zb_zcl_send_rsp cb, + void *user_data); + +/** + * @internal + * @brief Transmits data that needs to be processed locally. + * + * @since_tizen 4.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/zigbee + * + * @param[in] handle handle of node descriptor + * @param[in] length The length of data + * @param[in] data Data to send + * @param[in] cb Callback function to get response. + * @param[in] user_data User data to be received from callback function. + * + * @return 0 on success, otherwise a negative error value. + * @retval #ZIGBEE_ERROR_NONE Successful + * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ZIGBEE_ERROR_IO_ERROR Unexpected d-bus error + * + * @see zb_send_to_local_rsp() + */ +int zb_send_to_local( + zigbee_h handle, + unsigned short length, + unsigned char *data, + zb_send_to_local_rsp cb, + void *user_data); + /** * @} */ diff --git a/lib/zbl.c b/lib/zbl.c index d2a3fa9..75c7c3e 100644 --- a/lib/zbl.c +++ b/lib/zbl.c @@ -189,20 +189,22 @@ API int zb_get_network_info(zigbee_h handle, ieee_addr addr64, nwk_addr *nodeid, API int zb_device_list_free(zb_end_device_info_h *list) { int i = 0, j = 0; + struct zb_end_device_info_s **plist = list; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == list, ZIGBEE_ERROR_INVALID_PARAMETER); - while (list[i]) { + while (plist[i]) { j = 0; - while (list[i]->desc && list[i]->desc[j]) { - free(list[i]->desc[j]); + while (plist[i]->desc && plist[i]->desc[j]) { + free(plist[i]->desc[j]); j++; } - if (list[i]->desc) - free(list[i]->desc); - free(list[i]); + if (plist[i]->desc) + free(plist[i]->desc); + free(plist[i]); i++; } - free(list); + free(plist); + plist = NULL; return ZIGBEE_ERROR_NONE; } diff --git a/lib/zbl_custom.c b/lib/zbl_custom.c index 9054f66..f8c59be 100644 --- a/lib/zbl_custom.c +++ b/lib/zbl_custom.c @@ -20,7 +20,6 @@ #include #include #include -#include #include "zbl.h" #include "zbl_dbus.h" diff --git a/lib/zbl_dbus.c b/lib/zbl_dbus.c index 0684d86..a2694ec 100644 --- a/lib/zbl_dbus.c +++ b/lib/zbl_dbus.c @@ -463,19 +463,21 @@ static void _zbl_register_global_req(zigbee_h handle, zbl_req_cb_s *container) GList *list = NULL; GList *item = NULL; + struct zbl_zigbee_s* h = handle; + if (NULL == handle || NULL == container) return; - list = handle->global_cmd_req; + list = h->global_cmd_req; /* Insert item if not exists */ DBG("Insert global cmd info"); if (list) { item = g_list_find_custom(list, container, _global_compare_func); if (NULL != item) - handle->global_cmd_req = g_list_append(list, container); + h->global_cmd_req = g_list_append(list, container); } else - handle->global_cmd_req = g_list_append(list, container); + h->global_cmd_req = g_list_append(list, container); } static void _zbl_deregister_global_req(zigbee_h handle, zbl_req_cb_s *container) @@ -483,10 +485,12 @@ static void _zbl_deregister_global_req(zigbee_h handle, zbl_req_cb_s *container) GList *list = NULL; GList *item = NULL; + struct zbl_zigbee_s* h = handle; + if (NULL == handle || NULL == container) return; - list = handle->global_cmd_req; + list = h->global_cmd_req; if (NULL == list) return; @@ -494,7 +498,7 @@ static void _zbl_deregister_global_req(zigbee_h handle, zbl_req_cb_s *container) DBG("Remove global cmd info"); item = g_list_find_custom(list, container, _global_compare_func); if (NULL != item) - handle->global_cmd_req = g_list_remove(list, container); + h->global_cmd_req = g_list_remove(list, container); } static void _zbl_remove_global_req(zigbee_h handle, unsigned char ep, @@ -504,10 +508,12 @@ static void _zbl_remove_global_req(zigbee_h handle, unsigned char ep, GList *iter = NULL; zbl_req_cb_s *ret = NULL; + struct zbl_zigbee_s* h = handle; + if (NULL == handle) return; - head = handle->global_cmd_req; + head = h->global_cmd_req; iter = head; while (NULL != iter) { @@ -537,7 +543,7 @@ static void _zbl_remove_global_req(zigbee_h handle, unsigned char ep, ret->tid = 0; } - _zbl_deregister_global_req(handle, ret); + _zbl_deregister_global_req(h, ret); } } @@ -547,7 +553,7 @@ static void _zbl_signal_handler(GDBusConnection *connection, const gchar *sender_name, const gchar *object_path, const gchar *interface_name, const gchar *signal_name, GVariant *parameters, gpointer user_data) { - zigbee_h container = (zigbee_h)user_data; + struct zbl_zigbee_s* container = user_data; RETM_IF(NULL == container, "container is null"); RETM_IF(NULL == container->event_handler, "event_handler is null"); DBG("%s signal received", signal_name); @@ -927,6 +933,7 @@ static void _zbl_dbus_unsubscribe_signal(GList *sub_ids) static int _zbl_dbus_subscribe_signal(zigbee_h handle) { unsigned int id; + struct zbl_zigbee_s* h = handle; /* Section 1. Subscribe ZDO signal */ id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL, ZIGBEE_SERVICE_INTERFACE, @@ -936,132 +943,132 @@ static int _zbl_dbus_subscribe_signal(zigbee_h handle) ERR("g_dbus_connection_signal_subscribe(service_enabled) Fail(%d)", errno); return ZIGBEE_ERROR_IO_ERROR; } - handle->dbus_sub_ids = g_list_append(handle->dbus_sub_ids, GUINT_TO_POINTER(id)); + h->dbus_sub_ids = g_list_append(h->dbus_sub_ids, GUINT_TO_POINTER(id)); DBG("subscribed for service_enabled signal %d", id); id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL, ZIGBEE_SERVICE_INTERFACE, "child_joined", ZIGBEE_CONTROL_OBJECT_PATH, NULL, - G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, handle, NULL); + G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, h, NULL); if (0 == id) { ERR("g_dbus_connection_signal_subscribe(child_rejoined) Fail(%d)\n", errno); - _zbl_dbus_unsubscribe_signal(handle->dbus_sub_ids); - handle->dbus_sub_ids = NULL; + _zbl_dbus_unsubscribe_signal(h->dbus_sub_ids); + h->dbus_sub_ids = NULL; return ZIGBEE_ERROR_IO_ERROR; } - handle->dbus_sub_ids = g_list_append(handle->dbus_sub_ids, GUINT_TO_POINTER(id)); + h->dbus_sub_ids = g_list_append(h->dbus_sub_ids, GUINT_TO_POINTER(id)); DBG("subscribed for child_joined signal %d", id); id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL, ZIGBEE_SERVICE_INTERFACE, "child_rejoined", ZIGBEE_CONTROL_OBJECT_PATH, NULL, - G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, handle, NULL); + G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, h, NULL); if (0 == id) { ERR("g_dbus_connection_signal_subscribe(child_rejoined) Fail(%d)\n", errno); - _zbl_dbus_unsubscribe_signal(handle->dbus_sub_ids); - handle->dbus_sub_ids = NULL; + _zbl_dbus_unsubscribe_signal(h->dbus_sub_ids); + h->dbus_sub_ids = NULL; return ZIGBEE_ERROR_IO_ERROR; } - handle->dbus_sub_ids = g_list_append(handle->dbus_sub_ids, GUINT_TO_POINTER(id)); + h->dbus_sub_ids = g_list_append(h->dbus_sub_ids, GUINT_TO_POINTER(id)); DBG("subscribed for child_rejoined signal %d", id); id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL, ZIGBEE_SERVICE_INTERFACE, "child_left", ZIGBEE_CONTROL_OBJECT_PATH, NULL, - G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, handle, NULL); + G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, h, NULL); if (0 == id) { ERR("g_dbus_connection_signal_subscribe(child_left) Fail(%d)\n", errno); - _zbl_dbus_unsubscribe_signal(handle->dbus_sub_ids); - handle->dbus_sub_ids = NULL; + _zbl_dbus_unsubscribe_signal(h->dbus_sub_ids); + h->dbus_sub_ids = NULL; return ZIGBEE_ERROR_IO_ERROR; } - handle->dbus_sub_ids = g_list_append(handle->dbus_sub_ids, GUINT_TO_POINTER(id)); + h->dbus_sub_ids = g_list_append(h->dbus_sub_ids, GUINT_TO_POINTER(id)); DBG("subscribed for child_left signal %d", id); id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL, ZIGBEE_SERVICE_INTERFACE, "leave_network_done", ZIGBEE_CONTROL_OBJECT_PATH, NULL, - G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, handle, NULL); + G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, h, NULL); if (0 == id) { ERR("g_dbus_connection_signal_subscribe(leave_network_done) Fail(%d)\n", errno); - _zbl_dbus_unsubscribe_signal(handle->dbus_sub_ids); - handle->dbus_sub_ids = NULL; + _zbl_dbus_unsubscribe_signal(h->dbus_sub_ids); + h->dbus_sub_ids = NULL; return ZIGBEE_ERROR_IO_ERROR; } - handle->dbus_sub_ids = g_list_append(handle->dbus_sub_ids, GUINT_TO_POINTER(id)); + h->dbus_sub_ids = g_list_append(h->dbus_sub_ids, GUINT_TO_POINTER(id)); DBG("subscribed for leave_network_done signal %d", id); id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL, ZIGBEE_SERVICE_INTERFACE, "form_network_done", ZIGBEE_CONTROL_OBJECT_PATH, NULL, - G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, handle, NULL); + G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, h, NULL); if (0 == id) { ERR("g_dbus_connection_signal_subscribe(form_network_done) Fail(%d)\n", errno); - _zbl_dbus_unsubscribe_signal(handle->dbus_sub_ids); - handle->dbus_sub_ids = NULL; + _zbl_dbus_unsubscribe_signal(h->dbus_sub_ids); + h->dbus_sub_ids = NULL; return ZIGBEE_ERROR_IO_ERROR; } - handle->dbus_sub_ids = g_list_append(handle->dbus_sub_ids, GUINT_TO_POINTER(id)); + h->dbus_sub_ids = g_list_append(h->dbus_sub_ids, GUINT_TO_POINTER(id)); DBG("subscribed for form_network_done signal %d", id); /* Section 3. Subscribe ZCL global command */ id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL, ZIGBEE_ZCL_GLOBAL_CONTROL_INTERFACE, "zcl_global_default_response", ZIGBEE_CONTROL_OBJECT_PATH, NULL, G_DBUS_CALL_FLAGS_NONE, - _zbl_signal_handler, handle, NULL); + _zbl_signal_handler, h, NULL); if (0 == id) { ERR("g_dbus_connection_signal_subscribe(zcl_global_default_response) Fail(%d)\n", errno); - _zbl_dbus_unsubscribe_signal(handle->dbus_sub_ids); - handle->dbus_sub_ids = NULL; + _zbl_dbus_unsubscribe_signal(h->dbus_sub_ids); + h->dbus_sub_ids = NULL; return ZIGBEE_ERROR_IO_ERROR; } - handle->dbus_sub_ids = g_list_append(handle->dbus_sub_ids, GUINT_TO_POINTER(id)); + h->dbus_sub_ids = g_list_append(h->dbus_sub_ids, GUINT_TO_POINTER(id)); DBG("subscribed for zcl_global_default_response signal %d", id); id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL, ZIGBEE_ZCL_GLOBAL_CONTROL_INTERFACE, "report_attr_handler_rsp", ZIGBEE_CONTROL_OBJECT_PATH, NULL, G_DBUS_CALL_FLAGS_NONE, - _zbl_signal_handler, handle, NULL); + _zbl_signal_handler, h, NULL); if (0 == id) { ERR("g_dbus_connection_signal_subscribe(report_attr_handler_rsp) Fail(%d)\n", errno); - _zbl_dbus_unsubscribe_signal(handle->dbus_sub_ids); - handle->dbus_sub_ids = NULL; + _zbl_dbus_unsubscribe_signal(h->dbus_sub_ids); + h->dbus_sub_ids = NULL; return ZIGBEE_ERROR_IO_ERROR; } - handle->dbus_sub_ids = g_list_append(handle->dbus_sub_ids, GUINT_TO_POINTER(id)); + h->dbus_sub_ids = g_list_append(h->dbus_sub_ids, GUINT_TO_POINTER(id)); DBG("subscribed for report_attr_handler_rsp signal %d", id); /* Section 2. Subscribe ZCL alarm cluster signal */ id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL, ZIGBEE_ZCL_ALARM_INTERFACE, "alarm_count", ZIGBEE_CONTROL_OBJECT_PATH, NULL, - G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, handle, NULL); + G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, h, NULL); if (0 == id) { ERR("g_dbus_connection_signal_subscribe(alarm_count) Fail(%d)\n", errno); - _zbl_dbus_unsubscribe_signal(handle->dbus_sub_ids); - handle->dbus_sub_ids = NULL; + _zbl_dbus_unsubscribe_signal(h->dbus_sub_ids); + h->dbus_sub_ids = NULL; return ZIGBEE_ERROR_IO_ERROR; } - handle->dbus_sub_ids = g_list_append(handle->dbus_sub_ids, GUINT_TO_POINTER(id)); + h->dbus_sub_ids = g_list_append(h->dbus_sub_ids, GUINT_TO_POINTER(id)); DBG("subscribed for alarm_count signal %d", id); /* Section 3. Subscribe ZCL IAS cluster signal */ id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL, ZIGBEE_ZCL_IAS_ZONE_INTERFACE, "status_change_rpt", ZIGBEE_CONTROL_OBJECT_PATH, NULL, - G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, handle, NULL); + G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, h, NULL); if (0 == id) { ERR("g_dbus_connection_signal_subscribe(status_change_rpt) Fail(%d)\n", errno); - _zbl_dbus_unsubscribe_signal(handle->dbus_sub_ids); - handle->dbus_sub_ids = NULL; + _zbl_dbus_unsubscribe_signal(h->dbus_sub_ids); + h->dbus_sub_ids = NULL; return ZIGBEE_ERROR_IO_ERROR; } - handle->dbus_sub_ids = g_list_append(handle->dbus_sub_ids, GUINT_TO_POINTER(id)); + h->dbus_sub_ids = g_list_append(h->dbus_sub_ids, GUINT_TO_POINTER(id)); DBG("subscribed for status_change_rpt signal %d", id); id = g_dbus_connection_signal_subscribe(gdbus_conn, NULL, ZIGBEE_ZCL_IAS_ZONE_INTERFACE, "enroll_request", ZIGBEE_CONTROL_OBJECT_PATH, NULL, - G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, handle, NULL); + G_DBUS_CALL_FLAGS_NONE, _zbl_signal_handler, h, NULL); if (0 == id) { ERR("g_dbus_connection_signal_subscribe(enroll_request) Fail(%d)\n", errno); - _zbl_dbus_unsubscribe_signal(handle->dbus_sub_ids); - handle->dbus_sub_ids = NULL; + _zbl_dbus_unsubscribe_signal(h->dbus_sub_ids); + h->dbus_sub_ids = NULL; return ZIGBEE_ERROR_IO_ERROR; } - handle->dbus_sub_ids = g_list_append(handle->dbus_sub_ids, GUINT_TO_POINTER(id)); + h->dbus_sub_ids = g_list_append(h->dbus_sub_ids, GUINT_TO_POINTER(id)); DBG("subscribed for enroll_request signal %d", id); return ZIGBEE_ERROR_NONE; @@ -1153,13 +1160,13 @@ static gboolean _zbl_timeout_cb(gpointer p) break; case ZBL_ZDO_MGMT_BIND_REQ: { zb_zdo_mgmt_bind_rsp cb = container->cb; - zb_zdo_binding_table_h *records = NULL; + struct zb_zdo_binding_table_s **records = NULL; records = calloc(1, sizeof(zb_zdo_binding_table_h)); if (records) records[0] = calloc(1, sizeof(struct zb_zdo_binding_table_s)); - cb(ZB_ZDP_TIMEOUT, 0, 0, 0, records, container->userdata); + cb(ZB_ZDP_TIMEOUT, 0, 0, 0, (void **)records, container->userdata); free(records[0]); free(records); @@ -1167,13 +1174,13 @@ static gboolean _zbl_timeout_cb(gpointer p) break; case ZBL_ZDO_MGMT_LQI_REQ: { zb_zdo_mgmt_lqi_rsp cb = container->cb; - zb_zdo_neighbor_table_desc_h *records = NULL; + struct zb_zdo_neighbor_table_desc_s **records = NULL; records = calloc(1, sizeof(zb_zdo_neighbor_table_desc_h)); if (records) records[0] = calloc(1, sizeof(struct zb_zdo_neighbor_table_desc_s)); - cb(ZB_ZDP_TIMEOUT, 0, 0, 0, records, container->userdata); + cb(ZB_ZDP_TIMEOUT, 0, 0, 0, (void **)records, container->userdata); free(records[0]); free(records); @@ -1181,13 +1188,13 @@ static gboolean _zbl_timeout_cb(gpointer p) break; case ZBL_ZDO_MGMT_RTG_REQ: { zb_zdo_mgmt_rtg_rsp cb = container->cb; - zb_zdo_routing_table_h *records = NULL; + struct zb_zdo_routing_table_s **records = NULL; records = calloc(1, sizeof(zb_zdo_routing_table_h)); if (records) records[0] = calloc(1, sizeof(struct zb_zdo_routing_table_s)); - cb(ZB_ZDP_TIMEOUT, 0, 0, 0, records, container->userdata); + cb(ZB_ZDP_TIMEOUT, 0, 0, 0, (void **)records, container->userdata); free(records[0]); free(records); @@ -1195,12 +1202,12 @@ static gboolean _zbl_timeout_cb(gpointer p) break; case ZBL_ZDO_MGMT_NWK_DISC_REQ: { zb_zdo_mgmt_nwk_disc_rsp cb = container->cb; - zb_zdo_network_list_record_h *records = NULL; + struct zb_zdo_network_list_record_s **records = NULL; records = calloc(1, sizeof(zb_zdo_network_list_record_h)); if (records) records[0] = calloc(1, sizeof(struct zb_zdo_network_list_record_s)); - cb(0, 0, 0, 0, records, container->userdata); + cb(0, 0, 0, 0, (void **)records, container->userdata); free(records[0]); free(records); } @@ -1524,7 +1531,7 @@ static void _zbl_response_cb(GDBusConnection *connection, unsigned short value; GVariantIter *in_iter = NULL; GVariantIter *out_iter = NULL; - zb_zdo_simple_desc_h records; + struct zb_zdo_simple_desc_s * records; records = calloc(1, sizeof(struct zb_zdo_simple_desc_s)); RETM_IF(NULL == records, "calloc() Fail(%d)", errno); @@ -1626,7 +1633,7 @@ static void _zbl_response_cb(GDBusConnection *connection, nwk_addr addr16; unsigned char status; - zb_zdo_node_descriptor_h desc; + struct zb_zdo_node_descriptor_s *desc; desc = calloc(1, sizeof(struct zb_zdo_node_descriptor_s)); RETM_IF(NULL == desc, "calloc() Fail(%d)", errno); @@ -1649,7 +1656,7 @@ static void _zbl_response_cb(GDBusConnection *connection, nwk_addr addr16; unsigned char status; - zb_zdo_node_power_descriptor_h desc; + struct zb_zdo_node_power_descriptor_s *desc; desc = calloc(1, sizeof(struct zb_zdo_node_power_descriptor_s)); RETM_IF(NULL == desc, "calloc() Fail(%d)", errno); @@ -1750,7 +1757,7 @@ static void _zbl_response_cb(GDBusConnection *connection, GVariantIter *mac_iter = NULL; GVariantIter *rsp_iter = NULL; GVariantIter *destep_iter = NULL; - zb_zdo_binding_table_h *records = NULL; + struct zb_zdo_binding_table_s **records = NULL; g_variant_get(parameters, "(yyyya(ayyqyqayy))", &status, &binding_table_enteries, &start_index, @@ -1807,7 +1814,7 @@ static void _zbl_response_cb(GDBusConnection *connection, g_variant_iter_free(rsp_iter); cb(status, binding_table_enteries, start_index, binding_table_list_count, - records, container->userdata); + (void **)records, container->userdata); MGMT_NWK_BIND_REQ_OUT: for (i = 0; i < binding_table_list_count; i++) { @@ -1831,7 +1838,7 @@ MGMT_NWK_BIND_REQ_OUT: GVariantIter *resp_iter = NULL; GVariantIter *mac_iter = NULL; GVariantIter *mac_iter1 = NULL; - zb_zdo_neighbor_table_desc_h *records = NULL; + struct zb_zdo_neighbor_table_desc_s **records = NULL; g_variant_get(parameters, "(yyyya(ayayyqyyyyy))", &status, &neighbor_table_enteries, &start_index, &neighbor_table_list_count, &resp_iter); @@ -1879,7 +1886,7 @@ MGMT_NWK_BIND_REQ_OUT: g_variant_iter_free(resp_iter); cb(status, neighbor_table_enteries, start_index, neighbor_table_list_count, - records, container->userdata); + (void **)records, container->userdata); MGMT_LQI_REQ_OUT: for (i = 0; i < neighbor_table_list_count; i++) { @@ -1899,7 +1906,7 @@ MGMT_LQI_REQ_OUT: unsigned char routing_table_list_count; GVariantIter *rsp_iter = NULL; - zb_zdo_routing_table_h *records = NULL; + struct zb_zdo_routing_table_s **records = NULL; g_variant_get(parameters, "(yyyya(qyyyyq))", &status, &routing_table_enteries, &start_index, &routing_table_list_count, &rsp_iter); @@ -1926,7 +1933,7 @@ MGMT_LQI_REQ_OUT: g_variant_iter_free(rsp_iter); cb(status, routing_table_enteries, start_index, routing_table_list_count, - records, container->userdata); + (void **)records, container->userdata); MGMT_NWK_RTG_REQ_OUT: for (i = 0; i < routing_table_list_count; i++) { @@ -1954,7 +1961,7 @@ MGMT_NWK_RTG_REQ_OUT: g_variant_get(parameters, "(yyyya(ayyyyyyy))", &status, &nwk_count, &start_index, &nwk_list_count, &resp_iter); - zb_zdo_network_list_record_h *records = NULL; + struct zb_zdo_network_list_record_s **records = NULL; if (!status) { if (nwk_list_count > 0) { @@ -2931,8 +2938,9 @@ static int _check_zigbee_privilege() int zbl_set_event_cb(zigbee_h handle, zb_event_cb event_handler) { + struct zbl_zigbee_s *h = handle; RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - handle->event_handler = event_handler; + h->event_handler = event_handler; return ZIGBEE_ERROR_NONE; } @@ -3492,7 +3500,7 @@ int zbl_get_all_device_info(zb_end_device_info_h **dev_list, unsigned char* num) ERR("No attached nodes"); *num = i; - *dev_list = list; + *dev_list = (void **)list; if (NULL != iter) g_variant_iter_free(iter); g_variant_unref(variant); @@ -8371,6 +8379,7 @@ int zbl_dbus_start(zigbee_h handle) void zbl_dbus_stop(zigbee_h handle) { + struct zbl_zigbee_s *h = handle; DBG("zbl_dbus_stop()"); if (0 >= zbl_ref_count) { @@ -8385,8 +8394,8 @@ void zbl_dbus_stop(zigbee_h handle) } if (gdbus_conn) { - _zbl_dbus_unsubscribe_signal(handle->dbus_sub_ids); - handle->dbus_sub_ids = NULL; + _zbl_dbus_unsubscribe_signal(h->dbus_sub_ids); + h->dbus_sub_ids = NULL; g_object_unref(service_gproxy); service_gproxy = NULL; diff --git a/lib/zbl_dbus.h b/lib/zbl_dbus.h index 67edb1a..1668d9c 100644 --- a/lib/zbl_dbus.h +++ b/lib/zbl_dbus.h @@ -21,7 +21,6 @@ #include #include #include -#include int zbl_dbus_start(zigbee_h handle); void zbl_dbus_stop(zigbee_h handle); diff --git a/lib/zbl_zdo.c b/lib/zbl_zdo.c index a7b745a..8e87e58 100644 --- a/lib/zbl_zdo.c +++ b/lib/zbl_zdo.c @@ -140,50 +140,55 @@ API int zb_simple_desc_copy(zb_zdo_simple_desc_h src, zb_zdo_simple_desc_h dst) API int zb_simple_desc_destroy(zb_zdo_simple_desc_h handle) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - free(handle); + free(h); return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_get_ep(zb_zdo_simple_desc_h handle, unsigned char *ep) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == ep, ZIGBEE_ERROR_INVALID_PARAMETER); - *ep = handle->ep; + *ep = h->ep; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_set_ep(zb_zdo_simple_desc_h handle, unsigned char ep) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - handle->ep = ep; + h->ep = ep; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_get_profile_id(zb_zdo_simple_desc_h handle, unsigned short *profile_id) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == profile_id, ZIGBEE_ERROR_INVALID_PARAMETER); - *profile_id = handle->profile_id; + *profile_id = h->profile_id; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_set_profile_id(zb_zdo_simple_desc_h handle, unsigned short profile_id) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - handle->profile_id = profile_id; + h->profile_id = profile_id; return ZIGBEE_ERROR_NONE; } @@ -191,132 +196,144 @@ API int zb_simple_desc_set_profile_id(zb_zdo_simple_desc_h handle, API int zb_simple_desc_get_device_id(zb_zdo_simple_desc_h handle, unsigned short *device_id) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == device_id, ZIGBEE_ERROR_INVALID_PARAMETER); - *device_id = handle->device_id; + *device_id = h->device_id; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_set_device_id(zb_zdo_simple_desc_h handle, unsigned short device_id) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - handle->device_id = device_id; + h->device_id = device_id; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_get_device_ver(zb_zdo_simple_desc_h handle, unsigned short *device_ver) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == device_ver, ZIGBEE_ERROR_INVALID_PARAMETER); - *device_ver = handle->device_ver; + *device_ver = h->device_ver; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_set_device_ver(zb_zdo_simple_desc_h handle, unsigned short device_ver) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - handle->device_ver = device_ver; + h->device_ver = device_ver; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_get_num_of_in_clusters(zb_zdo_simple_desc_h handle, unsigned char *num_of_in_clusters) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == num_of_in_clusters, ZIGBEE_ERROR_INVALID_PARAMETER); - *num_of_in_clusters = handle->num_of_in_clusters; + *num_of_in_clusters = h->num_of_in_clusters; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_set_num_of_in_clusters(zb_zdo_simple_desc_h handle, unsigned char num_of_in_clusters) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - handle->num_of_in_clusters = num_of_in_clusters; + h->num_of_in_clusters = num_of_in_clusters; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_get_num_of_out_clusters(zb_zdo_simple_desc_h handle, unsigned char *num_of_out_clusters) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == num_of_out_clusters, ZIGBEE_ERROR_INVALID_PARAMETER); - *num_of_out_clusters = handle->num_of_out_clusters; + *num_of_out_clusters = h->num_of_out_clusters; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_set_num_of_out_clusters(zb_zdo_simple_desc_h handle, unsigned char num_of_out_clusters) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - handle->num_of_out_clusters = num_of_out_clusters; + h->num_of_out_clusters = num_of_out_clusters; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_get_in_clusters(zb_zdo_simple_desc_h handle, unsigned short **in_clusters) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - RETV_IF(NULL == handle->in_clusters, ZIGBEE_ERROR_INVALID_PARAMETER); + RETV_IF(NULL == h->in_clusters, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == in_clusters, ZIGBEE_ERROR_INVALID_PARAMETER); - *in_clusters = handle->in_clusters; + *in_clusters = h->in_clusters; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_set_in_clusters(zb_zdo_simple_desc_h handle, unsigned short *in_clusters, int num) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == in_clusters, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(num < 1 || num > MAX_ENDPOINT_CLUSTERS, ZIGBEE_ERROR_INVALID_PARAMETER); - memcpy(handle->in_clusters, in_clusters, 2 * num); + memcpy(h->in_clusters, in_clusters, 2 * num); return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_get_out_clusters(zb_zdo_simple_desc_h handle, unsigned short **out_clusters) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - RETV_IF(NULL == handle->out_clusters, ZIGBEE_ERROR_INVALID_PARAMETER); + RETV_IF(NULL == h->out_clusters, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == out_clusters, ZIGBEE_ERROR_INVALID_PARAMETER); - *out_clusters = handle->out_clusters; + *out_clusters = h->out_clusters; return ZIGBEE_ERROR_NONE; } API int zb_simple_desc_set_out_clusters(zb_zdo_simple_desc_h handle, unsigned short *out_clusters, int num) { + struct zb_zdo_simple_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == out_clusters, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(num < 1 || num > MAX_ENDPOINT_CLUSTERS, ZIGBEE_ERROR_INVALID_PARAMETER); - memcpy(handle->out_clusters, out_clusters, 2 * num); + memcpy(h->out_clusters, out_clusters, 2 * num); return ZIGBEE_ERROR_NONE; } @@ -399,64 +416,70 @@ API int zb_devices_info_foreach_end_device(zb_end_device_info_h *list, API int zb_get_network_address(zb_end_device_info_h handle, nwk_addr *addr16) { + struct zb_end_device_info_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == addr16, ZIGBEE_ERROR_INVALID_PARAMETER); - *addr16 = handle->addr16; + *addr16 = h->addr16; return ZIGBEE_ERROR_NONE; } API int zb_get_ieee_address(zb_end_device_info_h handle, ieee_addr addr64) { + struct zb_end_device_info_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == addr64, ZIGBEE_ERROR_INVALID_PARAMETER); - memcpy(addr64, handle->addr64, sizeof(ieee_addr)); + memcpy(addr64, h->addr64, sizeof(ieee_addr)); return ZIGBEE_ERROR_NONE; } API int zb_get_num_of_ep(zb_end_device_info_h handle, unsigned char *count) { + struct zb_end_device_info_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == count, ZIGBEE_ERROR_INVALID_PARAMETER); - *count = handle->num_of_ep; + *count = h->num_of_ep; return ZIGBEE_ERROR_NONE; } API int zb_get_ep_list(zb_end_device_info_h handle, unsigned char *ep_list) { + struct zb_end_device_info_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == ep_list, ZIGBEE_ERROR_INVALID_PARAMETER); - memcpy(ep_list, handle->ep, handle->num_of_ep); + memcpy(ep_list, h->ep, h->num_of_ep); return ZIGBEE_ERROR_NONE; } API int zb_get_mac_capabiity(zb_end_device_info_h handle, unsigned char *capability) { + struct zb_end_device_info_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == capability, ZIGBEE_ERROR_INVALID_PARAMETER); - RETV_IF(0 == handle->capability, ZIGBEE_ERROR_NO_DATA); + RETV_IF(0 == h->capability, ZIGBEE_ERROR_NO_DATA); - *capability = handle->capability; + *capability = h->capability; return ZIGBEE_ERROR_NONE; } API int zb_get_alternative_pan_coordinator(zb_end_device_info_h handle, unsigned char *can_do_it) { + struct zb_end_device_info_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == can_do_it, ZIGBEE_ERROR_INVALID_PARAMETER); - RETV_IF(0 == handle->capability, ZIGBEE_ERROR_NO_DATA); + RETV_IF(0 == h->capability, ZIGBEE_ERROR_NO_DATA); - *can_do_it = handle->capability & ZB_ZDP_ALTERNATIVE_PAN_COORDINATOR ? 1 : 0; + *can_do_it = h->capability & ZB_ZDP_ALTERNATIVE_PAN_COORDINATOR ? 1 : 0; return ZIGBEE_ERROR_NONE; } @@ -464,15 +487,16 @@ API int zb_get_device_id(zb_end_device_info_h handle, unsigned char ep, unsigned short *device_id) { int i; + struct zb_end_device_info_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == device_id, ZIGBEE_ERROR_INVALID_PARAMETER); - RETV_IF(NULL == handle->desc, ZIGBEE_ERROR_NO_DATA); + RETV_IF(NULL == h->desc, ZIGBEE_ERROR_NO_DATA); - for (i = 0; i < handle->num_of_ep; i++) { - RETV_IF(NULL == handle->desc[i], ZIGBEE_ERROR_NO_DATA); - if (handle->desc[i]->ep == ep) { - *device_id = handle->desc[i]->device_id; + for (i = 0; i < h->num_of_ep; i++) { + RETV_IF(NULL == h->desc[i], ZIGBEE_ERROR_NO_DATA); + if (h->desc[i]->ep == ep) { + *device_id = h->desc[i]->device_id; return ZIGBEE_ERROR_NONE; } } @@ -483,15 +507,16 @@ API int zb_get_profile_id(zb_end_device_info_h handle, unsigned char ep, unsigned short *profile_id) { int i; + struct zb_end_device_info_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == profile_id, ZIGBEE_ERROR_INVALID_PARAMETER); - RETV_IF(NULL == handle->desc, ZIGBEE_ERROR_NO_DATA); + RETV_IF(NULL == h->desc, ZIGBEE_ERROR_NO_DATA); - for (i = 0; i < handle->num_of_ep; i++) { - RETV_IF(NULL == handle->desc[i], ZIGBEE_ERROR_NO_DATA); - if (handle->desc[i]->ep == ep) { - *profile_id = handle->desc[i]->profile_id; + for (i = 0; i < h->num_of_ep; i++) { + RETV_IF(NULL == h->desc[i], ZIGBEE_ERROR_NO_DATA); + if (h->desc[i]->ep == ep) { + *profile_id = h->desc[i]->profile_id; return ZIGBEE_ERROR_NONE; } } @@ -500,24 +525,26 @@ API int zb_get_profile_id(zb_end_device_info_h handle, unsigned char ep, API int zb_get_power_source(zb_end_device_info_h handle, unsigned char *power_src) { + struct zb_end_device_info_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == power_src, ZIGBEE_ERROR_INVALID_PARAMETER); - RETV_IF(0 == handle->capability, ZIGBEE_ERROR_NO_DATA); + RETV_IF(0 == h->capability, ZIGBEE_ERROR_NO_DATA); - *power_src = handle->capability & ZB_ZDP_POWER_SOURCE ? 1 : 0; + *power_src = h->capability & ZB_ZDP_POWER_SOURCE ? 1 : 0; return ZIGBEE_ERROR_NONE; } API int zb_get_security_capabilty(zb_end_device_info_h handle, unsigned char *sec_capability) { + struct zb_end_device_info_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == sec_capability, ZIGBEE_ERROR_INVALID_PARAMETER); - RETV_IF(0 == handle->capability, ZIGBEE_ERROR_NO_DATA); + RETV_IF(0 == h->capability, ZIGBEE_ERROR_NO_DATA); - *sec_capability = handle->capability & ZB_ZDP_SECURITY_CAPABILITY ? 1 : 0; + *sec_capability = h->capability & ZB_ZDP_SECURITY_CAPABILITY ? 1 : 0; return ZIGBEE_ERROR_NONE; } @@ -548,10 +575,11 @@ API int zb_node_power_desc_copy(zb_zdo_node_power_descriptor_h src, API int zb_node_power_desc_destroy(zb_zdo_node_power_descriptor_h handle) { + struct zb_zdo_node_power_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - free(handle); + free(h); return ZIGBEE_ERROR_NONE; } @@ -559,87 +587,95 @@ API int zb_node_power_desc_get_current_power_mode( zb_zdo_node_power_descriptor_h handle, unsigned char* current_power_mode) { + struct zb_zdo_node_power_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == current_power_mode, ZIGBEE_ERROR_INVALID_PARAMETER); - *current_power_mode = handle->current_power_mode; + *current_power_mode = h->current_power_mode; return ZIGBEE_ERROR_NONE; } API int zb_node_power_desc_set_current_power_mode( zb_zdo_node_power_descriptor_h handle, unsigned char current_power_mode) { + struct zb_zdo_node_power_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0b11 < current_power_mode, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->current_power_mode = current_power_mode; + h->current_power_mode = current_power_mode; return ZIGBEE_ERROR_NONE; } API int zb_node_power_desc_get_available_power_sources( zb_zdo_node_power_descriptor_h handle, unsigned char* available_power_sources) { + struct zb_zdo_node_power_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == available_power_sources, ZIGBEE_ERROR_INVALID_PARAMETER); - *available_power_sources = handle->available_power_sources; + *available_power_sources = h->available_power_sources; return ZIGBEE_ERROR_NONE; } API int zb_node_power_desc_set_available_power_sources( zb_zdo_node_power_descriptor_h handle, unsigned char available_power_sources) { + struct zb_zdo_node_power_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0b111 < available_power_sources, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->available_power_sources = available_power_sources; + h->available_power_sources = available_power_sources; return ZIGBEE_ERROR_NONE; } API int zb_node_power_desc_get_current_power_source( zb_zdo_node_power_descriptor_h handle, unsigned char* current_power_source) { + struct zb_zdo_node_power_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == current_power_source, ZIGBEE_ERROR_INVALID_PARAMETER); - *current_power_source = handle->current_power_source; + *current_power_source = h->current_power_source; return ZIGBEE_ERROR_NONE; } API int zb_node_power_desc_set_current_power_source( zb_zdo_node_power_descriptor_h handle, unsigned char current_power_source) { + struct zb_zdo_node_power_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0b111 < current_power_source, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->current_power_source = current_power_source; + h->current_power_source = current_power_source; return ZIGBEE_ERROR_NONE; } API int zb_node_power_desc_get_current_power_source_level( zb_zdo_node_power_descriptor_h handle, unsigned char* current_power_source_level) { + struct zb_zdo_node_power_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == current_power_source_level, ZIGBEE_ERROR_INVALID_PARAMETER); - *current_power_source_level = handle->current_power_source_level; + *current_power_source_level = h->current_power_source_level; return ZIGBEE_ERROR_NONE; } API int zb_node_power_desc_set_current_power_source_level( zb_zdo_node_power_descriptor_h handle, unsigned char current_power_source_level) { + struct zb_zdo_node_power_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - handle->current_power_source_level = current_power_source_level; + h->current_power_source_level = current_power_source_level; return ZIGBEE_ERROR_NONE; } @@ -670,120 +706,131 @@ API int zb_node_desc_copy(zb_zdo_node_descriptor_h src, API int zb_node_desc_destroy(zb_zdo_node_descriptor_h handle) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - free(handle); + free(h); return ZIGBEE_ERROR_NONE; } API int zb_node_desc_get_logical_type(zb_zdo_node_descriptor_h handle, unsigned char* logical_type) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == logical_type, ZIGBEE_ERROR_INVALID_PARAMETER); - *logical_type = handle->logical_type; + *logical_type = h->logical_type; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_logical_type(zb_zdo_node_descriptor_h handle, unsigned char logical_type) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0b11 < logical_type, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->logical_type = logical_type; + h->logical_type = logical_type; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_get_complex_desciptor_available( zb_zdo_node_descriptor_h handle, unsigned char* complex_desciptor_available) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == complex_desciptor_available, ZIGBEE_ERROR_INVALID_PARAMETER); - *complex_desciptor_available = handle->complex_desciptor_available; + *complex_desciptor_available = h->complex_desciptor_available; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_complex_descriptor_available( zb_zdo_node_descriptor_h handle, unsigned char complex_desciptor_available) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0x01 < complex_desciptor_available, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->complex_desciptor_available = complex_desciptor_available; + h->complex_desciptor_available = complex_desciptor_available; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_get_user_descriptor_available( zb_zdo_node_descriptor_h handle, unsigned char* user_descriptor_available) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == user_descriptor_available, ZIGBEE_ERROR_INVALID_PARAMETER); - *user_descriptor_available = handle->user_descriptor_available; + *user_descriptor_available = h->user_descriptor_available; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_user_descriptor_available( zb_zdo_node_descriptor_h handle, unsigned char user_descriptor_available) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0x01 < user_descriptor_available, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->user_descriptor_available = user_descriptor_available; + h->user_descriptor_available = user_descriptor_available; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_get_aps_flags(zb_zdo_node_descriptor_h handle, unsigned char* aps_flags) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == aps_flags, ZIGBEE_ERROR_INVALID_PARAMETER); - *aps_flags = handle->aps_flags; + *aps_flags = h->aps_flags; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_aps_flags(zb_zdo_node_descriptor_h handle, unsigned char aps_flags) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0b111 < aps_flags, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->aps_flags = aps_flags; + h->aps_flags = aps_flags; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_get_frequency_band(zb_zdo_node_descriptor_h handle, unsigned char* frequency_band) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == frequency_band, ZIGBEE_ERROR_INVALID_PARAMETER); - *frequency_band = handle->frequency_band; + *frequency_band = h->frequency_band; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_frequency_band(zb_zdo_node_descriptor_h handle, unsigned char frequency_band) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0b1111 < frequency_band, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->frequency_band = frequency_band; + h->frequency_band = frequency_band; return ZIGBEE_ERROR_NONE; } @@ -791,491 +838,536 @@ API int zb_node_desc_set_frequency_band(zb_zdo_node_descriptor_h handle, API int zb_node_desc_get_mac_capability_flags(zb_zdo_node_descriptor_h handle, unsigned char* mac_capability_flags) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == mac_capability_flags, ZIGBEE_ERROR_INVALID_PARAMETER); - *mac_capability_flags = handle->mac_capability_flags; + *mac_capability_flags = h->mac_capability_flags; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_mac_capability_flags(zb_zdo_node_descriptor_h handle, unsigned char mac_capability_flags) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - handle->mac_capability_flags = mac_capability_flags; + h->mac_capability_flags = mac_capability_flags; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_get_manufacturer_code(zb_zdo_node_descriptor_h handle, unsigned short* manufacturer_code) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == manufacturer_code, ZIGBEE_ERROR_INVALID_PARAMETER); - *manufacturer_code = handle->manufacturer_code; + *manufacturer_code = h->manufacturer_code; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_manufacturer_code(zb_zdo_node_descriptor_h handle, unsigned short manufacturer_code) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - handle->manufacturer_code = manufacturer_code; + h->manufacturer_code = manufacturer_code; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_get_maximum_buffer_size(zb_zdo_node_descriptor_h handle, unsigned char* maximum_buffer_size) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == maximum_buffer_size, ZIGBEE_ERROR_INVALID_PARAMETER); - *maximum_buffer_size = handle->maximum_buffer_size; + *maximum_buffer_size = h->maximum_buffer_size; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_maximum_buffer_size(zb_zdo_node_descriptor_h handle, unsigned char maximum_buffer_size) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0x7f < maximum_buffer_size, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->maximum_buffer_size = maximum_buffer_size; + h->maximum_buffer_size = maximum_buffer_size; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_get_maximum_incoming_transfer_size( zb_zdo_node_descriptor_h handle, unsigned short* maximum_incoming_transfer_size) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == maximum_incoming_transfer_size, ZIGBEE_ERROR_INVALID_PARAMETER); - *maximum_incoming_transfer_size = handle->maximum_incoming_transfer_size; + *maximum_incoming_transfer_size = h->maximum_incoming_transfer_size; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_maximum_incoming_transfer_size( zb_zdo_node_descriptor_h handle, unsigned short maximum_incoming_transfer_size) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0x7fff < maximum_incoming_transfer_size, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->maximum_incoming_transfer_size = maximum_incoming_transfer_size; + h->maximum_incoming_transfer_size = maximum_incoming_transfer_size; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_get_server_mask(zb_zdo_node_descriptor_h handle, unsigned short* server_mask) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == server_mask, ZIGBEE_ERROR_INVALID_PARAMETER); - *server_mask = handle->server_mask; + *server_mask = h->server_mask; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_server_mask(zb_zdo_node_descriptor_h handle, unsigned short server_mask) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0x7f < server_mask, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->server_mask = server_mask; + h->server_mask = server_mask; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_get_maximum_outgoing_transfer_size( zb_zdo_node_descriptor_h handle, unsigned short* maximum_outgoing_transfer_size) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == maximum_outgoing_transfer_size, ZIGBEE_ERROR_INVALID_PARAMETER); - *maximum_outgoing_transfer_size = handle->maximum_outgoing_transfer_size; + *maximum_outgoing_transfer_size = h->maximum_outgoing_transfer_size; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_maximum_outgoing_transfer_size( zb_zdo_node_descriptor_h handle, unsigned short maximum_outgoing_transfer_size) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0x7fff < maximum_outgoing_transfer_size, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->maximum_outgoing_transfer_size = maximum_outgoing_transfer_size; + h->maximum_outgoing_transfer_size = maximum_outgoing_transfer_size; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_get_descriptor_capability_field( zb_zdo_node_descriptor_h handle, unsigned short* descriptor_capability_field) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == descriptor_capability_field, ZIGBEE_ERROR_INVALID_PARAMETER); - *descriptor_capability_field = handle->descriptor_capability_field; + *descriptor_capability_field = h->descriptor_capability_field; return ZIGBEE_ERROR_NONE; } API int zb_node_desc_set_descriptor_capability_field( zb_zdo_node_descriptor_h handle, unsigned short descriptor_capability_field) { + struct zb_zdo_node_descriptor_s* h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(0x11 < descriptor_capability_field, ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE); - handle->descriptor_capability_field = descriptor_capability_field; + h->descriptor_capability_field = descriptor_capability_field; return ZIGBEE_ERROR_NONE; } API int zb_network_list_record_get_extended_pan_id( zb_zdo_network_list_record_h handle, ieee_addr extended_pan_id) { + struct zb_zdo_network_list_record_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - extended_pan_id = handle->extended_pan_id; + extended_pan_id = h->extended_pan_id; return ZIGBEE_ERROR_NONE; } API int zb_network_list_record_get_logical_channel( zb_zdo_network_list_record_h handle, unsigned char* logical_channel) { + struct zb_zdo_network_list_record_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == logical_channel, ZIGBEE_ERROR_INVALID_PARAMETER); - *logical_channel = handle->logical_channel; + *logical_channel = h->logical_channel; return ZIGBEE_ERROR_NONE; } API int zb_network_list_record_get_zigbee_version( zb_zdo_network_list_record_h handle, unsigned char* zigbee_version) { + struct zb_zdo_network_list_record_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == zigbee_version, ZIGBEE_ERROR_INVALID_PARAMETER); - *zigbee_version = handle->zigbee_version; + *zigbee_version = h->zigbee_version; return ZIGBEE_ERROR_NONE; } API int zb_network_list_record_get_stack_profile( zb_zdo_network_list_record_h handle, unsigned char* stack_profile) { + struct zb_zdo_network_list_record_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == stack_profile, ZIGBEE_ERROR_INVALID_PARAMETER); - *stack_profile = handle->stack_profile; + *stack_profile = h->stack_profile; return ZIGBEE_ERROR_NONE; } API int zb_network_list_record_get_beacon_order( zb_zdo_network_list_record_h handle, unsigned char* beacon_order) { + struct zb_zdo_network_list_record_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == beacon_order, ZIGBEE_ERROR_INVALID_PARAMETER); - *beacon_order = handle->beacon_order; + *beacon_order = h->beacon_order; return ZIGBEE_ERROR_NONE; } API int zb_network_list_record_get_superframe_order( zb_zdo_network_list_record_h handle, unsigned char* superframe_order) { + struct zb_zdo_network_list_record_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == superframe_order, ZIGBEE_ERROR_INVALID_PARAMETER); - *superframe_order = handle->superframe_order; + *superframe_order = h->superframe_order; return ZIGBEE_ERROR_NONE; } API int zb_network_list_record_get_permit_joining( zb_zdo_network_list_record_h handle, unsigned char* permit_joining) { + struct zb_zdo_network_list_record_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == permit_joining, ZIGBEE_ERROR_INVALID_PARAMETER); - *permit_joining = handle->permit_joining; + *permit_joining = h->permit_joining; return ZIGBEE_ERROR_NONE; } API int zb_neighbor_table_desc_get_extended_pan_id( zb_zdo_neighbor_table_desc_h handle, ieee_addr extended_pan_id) { + struct zb_zdo_neighbor_table_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - RETV_IF(NULL == handle->extended_pan_id, ZIGBEE_ERROR_INVALID_PARAMETER); + RETV_IF(NULL == h->extended_pan_id, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == extended_pan_id, ZIGBEE_ERROR_INVALID_PARAMETER); - memcpy(extended_pan_id, handle->extended_pan_id, sizeof(ieee_addr)); + memcpy(extended_pan_id, h->extended_pan_id, sizeof(ieee_addr)); return ZIGBEE_ERROR_NONE; } API int zb_neighbor_table_desc_get_ieee_addr( zb_zdo_neighbor_table_desc_h handle, ieee_addr addr64) { + struct zb_zdo_neighbor_table_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - RETV_IF(NULL == handle->addr64, ZIGBEE_ERROR_INVALID_PARAMETER); + RETV_IF(NULL == h->addr64, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == addr64, ZIGBEE_ERROR_INVALID_PARAMETER); - memcpy(addr64, handle->addr64, sizeof(ieee_addr)); + memcpy(addr64, h->addr64, sizeof(ieee_addr)); return ZIGBEE_ERROR_NONE; } API int zb_neighbor_table_desc_get_nwk_addr( zb_zdo_neighbor_table_desc_h handle, nwk_addr* addr16) { + struct zb_zdo_neighbor_table_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == addr16, ZIGBEE_ERROR_INVALID_PARAMETER); - *addr16 = handle->addr16; + *addr16 = h->addr16; return ZIGBEE_ERROR_NONE; } API int zb_neighbor_table_desc_get_device_type( zb_zdo_neighbor_table_desc_h handle, unsigned char* device_type) { + struct zb_zdo_neighbor_table_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == device_type, ZIGBEE_ERROR_INVALID_PARAMETER); - *device_type = handle->device_type; + *device_type = h->device_type; return ZIGBEE_ERROR_NONE; } API int zb_neighbor_table_desc_get_rx_on_when_idle( zb_zdo_neighbor_table_desc_h handle, unsigned char* rx_on_when_idle) { + struct zb_zdo_neighbor_table_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == rx_on_when_idle, ZIGBEE_ERROR_INVALID_PARAMETER); - *rx_on_when_idle = handle->rx_on_when_idle; + *rx_on_when_idle = h->rx_on_when_idle; return ZIGBEE_ERROR_NONE; } API int zb_neighbor_table_desc_get_relationship( zb_zdo_neighbor_table_desc_h handle, unsigned char* releationship) { + struct zb_zdo_neighbor_table_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == releationship, ZIGBEE_ERROR_INVALID_PARAMETER); - *releationship = handle->relationship; + *releationship = h->relationship; return ZIGBEE_ERROR_NONE; } API int zb_neighbor_table_desc_get_permit_joining( zb_zdo_neighbor_table_desc_h handle, unsigned char* permit_joining) { + struct zb_zdo_neighbor_table_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == permit_joining, ZIGBEE_ERROR_INVALID_PARAMETER); - *permit_joining = handle->permit_joining; + *permit_joining = h->permit_joining; return ZIGBEE_ERROR_NONE; } API int zb_neighbor_table_desc_get_depth( zb_zdo_neighbor_table_desc_h handle, unsigned char* depth) { + struct zb_zdo_neighbor_table_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == depth, ZIGBEE_ERROR_INVALID_PARAMETER); - *depth = handle->depth; + *depth = h->depth; return ZIGBEE_ERROR_NONE; } API int zb_neighbor_table_desc_get_lqi(zb_zdo_neighbor_table_desc_h handle, unsigned char* lqi) { + struct zb_zdo_neighbor_table_desc_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == lqi, ZIGBEE_ERROR_INVALID_PARAMETER); - *lqi = handle->lqi; + *lqi = h->lqi; return ZIGBEE_ERROR_NONE; } API int zb_routing_table_get_dst_addr(zb_zdo_routing_table_h handle, nwk_addr* dst_addr) { + struct zb_zdo_routing_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == dst_addr, ZIGBEE_ERROR_INVALID_PARAMETER); - *dst_addr = handle->dst_addr; + *dst_addr = h->dst_addr; return ZIGBEE_ERROR_NONE; } API int zb_routing_table_get_dst_status(zb_zdo_routing_table_h handle, unsigned char *status) { + struct zb_zdo_routing_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == status, ZIGBEE_ERROR_INVALID_PARAMETER); - *status = handle->status; + *status = h->status; return ZIGBEE_ERROR_NONE; } API int zb_routing_table_get_memory_constrained( zb_zdo_routing_table_h handle, unsigned char *memory_constrained) { + struct zb_zdo_routing_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == memory_constrained, ZIGBEE_ERROR_INVALID_PARAMETER); - *memory_constrained = handle->memory_constrained; + *memory_constrained = h->memory_constrained; return ZIGBEE_ERROR_NONE; } API int zb_routing_table_get_many_to_one(zb_zdo_routing_table_h handle, unsigned char *many_to_one) { + struct zb_zdo_routing_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == many_to_one, ZIGBEE_ERROR_INVALID_PARAMETER); - *many_to_one = handle->many_to_one; + *many_to_one = h->many_to_one; return ZIGBEE_ERROR_NONE; } API int zb_routing_table_get_route_record_required( zb_zdo_routing_table_h handle, unsigned char *route_record_required) { + struct zb_zdo_routing_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == route_record_required, ZIGBEE_ERROR_INVALID_PARAMETER); - *route_record_required = handle->route_record_required; + *route_record_required = h->route_record_required; return ZIGBEE_ERROR_NONE; } API int zb_routing_table_get_next_hop_addr( zb_zdo_routing_table_h handle, nwk_addr *next_hop_addr) { + struct zb_zdo_routing_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == next_hop_addr, ZIGBEE_ERROR_INVALID_PARAMETER); - *next_hop_addr = handle->next_hop_addr; + *next_hop_addr = h->next_hop_addr; return ZIGBEE_ERROR_NONE; } API int zb_binding_table_get_src_addr(zb_zdo_binding_table_h handle, ieee_addr src_addr) { + struct zb_zdo_binding_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - memcpy(src_addr, handle->src_addr64, sizeof(ieee_addr)); + memcpy(src_addr, h->src_addr64, sizeof(ieee_addr)); return ZIGBEE_ERROR_NONE; } API int zb_binding_table_get_src_ep(zb_zdo_binding_table_h handle, unsigned char* src_ep) { + struct zb_zdo_binding_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == src_ep, ZIGBEE_ERROR_INVALID_PARAMETER); - *src_ep = handle->src_ep; + *src_ep = h->src_ep; return ZIGBEE_ERROR_NONE; } API int zb_binding_table_get_cluster_id(zb_zdo_binding_table_h handle, unsigned short *cluster_id) { + struct zb_zdo_binding_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == cluster_id, ZIGBEE_ERROR_INVALID_PARAMETER); - *cluster_id = handle->cluster_id; + *cluster_id = h->cluster_id; return ZIGBEE_ERROR_NONE; } API int zb_binding_table_get_dst_addr_mode(zb_zdo_binding_table_h handle, unsigned char* dst_addr_mode) { + struct zb_zdo_binding_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == dst_addr_mode, ZIGBEE_ERROR_INVALID_PARAMETER); - *dst_addr_mode = handle->dst_addr_mode; + *dst_addr_mode = h->dst_addr_mode; return ZIGBEE_ERROR_NONE; } API int zb_binding_table_get_dst_addr16(zb_zdo_binding_table_h handle, nwk_addr* addr16) { + struct zb_zdo_binding_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == addr16, ZIGBEE_ERROR_INVALID_PARAMETER); - *addr16 = handle->dst_addr16; + *addr16 = h->dst_addr16; return ZIGBEE_ERROR_NONE; } API int zb_binding_table_get_dst_addr64(zb_zdo_binding_table_h handle, ieee_addr addr64) { + struct zb_zdo_binding_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == addr64, ZIGBEE_ERROR_INVALID_PARAMETER); - memcpy(addr64, handle->dst_addr64, sizeof(ieee_addr)); + memcpy(addr64, h->dst_addr64, sizeof(ieee_addr)); return ZIGBEE_ERROR_NONE; } API int zb_binding_table_get_dst_ep(zb_zdo_binding_table_h handle, unsigned char* dst_ep) { + struct zb_zdo_binding_table_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == dst_ep, ZIGBEE_ERROR_INVALID_PARAMETER); - *dst_ep = handle->dst_ep; + *dst_ep = h->dst_ep; return ZIGBEE_ERROR_NONE; } API int zb_discovery_cache_get_ieee_addr(zb_zdo_discovery_cache_h handle, ieee_addr addr64) { + struct zb_zdo_discovery_cache_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); - addr64 = handle->addr64; + addr64 = h->addr64; return ZIGBEE_ERROR_NONE; } API int zb_discovery_cache_get_nwk_addr(zb_zdo_discovery_cache_h handle, nwk_addr* addr16) { + struct zb_zdo_discovery_cache_s *h = handle; CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE); RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER); RETV_IF(NULL == addr16, ZIGBEE_ERROR_INVALID_PARAMETER); - *addr16 = handle->addr16; + *addr16 = h->addr16; return ZIGBEE_ERROR_NONE; } diff --git a/test/custom.c b/test/custom.c index 0cce339..83b3846 100644 --- a/test/custom.c +++ b/test/custom.c @@ -24,6 +24,7 @@ #include #include +#include #include "main.h" #include "menu.h"