#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)) { \
* 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 <a href="https://developer.tizen.org/development/getting-started/native-application/understanding-tizen-programming/application-filtering"><b>Feature List</b>.</a>
+ *
+ *
* @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.
+++ /dev/null
-/*
- * 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 <zigbee.h>
- *
- * @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__ */
/**
* @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 <zigbee.h>
- *
- * @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
typedef unsigned short nwk_addr;
/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
* @brief The data type abbreviation : 128 bit security key
*
* @since_tizen 4.0
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
} 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.
*
} 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.
*
} 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.
*
} 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.
*
} 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.
*
} 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.
*
} 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.
*
} 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.
*
} 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.
*
} 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.
*
} 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
} 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
} zb_zcl_fc_direction_e;
/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
* @brief Disable default response or not at ZCL Header
*
* @since_tizen 4.0
} zb_zcl_fc_disable_default_response_e;
/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_MODULE
* @brief Default ZCL frame control at APS Header
*
* @since_tizen 4.0
#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
#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
#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
#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
#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__ */
*
* @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 <zigbee.h>
*
* @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 <a href="https://developer.tizen.org/development/getting-started/native-application/understanding-tizen-programming/application-filtering"><b>Feature List</b>.</a>
+ *
* @{
*/
#include <zcl/zb_zcl_type.h>
*
* @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 <zigbee.h>
*
* @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 <a href="https://developer.tizen.org/development/getting-started/native-application/understanding-tizen-programming/application-filtering"><b>Feature List</b>.</a>
+ *
* @{
*/
*/
/**
- * @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
/**
* @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 <zigbee.h>
- *
- * @since_tizen 4.0
*
* @{
*/
/**
* @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 <zigbee.h>
- *
- * @since_tizen 4.0
*
* @{
*/
*/
/**
- * @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
* @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 <zigbee.h>
- *
- * @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
ZB_ZCL_ZLL_COMMISSIONING_CLUSTER_ID = 0x1000, /**< ZLL Commissioning Cluster */
} zb_zcl_cluster_ids_e;
-/**
- * @}
- */
-
#endif /* __TIZEN_NETWORK_ZIGBEE_ZCL_CLUSTER_IDS_H__ */
*/
/**
- * @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 <zigbee.h>
#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 <zigbee.h>
- *
- * @since_tizen 4.0
- *
- * @{
- */
-
-/**
* @brief Global commands (Either direction)
*
* @since_tizen 4.0
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
} 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
/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE
* @brief Command types for cluster: Electrical Measurement
* @details Cluster specification level: UNKNOWN
* @remark Direction : Server to Client
} 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
} 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
} 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
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__ */
* @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 <zigbee.h>
*/
/**
- * @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 <zigbee.h>
*/
/**
- * @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 <zigbee.h>
*/
/**
- * @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 <zigbee.h>
*/
/**
- * @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 <zigbee.h>
*/
/**
- * @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 <zigbee.h>
*/
/**
- * @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 <zigbee.h>
*/
/**
- * @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 <zigbee.h>
*/
/**
- * @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 <zigbee.h>
*
* @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
*
* @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 */
*
* @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
*
* @since_tizen 4.0
*/
-typedef struct zb_end_device_info_s* zb_end_device_info_h;
+typedef void* 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
*
* @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
*
* @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
*
* @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
*
* @since_tizen 4.0
*/
-typedef struct zb_zdo_discovery_cache_s* zb_zdo_discovery_cache_h;
+typedef void* zb_zdo_discovery_cache_h;
/**
#include <zb_zdo.h>
#include <zb_zcl.h>
#include <zb_ha.h>
-#include <zb_custom.h>
/**
* @file zigbee.h
*/
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.
#include <zb_zdo.h>
#include <zb_zcl.h>
#include <zb_ha.h>
-#include <zb_custom.h>
/**
* @file zigbee_internal.h
*/
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);
+
/**
* @}
*/
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;
}
#include <string.h>
#include <zb_log.h>
#include <zb_common.h>
-#include <zb_custom.h>
#include "zbl.h"
#include "zbl_dbus.h"
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)
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;
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,
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) {
ret->tid = 0;
}
- _zbl_deregister_global_req(handle, ret);
+ _zbl_deregister_global_req(h, ret);
}
}
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);
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,
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;
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);
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);
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);
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);
}
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);
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);
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);
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,
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++) {
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);
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++) {
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);
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++) {
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) {
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;
}
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);
void zbl_dbus_stop(zigbee_h handle)
{
+ struct zbl_zigbee_s *h = handle;
DBG("zbl_dbus_stop()");
if (0 >= zbl_ref_count) {
}
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;
#include <zigbee.h>
#include <zigbee_internal.h>
#include <zb_type.h>
-#include <zb_custom.h>
int zbl_dbus_start(zigbee_h handle);
void zbl_dbus_stop(zigbee_h handle);
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;
}
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;
}
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;
}
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;
}
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
#include <gio/gio.h>
#include <zigbee.h>
+#include <zigbee_internal.h>
#include "main.h"
#include "menu.h"