+++ /dev/null
-/*
- * Copyright (c) 2015 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_INTERNAL_COMMON_H__
-#define __TIZEN_NETWORK_ZIGBEE_INTERNAL_COMMON_H__
-
-#include <zb_type.h>
-#include <zdo/zb_zdo_type.h>
-#include <zcl/zb_zcl_type.h>
-
-#ifndef ZIGBEE_DBUS_INTERFACE
-#define ZIGBEE_DBUS_INTERFACE "org.tizen.zigbee"
-#warning "ZIGBEE_DBUS_INTERFACE is redefined"
-#endif
-
-#ifndef ZIGBEE_DBUS_OBJPATH
-#define ZIGBEE_DBUS_OBJPATH "/org/tizen/zigbee"
-#warning "ZIGBEE_DBUS_OBJPATH is redefined"
-#endif
-
-#define ZIGBEE_SERVER_NAME "org.tizen.zigbee"
-#define ZIGBEE_CONTROL_OBJECT_PATH "/org/tizen/zigbee/control"
-
-#define ZIGBEE_MANAGER_INTERFACE "org.tizen.zigbee.manager"
-#define ZIGBEE_SERVICE_INTERFACE "org.tizen.zigbee.service"
-#define ZIGBEE_SERVICE_OBJECT_PATH "/org/tizen/zigbee/service"
-
-#define ZIGBEE_ZDO_DEV_CONTROL_INTERFACE "org.tizen.zigbee.zdo_dev_control"
-#define ZIGBEE_ZDO_BIND_INTERFACE "org.tizen.zigbee.zdo_bind"
-#define ZIGBEE_ZCL_GLOBAL_CONTROL_INTERFACE "org.tizen.zigbee.zcl_global_control"
-#define ZIGBEE_ZCL_ALARM_INTERFACE "org.tizen.zigbee.zcl_alarm"
-#define ZIGBEE_ZCL_BASIC_INTERFACE "org.tizen.zigbee.zcl_basic"
-#define ZIGBEE_ZCL_COLOR_CONTROL_INTERFACE "org.tizen.zigbee.zcl_color_control"
-#define ZIGBEE_ZCL_ON_OFF_INTERFACE "org.tizen.zigbee.zcl_on_off"
-#define ZIGBEE_ZCL_DOOR_LOCK_INTERFACE "org.tizen.zigbee.zcl_door_lock"
-#define ZIGBEE_ZCL_GROUP_INTERFACE "org.tizen.zigbee.zcl_group"
-#define ZIGBEE_ZCL_FAN_CONTROL_INTERFACE "org.tizen.zigbee.zcl_fan_control"
-#define ZIGBEE_ZCL_IAS_ZONE_INTERFACE "org.tizen.zigbee.zcl_ias_zone"
-#define ZIGBEE_ZCL_IDENTIFY_INTERFACE "org.tizen.zigbee.zcl_identify"
-#define ZIGBEE_ZCL_LEVEL_CONTROL_INTERFACE "org.tizen.zigbee.zcl_level_control"
-#define ZIGBEE_ZCL_POLL_CONTROL_INTERFACE "org.tizen.zigbee.zcl_poll_control"
-#define ZIGBEE_ZCL_SCENE_INTERFACE "org.tizen.zigbee.zcl_scene"
-#define ZIGBEE_ZCL_THERMOSTAT_INTERFACE "org.tizen.zigbee.zcl_thermostat"
-#define ZIGBEE_CUSTOM_INTERFACE "org.tizen.zigbee.custom"
-#define ZIGBEE_MFGLIB_CONTROL_INTERFACE "org.tizen.zigbee.mfglib_control"
-
-
-#define ZIGBEE_BROADCAST_TIMEOUT (9.5 + 2) * 1000 /**< default timeout for gdbus */
-
-#define MAX_DEVICE_LIST 32 /**< maximum end-devices in device list */
-
-#define NOT_USED(var) ((var) = (var))
-
-/*---------------------------------------------------------------------------------------
- * For ZDO
- *--------------------------------------------------------------------------------------*/
-
-/**
- * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
- * @brief Fields of the Simple Descriptor
- * @details Device descriptions contained in node.
- *
- * @since_tizen 4.0
- */
-struct zb_zdo_simple_desc_s {
- unsigned char ep; /**< Endpoint ID */
- unsigned short profile_id; /**< Profile ID */
- unsigned short device_id; /**< Device ID */
- unsigned char device_ver; /**< Device Version */
- unsigned char num_of_in_clusters; /**< Number of In-Cluster */
- unsigned char num_of_out_clusters; /**< Number of Out-Cluster */
- unsigned short in_clusters[32]; /**< In-Cluster list */
- unsigned short out_clusters[32]; /**< Out-Cluster list */
-};
-
-/**
- * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
- * @brief Fields of the Node Power Descriptor .
- * @details Node power characteristics.
- *
- * @since_tizen 4.0
- */
-struct zb_zdo_node_power_descriptor_s {
- unsigned char current_power_mode; /**< Current Power Mode */
- unsigned char available_power_sources; /**< Available Power Source */
- unsigned char current_power_source; /**< Current Power Source */
- unsigned char current_power_source_level; /**< Current Power Source Level */
-};
-
-/**
- * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
- * @brief Structure for end-device information.
- *
- * @since_tizen 4.0
- */
-struct zb_end_device_info_s {
- nwk_addr addr16; /**< 16bit network address */
- ieee_addr addr64; /**< EUI64 ieee address */
- unsigned char node_type; /**< node type : coordinator, router or end-device */
- unsigned char capability; /**< mac capability is updated when device_annce received */
- unsigned char num_of_ep; /**< number of endpoints */
- unsigned char ep[32]; /**< end-point list */
- struct zb_zdo_simple_desc_s **desc; /**< Simple Descriptor when get_simple_desc_rsp received */
- GList *list; /**< list to next */
-};
-
-/**
- * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
- * @brief Fields of the Node Descriptor
- * @details Type and capabilities of the node.
- *
- * @since_tizen 4.0
- */
-struct zb_zdo_node_descriptor_s {
- unsigned char logical_type; /**< Logical Role */
- unsigned char complex_desciptor_available; /**< Complex Descriptor Available \n */
- unsigned char user_descriptor_available; /**< User Descriptor Available */
- unsigned char aps_flags; /**< APS Flags */
- unsigned char frequency_band; /**< Frequency Band */
- unsigned char mac_capability_flags; /**< MAC Capability Flags */
- unsigned short manufacturer_code; /**< Manufacturer Code */
- unsigned char maximum_buffer_size; /**< Maximum Buffer Size */
- unsigned short maximum_incoming_transfer_size; /**< Maximum Incoming Transfer Size */
- unsigned short server_mask; /**< Server Mask */
- unsigned short maximum_outgoing_transfer_size; /**< Maximum Outgoing Transfer Size */
- unsigned char descriptor_capability_field; /**< Descriptor Capability Field */
-};
-
-/**
- * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
- * @brief NetworkList Record Format.
- *
- * @since_tizen 4.0
- */
-struct zb_zdo_network_list_record_s {
- ieee_addr extended_pan_id; /**< Extended PAN ID */
- unsigned char logical_channel; /**< Logical Channel Number */
- unsigned char stack_profile; /**< Stack Profile Version */
- unsigned char zigbee_version; /**< Supported Zigbee Protocol Version */
- unsigned char beacon_order; /**< Beacon Order (See. 802.15.4 PHY/MAC Specification) */
- unsigned char superframe_order; /**< Superframe Order (See. 802.15.4 PHY/MAC Specification) */
- unsigned char permit_joining; /**< Permit Joining Flag */
-#if 0
- unsigned char router_capability;
- unsigned char end_device_capability;
-#endif
- GList *list; /**< list to next */
-};
-
-/**
- * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
- * @brief NeighborTableList Record Format.
- *
- * @since_tizen 4.0
- */
-struct zb_zdo_neighbor_table_desc_s {
- ieee_addr extended_pan_id; /**< Extended PAN ID */
- ieee_addr addr64; /**< IEEE Address */
- nwk_addr addr16; /**< Network Address */
- unsigned char device_type; /**< Device Type see #zb_zdo_logical_type_e */
- unsigned char rx_on_when_idle; /**< Can Receive on Idle State */
- unsigned char relationship; /**< Relationship (i.e. parent, children or sibling) */
- unsigned char permit_joining; /**< Can handle join request */
- unsigned char depth; /**< Depth from parent */
- unsigned char lqi; /**< Link Quality Indicator */
- GList *list; /**< list to next */
-};
-
-/**
- * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
- * @brief RoutingTableList Record Format.
- *
- * @since_tizen 4.0
- */
-struct zb_zdo_routing_table_s {
- nwk_addr dst_addr; /**< Network Address */
- unsigned char status; /**< Status */
- unsigned char memory_constrained; /* Is memory constrained device */
- unsigned char many_to_one; /* Can support many-to-on endpoint routing */
- unsigned char route_record_required; /* Route record required */
- nwk_addr next_hop_addr; /* Next hop address */
- GList *list; /**< list to next */
-};
-
-/**
- * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
- * @brief BindingTableList Record Format.
- *
- * @since_tizen 4.0
- */
-struct zb_zdo_binding_table_s {
- ieee_addr src_addr64; /**< IEEE address */
- unsigned char src_ep; /**< Source endpoint */
- unsigned short cluster_id; /**< Cluster ID */
- unsigned char dst_addr_mode; /**< Destination address mode */
- nwk_addr dst_addr16; /**< Destination network address this is up-to dst_addr_mode */
- ieee_addr dst_addr64; /**< Destination network address this is up-to dst_addr_mode */
- unsigned char dst_ep; /**< Destination Endpoint */
- GList *list; /**< next node */
-};
-
-/**
- * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
- * @brief DiscoveryCacheList Record Format.
- *
- * @since_tizen 4.0
- */
-struct zb_zdo_discovery_cache_s {
- ieee_addr addr64; /**< IEEE Address */
- nwk_addr addr16; /**< Network Address */
- GList *list; /**< next child */
-};
-
-/*---------------------------------------------------------------------------------------
- * For ZCL Global Commands
- *--------------------------------------------------------------------------------------*/
-
-/**
- * @brief Format of Attribute Value Field for string
- *
- * @since_tizen 4.0
- */
-struct attribute_str_s {
- unsigned char n; /**< number of elements */
- unsigned char *v; /**< element value */
-};
-
-/**
- * @brief Format of Attribute Value Field for wide-string
- *
- * @since_tizen 4.0
- */
-struct attribute_wstr_s {
- unsigned short n; /**< number of elements */
- wchar_t *v; /**< element value */
-};
-
-/**
- * @brief Figure 2.8 Format of Attribute Value Field for an array, Set or Bag in Zigbee Cluster Libarry
- *
- * @since_tizen 4.0
- */
-struct attribute_array_s {
- unsigned char t; /**< element type */
- unsigned short n; /**< number of elements */
- zb_value_h v; /**< element value */
-};
-
-/**
- * @brief Attribute value sequence
- *
- * @since_tizen 4.0
- */
-struct attribute_element_value {
- unsigned char t; /**< element type */
- zb_value_h v; /**< element value */
-};
-
-/**
- * @brief Format of the Attribute Value Field for a Structure
- *
- * @since_tizen 4.0
- */
-struct attribute_struct_s {
- unsigned short n; /**< number of elements */
- struct attribute_element_value *ev; /**< element value */
-};
-
-/**
- * @brief value format for the cluster attribute data
- *
- * @since_tizen 4.0
- */
-struct zb_value_s {
- unsigned char type; /**< value type */
- unsigned short size; /**< size of value */
- unsigned char val[16 + 1]; /**< value */
- struct attribute_str_s *str; /**< for 1 byte string */
- struct attribute_wstr_s *wstr; /**< for 2 byte string */
-};
-
-/**
- * @brief Format of the Read Attribute Status Record Field
- *
- * @since_tizen 4.0
- */
-struct read_attribute_status_record_s {
- unsigned short id; /**< attribute identifier */
- unsigned char status; /**< status */
- unsigned char type; /**< data type */
- unsigned char *value; /**< data value \n
- unsigned int 1~8-byte \n
- signed int : 1~8-byte \n
- enumeration : 1~2-byte \n
- floating point : 2~4-byte \n
- string : from char to MBS \n
- time : 4-byte \n
- identifier : 2~4-byte \n
- miscellaneous : 8~16 byte \n */
-};
-
-/**
- * @brief write attributes data structure
- *
- * @since_tizen 4.0
- */
-struct write_attribute_record_s {
- unsigned short id; /**< attribute identifier */
- unsigned char type; /**< attribute data type */
- unsigned char *value; /**< attribute data */
-};
-
-/**
- * @brief For write attribute response command
- *
- * @since_tizen 4.0
- */
-struct write_attribute_status_record_s {
- unsigned char status; /**< attribute status */
- unsigned short id; /**< attribute identifier */
-};
-
-/**
- * @brief reporting configuration record structure
- *
- * @since_tizen 4.0
- */
-struct reporting_configuration_record_s {
- unsigned char dir; /*(< direction */
- unsigned short id; /**< attribute identifier */
- unsigned char type; /**< attribute data type */
- unsigned short min_i; /**< minimum reporting interval */
- unsigned short max_i; /**< maximum reporting interval */
- unsigned char *change; /**< reportable change */
- unsigned short to; /**< timeout period */
-};
-
-
-/**
- * @brief Format of the Attribute Status Record Field
- *
- * @since_tizen 4.0
- */
-struct reporting_configuration_response_record_s {
- unsigned char status; /**< status */
- unsigned char dir; /**< direction */
- unsigned short id; /**< attribute identifier */
-};
-
-/**
- * @brief Read reporting configuration record
- *
- * @since_tizen 4.0
- */
-struct read_reporting_configuration_record_s {
- unsigned char dir; /**< direction */
- unsigned short id; /**< attribute identifier */
-};
-
-/**
- * @brief Format of the Attribute Report Fields
- *
- * @since_tizen 4.0
- */
-struct attribute_report_s {
- unsigned short id; /**< attribute identifier */
- unsigned char type; /**< attribute type */
- unsigned char *value; /**< attribute value */
-};
-
-/**
- * @brief Format of the Attribute Report Fields
- *
- * @since_tizen 4.0
- */
-struct discover_attribute_info_record_s {
- unsigned short id; /**< attribute identifier */
- unsigned char type; /**< attribute data type */
-};
-
-/**
- * @brief Format of the Extended Attribute Information Fields
- *
- * @since_tizen 4.0
- */
-struct extended_attribute_infomation_s {
- unsigned short id; /**< attribute identifier */
- unsigned char type; /**< attribute data type */
- unsigned char acl; /**< attribute access control */
-};
-
-/**
- * @brief Events
- *
- * @since_tizen 4.0
- */
-
-struct zbl_event_s {
- unsigned char *data; /**< Event data buffer */
- unsigned char len; /**< Event */
-};
-
-#endif /* __TIZTN_NETWORK_ZIGBEE_INTERNAL_COMMON_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2015 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_LOG_H__
-#define __TIZEN_NETWORK_ZIGBEE_LOG_H__
-
-#define IC_LOG_RED "\033[0;31m"
-#define IC_LOG_GREEN "\033[0;32m"
-#define IC_LOG_BROWN "\033[0;33m"
-#define IC_LOG_BLUE "\033[0;34m"
-#define IC_LOG_END "\033[0;m"
-
-#undef _DBG
-#undef _INFO
-#undef _WARN
-#undef _ERR
-
-#undef DBG
-#undef INFO
-#undef WARN
-#undef ERR
-
-#define TIZEN_DEBUG_ENABLE
-#define LOG_TAG "zigbee"
-#include <dlog.h>
-
-#ifdef ZB_ENABLE_DAEMON_LOG
-
-#define _DBG(fmt, arg...) SLOGD(IC_LOG_GREEN "<daemon>" IC_LOG_END fmt, ##arg)
-#define _INFO(fmt, arg...) SLOGI(IC_LOG_GREEN "<daemon>" IC_LOG_END fmt, ##arg)
-#define _WARN(fmt, arg...) SLOGW(IC_LOG_GREEN "<daemon>" IC_LOG_END fmt, ##arg)
-#define _ERR(fmt, arg...) SLOGE(IC_LOG_GREEN "<daemon>" IC_LOG_END fmt, ##arg)
-
-#else /* ZB_ENABLE_DAEMON_LOG */
-
-#define _DBG(fmt, arg...) SLOGD(fmt, ##arg)
-#define _INFO(fmt, arg...) SLOGI(fmt, ##arg)
-#define _WARN(fmt, arg...) SLOGW(fmt, ##arg)
-#define _ERR(fmt, arg...) SLOGE(fmt, ##arg)
-
-#endif /* ZB_ENABLE_DAEMON_LOG */
-
-#if 0 /* for console debugging */
-#define _DBG(fmt, arg...) \
- printf("[zigbee]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
-#define _INFO(fmt, arg...) \
- printf("[zigbee]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
-#define _WARN(fmt, arg...) \
- printf("[zigbee]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
-#define _ERR(fmt, arg...) \
- printf("[zigbee]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
-#endif
-
-#ifdef ZB_ENABLE_CLIENT_LOG
-
-#define FN_CALL _INFO(">>>>>>>> called")
-#define FN_END _INFO("<<<<<<<< ended")
-#define DBG(fmt, arg...) _DBG(fmt, ##arg)
-#define WARN(fmt, arg...) _WARN(IC_LOG_BROWN fmt IC_LOG_END, ##arg)
-#define ERR(fmt, arg...) _ERR(IC_LOG_RED fmt IC_LOG_END, ##arg)
-#define INFO(fmt, arg...) _INFO(IC_LOG_BLUE fmt IC_LOG_END, ##arg)
-#define SECURE_DBG(fmt, arg...) SECURE_SLOGD(fmt, ##arg)
-#define SECURE_ERR(fmt, arg...) SECURE_SLOGE(fmt, ##arg)
-
-#else /* ZB_ENABLE_CLIENT_LOG */
-
-#define FN_CALL
-#define FN_END
-#define DBG(fmt, arg...)
-#define WARN(fmt, arg...)
-#define ERR(fmt, arg...) _ERR(fmt, ##arg)
-#define INFO(fmt, arg...)
-#define SECURE_DBG(fmt, arg...)
-#define SECURE_ERR(fmt, arg...) SECURE_SLOGE(fmt, ##arg)
-
-#endif /* ZB_ENABLE_CLIENT_LOG */
-
-#define RET_IF(expr) \
- do { \
- if (expr) { \
- ERR("(%s)", #expr); \
- return; \
- } \
- } while (0)
-
-#define RETV_IF(expr, val) \
- do {\
- if (expr) { \
- ERR("(%s)", #expr); \
- return (val); \
- } \
- } while (0)
-
-#define RETM_IF(expr, fmt, arg...) \
- do {\
- if (expr) { \
- ERR(fmt, ##arg); \
- return; \
- } \
- } while (0)
-
-#define RETVM_IF(expr, val, fmt, arg...) \
- do {\
- if (expr) { \
- ERR(fmt, ##arg); \
- return (val); \
- } \
- } while (0)
-
-#define ERR_IF(expr) \
- do { \
- if (expr) { \
- ERR("(%s)", #expr); \
- } \
- } while (0)
-
-#define WARN_IF(expr, fmt, arg...) \
- do { \
- if (expr) { \
- WARN(fmt, ##arg); \
- } \
- } while (0)
-
-#endif /* __TIZEN_NETWORK_ZIGBEE_LOG_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2015 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.
- */
-
-#include <errno.h>
-#include <string.h>
-#include <zcl/zb_zcl_type.h>
-
-#include "zb-log.h"
-
-char* zb_utils_strdup(const char *src)
-{
- char *dest = NULL;
-
- RETV_IF(NULL == src, NULL);
-
- errno = 0;
- dest = strdup(src);
- if (NULL == dest) {
- ERR("strdup() Fiil(%d)\n", errno);
- return NULL;
- }
-
- return dest;
-}
+++ /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_INTERNAL_UTIL_H__
-#define __TIZEN_NETWORK_ZIGBEE_INTERNAL_UTIL_H__
-
-char* zb_utils_strdup(const char *src);
-
-
-#endif /* __TIZEN_NETWORK_ZIGBEE_INTERNAL_UTIL_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2015 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_INTERNAL_COMMON_H__
+#define __TIZEN_NETWORK_ZIGBEE_INTERNAL_COMMON_H__
+
+#include <system_info.h>
+
+#include <zb_type.h>
+#include <zb_error.h>
+#include <zdo/zb_zdo_type.h>
+#include <zcl/zb_zcl_type.h>
+
+#define ZIGBEE_ADMIN_FEATURE "http://tizen.org/feature/zigbee.admin"
+#define ZIGBEE_FEATURE "http://tizen.org/feature/zigbee"
+
+#if 1
+#define CHECK_FEATURE_SUPPORTED(feature_name) { \
+ bool zigbee_supported = FALSE; \
+ if (!system_info_get_platform_bool(feature_name, &zigbee_supported)) { \
+ if (zigbee_supported == FALSE) { \
+ ERR("zigbee feature is disabled"); \
+ return ZIGBEE_ERROR_NOT_SUPPORTED; \
+ } \
+ } else { \
+ ERR("Error - Feature getting from System Info"); \
+ return ZIGBEE_ERROR_OPERATION_FAILED; \
+ } \
+}
+#else
+#define CHECK_FEATURE_SUPPORTED(feature_name) { \
+ ERR("Should be check !"); \
+ }
+#endif
+
+#ifndef ZIGBEE_DBUS_INTERFACE
+#define ZIGBEE_DBUS_INTERFACE "org.tizen.zigbee"
+#warning "ZIGBEE_DBUS_INTERFACE is redefined"
+#endif
+
+#ifndef ZIGBEE_DBUS_OBJPATH
+#define ZIGBEE_DBUS_OBJPATH "/org/tizen/zigbee"
+#warning "ZIGBEE_DBUS_OBJPATH is redefined"
+#endif
+
+#define ZIGBEE_SERVER_NAME "org.tizen.zigbee"
+#define ZIGBEE_CONTROL_OBJECT_PATH "/org/tizen/zigbee/control"
+
+#define ZIGBEE_MANAGER_INTERFACE "org.tizen.zigbee.manager"
+#define ZIGBEE_SERVICE_INTERFACE "org.tizen.zigbee.service"
+#define ZIGBEE_SERVICE_OBJECT_PATH "/org/tizen/zigbee/service"
+
+#define ZIGBEE_ZDO_DEV_CONTROL_INTERFACE "org.tizen.zigbee.zdo_dev_control"
+#define ZIGBEE_ZDO_BIND_INTERFACE "org.tizen.zigbee.zdo_bind"
+#define ZIGBEE_ZCL_GLOBAL_CONTROL_INTERFACE "org.tizen.zigbee.zcl_global_control"
+#define ZIGBEE_ZCL_ALARM_INTERFACE "org.tizen.zigbee.zcl_alarm"
+#define ZIGBEE_ZCL_BASIC_INTERFACE "org.tizen.zigbee.zcl_basic"
+#define ZIGBEE_ZCL_COLOR_CONTROL_INTERFACE "org.tizen.zigbee.zcl_color_control"
+#define ZIGBEE_ZCL_ON_OFF_INTERFACE "org.tizen.zigbee.zcl_on_off"
+#define ZIGBEE_ZCL_DOOR_LOCK_INTERFACE "org.tizen.zigbee.zcl_door_lock"
+#define ZIGBEE_ZCL_GROUP_INTERFACE "org.tizen.zigbee.zcl_group"
+#define ZIGBEE_ZCL_FAN_CONTROL_INTERFACE "org.tizen.zigbee.zcl_fan_control"
+#define ZIGBEE_ZCL_IAS_ZONE_INTERFACE "org.tizen.zigbee.zcl_ias_zone"
+#define ZIGBEE_ZCL_IDENTIFY_INTERFACE "org.tizen.zigbee.zcl_identify"
+#define ZIGBEE_ZCL_LEVEL_CONTROL_INTERFACE "org.tizen.zigbee.zcl_level_control"
+#define ZIGBEE_ZCL_POLL_CONTROL_INTERFACE "org.tizen.zigbee.zcl_poll_control"
+#define ZIGBEE_ZCL_SCENE_INTERFACE "org.tizen.zigbee.zcl_scene"
+#define ZIGBEE_ZCL_THERMOSTAT_INTERFACE "org.tizen.zigbee.zcl_thermostat"
+#define ZIGBEE_CUSTOM_INTERFACE "org.tizen.zigbee.custom"
+#define ZIGBEE_MFGLIB_CONTROL_INTERFACE "org.tizen.zigbee.mfglib_control"
+
+
+#define ZIGBEE_BROADCAST_TIMEOUT (9.5 + 2) * 1000 /**< default timeout for gdbus */
+
+#define MAX_DEVICE_LIST 32 /**< maximum end-devices in device list */
+
+#define NOT_USED(var) ((var) = (var))
+
+/*---------------------------------------------------------------------------------------
+ * For ZDO
+ *--------------------------------------------------------------------------------------*/
+
+/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
+ * @brief Fields of the Simple Descriptor
+ * @details Device descriptions contained in node.
+ *
+ * @since_tizen 4.0
+ */
+struct zb_zdo_simple_desc_s {
+ unsigned char ep; /**< Endpoint ID */
+ unsigned short profile_id; /**< Profile ID */
+ unsigned short device_id; /**< Device ID */
+ unsigned char device_ver; /**< Device Version */
+ unsigned char num_of_in_clusters; /**< Number of In-Cluster */
+ unsigned char num_of_out_clusters; /**< Number of Out-Cluster */
+ unsigned short in_clusters[32]; /**< In-Cluster list */
+ unsigned short out_clusters[32]; /**< Out-Cluster list */
+};
+
+/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
+ * @brief Fields of the Node Power Descriptor .
+ * @details Node power characteristics.
+ *
+ * @since_tizen 4.0
+ */
+struct zb_zdo_node_power_descriptor_s {
+ unsigned char current_power_mode; /**< Current Power Mode */
+ unsigned char available_power_sources; /**< Available Power Source */
+ unsigned char current_power_source; /**< Current Power Source */
+ unsigned char current_power_source_level; /**< Current Power Source Level */
+};
+
+/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
+ * @brief Structure for end-device information.
+ *
+ * @since_tizen 4.0
+ */
+struct zb_end_device_info_s {
+ nwk_addr addr16; /**< 16bit network address */
+ ieee_addr addr64; /**< EUI64 ieee address */
+ unsigned char node_type; /**< node type : coordinator, router or end-device */
+ unsigned char capability; /**< mac capability is updated when device_annce received */
+ unsigned char num_of_ep; /**< number of endpoints */
+ unsigned char ep[32]; /**< end-point list */
+ struct zb_zdo_simple_desc_s **desc; /**< Simple Descriptor when get_simple_desc_rsp received */
+ GList *list; /**< list to next */
+};
+
+/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
+ * @brief Fields of the Node Descriptor
+ * @details Type and capabilities of the node.
+ *
+ * @since_tizen 4.0
+ */
+struct zb_zdo_node_descriptor_s {
+ unsigned char logical_type; /**< Logical Role */
+ unsigned char complex_desciptor_available; /**< Complex Descriptor Available \n */
+ unsigned char user_descriptor_available; /**< User Descriptor Available */
+ unsigned char aps_flags; /**< APS Flags */
+ unsigned char frequency_band; /**< Frequency Band */
+ unsigned char mac_capability_flags; /**< MAC Capability Flags */
+ unsigned short manufacturer_code; /**< Manufacturer Code */
+ unsigned char maximum_buffer_size; /**< Maximum Buffer Size */
+ unsigned short maximum_incoming_transfer_size; /**< Maximum Incoming Transfer Size */
+ unsigned short server_mask; /**< Server Mask */
+ unsigned short maximum_outgoing_transfer_size; /**< Maximum Outgoing Transfer Size */
+ unsigned char descriptor_capability_field; /**< Descriptor Capability Field */
+};
+
+/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
+ * @brief NetworkList Record Format.
+ *
+ * @since_tizen 4.0
+ */
+struct zb_zdo_network_list_record_s {
+ ieee_addr extended_pan_id; /**< Extended PAN ID */
+ unsigned char logical_channel; /**< Logical Channel Number */
+ unsigned char stack_profile; /**< Stack Profile Version */
+ unsigned char zigbee_version; /**< Supported Zigbee Protocol Version */
+ unsigned char beacon_order; /**< Beacon Order (See. 802.15.4 PHY/MAC Specification) */
+ unsigned char superframe_order; /**< Superframe Order (See. 802.15.4 PHY/MAC Specification) */
+ unsigned char permit_joining; /**< Permit Joining Flag */
+#if 0
+ unsigned char router_capability;
+ unsigned char end_device_capability;
+#endif
+ GList *list; /**< list to next */
+};
+
+/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
+ * @brief NeighborTableList Record Format.
+ *
+ * @since_tizen 4.0
+ */
+struct zb_zdo_neighbor_table_desc_s {
+ ieee_addr extended_pan_id; /**< Extended PAN ID */
+ ieee_addr addr64; /**< IEEE Address */
+ nwk_addr addr16; /**< Network Address */
+ unsigned char device_type; /**< Device Type see #zb_zdo_logical_type_e */
+ unsigned char rx_on_when_idle; /**< Can Receive on Idle State */
+ unsigned char relationship; /**< Relationship (i.e. parent, children or sibling) */
+ unsigned char permit_joining; /**< Can handle join request */
+ unsigned char depth; /**< Depth from parent */
+ unsigned char lqi; /**< Link Quality Indicator */
+ GList *list; /**< list to next */
+};
+
+/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
+ * @brief RoutingTableList Record Format.
+ *
+ * @since_tizen 4.0
+ */
+struct zb_zdo_routing_table_s {
+ nwk_addr dst_addr; /**< Network Address */
+ unsigned char status; /**< Status */
+ unsigned char memory_constrained; /* Is memory constrained device */
+ unsigned char many_to_one; /* Can support many-to-on endpoint routing */
+ unsigned char route_record_required; /* Route record required */
+ nwk_addr next_hop_addr; /* Next hop address */
+ GList *list; /**< list to next */
+};
+
+/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
+ * @brief BindingTableList Record Format.
+ *
+ * @since_tizen 4.0
+ */
+struct zb_zdo_binding_table_s {
+ ieee_addr src_addr64; /**< IEEE address */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned short cluster_id; /**< Cluster ID */
+ unsigned char dst_addr_mode; /**< Destination address mode */
+ nwk_addr dst_addr16; /**< Destination network address this is up-to dst_addr_mode */
+ ieee_addr dst_addr64; /**< Destination network address this is up-to dst_addr_mode */
+ unsigned char dst_ep; /**< Destination Endpoint */
+ GList *list; /**< next node */
+};
+
+/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZDO_MODULE
+ * @brief DiscoveryCacheList Record Format.
+ *
+ * @since_tizen 4.0
+ */
+struct zb_zdo_discovery_cache_s {
+ ieee_addr addr64; /**< IEEE Address */
+ nwk_addr addr16; /**< Network Address */
+ GList *list; /**< next child */
+};
+
+/*---------------------------------------------------------------------------------------
+ * For ZCL Global Commands
+ *--------------------------------------------------------------------------------------*/
+
+/**
+ * @brief Format of Attribute Value Field for string
+ *
+ * @since_tizen 4.0
+ */
+struct attribute_str_s {
+ unsigned char n; /**< number of elements */
+ unsigned char *v; /**< element value */
+};
+
+/**
+ * @brief Format of Attribute Value Field for wide-string
+ *
+ * @since_tizen 4.0
+ */
+struct attribute_wstr_s {
+ unsigned short n; /**< number of elements */
+ wchar_t *v; /**< element value */
+};
+
+/**
+ * @brief Figure 2.8 Format of Attribute Value Field for an array, Set or Bag in Zigbee Cluster Libarry
+ *
+ * @since_tizen 4.0
+ */
+struct attribute_array_s {
+ unsigned char t; /**< element type */
+ unsigned short n; /**< number of elements */
+ zb_value_h v; /**< element value */
+};
+
+/**
+ * @brief Attribute value sequence
+ *
+ * @since_tizen 4.0
+ */
+struct attribute_element_value {
+ unsigned char t; /**< element type */
+ zb_value_h v; /**< element value */
+};
+
+/**
+ * @brief Format of the Attribute Value Field for a Structure
+ *
+ * @since_tizen 4.0
+ */
+struct attribute_struct_s {
+ unsigned short n; /**< number of elements */
+ struct attribute_element_value *ev; /**< element value */
+};
+
+/**
+ * @brief value format for the cluster attribute data
+ *
+ * @since_tizen 4.0
+ */
+struct zb_value_s {
+ unsigned char type; /**< value type */
+ unsigned short size; /**< size of value */
+ unsigned char val[16 + 1]; /**< value */
+ struct attribute_str_s *str; /**< for 1 byte string */
+ struct attribute_wstr_s *wstr; /**< for 2 byte string */
+};
+
+/**
+ * @brief Format of the Read Attribute Status Record Field
+ *
+ * @since_tizen 4.0
+ */
+struct read_attribute_status_record_s {
+ unsigned short id; /**< attribute identifier */
+ unsigned char status; /**< status */
+ unsigned char type; /**< data type */
+ unsigned char *value; /**< data value \n
+ unsigned int 1~8-byte \n
+ signed int : 1~8-byte \n
+ enumeration : 1~2-byte \n
+ floating point : 2~4-byte \n
+ string : from char to MBS \n
+ time : 4-byte \n
+ identifier : 2~4-byte \n
+ miscellaneous : 8~16 byte \n */
+};
+
+/**
+ * @brief write attributes data structure
+ *
+ * @since_tizen 4.0
+ */
+struct write_attribute_record_s {
+ unsigned short id; /**< attribute identifier */
+ unsigned char type; /**< attribute data type */
+ unsigned char *value; /**< attribute data */
+};
+
+/**
+ * @brief For write attribute response command
+ *
+ * @since_tizen 4.0
+ */
+struct write_attribute_status_record_s {
+ unsigned char status; /**< attribute status */
+ unsigned short id; /**< attribute identifier */
+};
+
+/**
+ * @brief reporting configuration record structure
+ *
+ * @since_tizen 4.0
+ */
+struct reporting_configuration_record_s {
+ unsigned char dir; /*(< direction */
+ unsigned short id; /**< attribute identifier */
+ unsigned char type; /**< attribute data type */
+ unsigned short min_i; /**< minimum reporting interval */
+ unsigned short max_i; /**< maximum reporting interval */
+ unsigned char *change; /**< reportable change */
+ unsigned short to; /**< timeout period */
+};
+
+
+/**
+ * @brief Format of the Attribute Status Record Field
+ *
+ * @since_tizen 4.0
+ */
+struct reporting_configuration_response_record_s {
+ unsigned char status; /**< status */
+ unsigned char dir; /**< direction */
+ unsigned short id; /**< attribute identifier */
+};
+
+/**
+ * @brief Read reporting configuration record
+ *
+ * @since_tizen 4.0
+ */
+struct read_reporting_configuration_record_s {
+ unsigned char dir; /**< direction */
+ unsigned short id; /**< attribute identifier */
+};
+
+/**
+ * @brief Format of the Attribute Report Fields
+ *
+ * @since_tizen 4.0
+ */
+struct attribute_report_s {
+ unsigned short id; /**< attribute identifier */
+ unsigned char type; /**< attribute type */
+ unsigned char *value; /**< attribute value */
+};
+
+/**
+ * @brief Format of the Attribute Report Fields
+ *
+ * @since_tizen 4.0
+ */
+struct discover_attribute_info_record_s {
+ unsigned short id; /**< attribute identifier */
+ unsigned char type; /**< attribute data type */
+};
+
+/**
+ * @brief Format of the Extended Attribute Information Fields
+ *
+ * @since_tizen 4.0
+ */
+struct extended_attribute_infomation_s {
+ unsigned short id; /**< attribute identifier */
+ unsigned char type; /**< attribute data type */
+ unsigned char acl; /**< attribute access control */
+};
+
+/**
+ * @brief Events
+ *
+ * @since_tizen 4.0
+ */
+
+struct zbl_event_s {
+ unsigned char *data; /**< Event data buffer */
+ unsigned char len; /**< Event */
+};
+
+#endif /* __TIZTN_NETWORK_ZIGBEE_INTERNAL_COMMON_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2015 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_LOG_H__
+#define __TIZEN_NETWORK_ZIGBEE_LOG_H__
+
+#define IC_LOG_RED "\033[0;31m"
+#define IC_LOG_GREEN "\033[0;32m"
+#define IC_LOG_BROWN "\033[0;33m"
+#define IC_LOG_BLUE "\033[0;34m"
+#define IC_LOG_END "\033[0;m"
+
+#undef _DBG
+#undef _INFO
+#undef _WARN
+#undef _ERR
+
+#undef DBG
+#undef INFO
+#undef WARN
+#undef ERR
+
+#define TIZEN_DEBUG_ENABLE
+#define LOG_TAG "zigbee"
+#include <dlog.h>
+
+#ifdef ZB_ENABLE_DAEMON_LOG
+
+#define _DBG(fmt, arg...) SLOGD(IC_LOG_GREEN "<daemon>" IC_LOG_END fmt, ##arg)
+#define _INFO(fmt, arg...) SLOGI(IC_LOG_GREEN "<daemon>" IC_LOG_END fmt, ##arg)
+#define _WARN(fmt, arg...) SLOGW(IC_LOG_GREEN "<daemon>" IC_LOG_END fmt, ##arg)
+#define _ERR(fmt, arg...) SLOGE(IC_LOG_GREEN "<daemon>" IC_LOG_END fmt, ##arg)
+
+#else /* ZB_ENABLE_DAEMON_LOG */
+
+#define _DBG(fmt, arg...) SLOGD(fmt, ##arg)
+#define _INFO(fmt, arg...) SLOGI(fmt, ##arg)
+#define _WARN(fmt, arg...) SLOGW(fmt, ##arg)
+#define _ERR(fmt, arg...) SLOGE(fmt, ##arg)
+
+#endif /* ZB_ENABLE_DAEMON_LOG */
+
+#if 0 /* for console debugging */
+#define _DBG(fmt, arg...) \
+ printf("[zigbee]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
+#define _INFO(fmt, arg...) \
+ printf("[zigbee]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
+#define _WARN(fmt, arg...) \
+ printf("[zigbee]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
+#define _ERR(fmt, arg...) \
+ printf("[zigbee]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
+#endif
+
+#ifdef ZB_ENABLE_CLIENT_LOG
+
+#define FN_CALL _INFO(">>>>>>>> called")
+#define FN_END _INFO("<<<<<<<< ended")
+#define DBG(fmt, arg...) _DBG(fmt, ##arg)
+#define WARN(fmt, arg...) _WARN(IC_LOG_BROWN fmt IC_LOG_END, ##arg)
+#define ERR(fmt, arg...) _ERR(IC_LOG_RED fmt IC_LOG_END, ##arg)
+#define INFO(fmt, arg...) _INFO(IC_LOG_BLUE fmt IC_LOG_END, ##arg)
+#define SECURE_DBG(fmt, arg...) SECURE_SLOGD(fmt, ##arg)
+#define SECURE_ERR(fmt, arg...) SECURE_SLOGE(fmt, ##arg)
+
+#else /* ZB_ENABLE_CLIENT_LOG */
+
+#define FN_CALL
+#define FN_END
+#define DBG(fmt, arg...)
+#define WARN(fmt, arg...)
+#define ERR(fmt, arg...) _ERR(fmt, ##arg)
+#define INFO(fmt, arg...)
+#define SECURE_DBG(fmt, arg...)
+#define SECURE_ERR(fmt, arg...) SECURE_SLOGE(fmt, ##arg)
+
+#endif /* ZB_ENABLE_CLIENT_LOG */
+
+#define RET_IF(expr) \
+ do { \
+ if (expr) { \
+ ERR("(%s)", #expr); \
+ return; \
+ } \
+ } while (0)
+
+#define RETV_IF(expr, val) \
+ do {\
+ if (expr) { \
+ ERR("(%s)", #expr); \
+ return (val); \
+ } \
+ } while (0)
+
+#define RETM_IF(expr, fmt, arg...) \
+ do {\
+ if (expr) { \
+ ERR(fmt, ##arg); \
+ return; \
+ } \
+ } while (0)
+
+#define RETVM_IF(expr, val, fmt, arg...) \
+ do {\
+ if (expr) { \
+ ERR(fmt, ##arg); \
+ return (val); \
+ } \
+ } while (0)
+
+#define ERR_IF(expr) \
+ do { \
+ if (expr) { \
+ ERR("(%s)", #expr); \
+ } \
+ } while (0)
+
+#define WARN_IF(expr, fmt, arg...) \
+ do { \
+ if (expr) { \
+ WARN(fmt, ##arg); \
+ } \
+ } while (0)
+
+#endif /* __TIZEN_NETWORK_ZIGBEE_LOG_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2015 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.
+ */
+
+#include <errno.h>
+#include <string.h>
+#include <zcl/zb_zcl_type.h>
+
+#include "zb_log.h"
+
+char* zb_utils_strdup(const char *src)
+{
+ char *dest = NULL;
+
+ RETV_IF(NULL == src, NULL);
+
+ errno = 0;
+ dest = strdup(src);
+ if (NULL == dest) {
+ ERR("strdup() Fiil(%d)\n", errno);
+ return NULL;
+ }
+
+ return dest;
+}
--- /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_INTERNAL_UTIL_H__
+#define __TIZEN_NETWORK_ZIGBEE_INTERNAL_UTIL_H__
+
+char* zb_utils_strdup(const char *src);
+
+
+#endif /* __TIZEN_NETWORK_ZIGBEE_INTERNAL_UTIL_H__ */
ZIGBEE_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
ZIGBEE_ERROR_INVALID_ENDPOINT = TIZEN_ERROR_ZIGBEE | 0x01, /**< Endpoint 0 is reserved for ZDP */
ZIGBEE_ERROR_INVALID_ADDRESS = TIZEN_ERROR_ZIGBEE | 0x02, /**< Wrong address */
+ ZIGBEE_ERROR_OPERATION_FAILED = TIZEN_ERROR_ZIGBEE | 0x03, /**< Operation failed */
} zb_error_e;
/**
#SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/common/${ZB_DBUS}.c
# PROPERTIES GENERATED TRUE)
-pkg_check_modules(client_pkgs REQUIRED glib-2.0 gio-2.0 gio-unix-2.0 dlog capi-base-common)
+pkg_check_modules(client_pkgs REQUIRED glib-2.0 gio-2.0 gio-unix-2.0 dlog capi-base-common capi-system-info)
INCLUDE_DIRECTORIES(${client_pkgs_INCLUDE_DIRS})
# Temporary debug info enable : -g
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <zb-log.h>
-#include <zb-common.h>
+#include <zb_log.h>
+#include <zb_common.h>
#include "zbl.h"
#include "zbl_dbus.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <zb-log.h>
-#include <zb-common.h>
+#include <zb_log.h>
+#include <zb_common.h>
#include <zb_custom.h>
#include "zbl.h"
#include <glib.h>
#include <gio/gio.h>
-#include <zb-log.h>
+#include <zb_log.h>
#include <zb_type.h>
-#include <zb-utils.h>
+#include <zb_utils.h>
#include <zb_error.h>
-#include <zb-common.h>
+#include <zb_common.h>
#include <zcl/zb_zcl_type.h>
#include <zdo/zb_zdo_type.h>
#include <zcl/zb_zcl_attribute_type.h>
#include "zbl.h"
-#include "zb-log.h"
-#include "zb-common.h"
+#include "zb_log.h"
+#include "zb_common.h"
#include "zcl/zb_zcl_type.h"
API const char* zb_get_zcl_error_message(int id)
API int zb_create_read_attr_status_record(read_attr_status_record_h *handle)
{
- RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
read_attr_status_record_h simple = calloc(1, sizeof(struct read_attribute_status_record_s));
+
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
+
+ RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETVM_IF(NULL == simple, ZIGBEE_ERROR_OUT_OF_MEMORY, "calloc() Fail(%d)", errno);
+
*handle = simple;
+
return ZIGBEE_ERROR_NONE;
}
API void zb_destroy_read_attr_status_record(read_attr_status_record_h handle)
{
struct read_attribute_status_record_s* h = handle;
+
RET_IF(NULL == h);
+
if (h->value)
free(h->value);
free(h);
API int zb_create_value(zb_value_h *handle)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
zb_value_h simple = calloc(1, sizeof(struct zb_value_s));
RETVM_IF(NULL == simple, ZIGBEE_ERROR_OUT_OF_MEMORY, "calloc() Fail(%d)", errno);
struct zb_value_s* h = handle;
RET_IF(NULL == h);
+
if (h->str) {
if (h->str->v)
free(h->str->v);
API int zb_create_discover_attr_info(discover_attr_info_record_h *handle)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
+
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
discover_attr_info_record_h simple = calloc(1,
sizeof(struct discover_attribute_info_record_s));
API void zb_destroy_discover_attr_info(discover_attr_info_record_h handle)
{
struct discover_attribute_info_record_s *h = handle;
+
free(h);
}
API int zb_create_write_attr_record(
write_attr_record_h *handle)
{
- RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
write_attr_record_h t = calloc(1, sizeof(struct write_attribute_record_s));
+
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
+
+ RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETVM_IF(NULL == t, ZIGBEE_ERROR_OUT_OF_MEMORY, "calloc() Fail(%d)", errno);
+
*handle = t;
return ZIGBEE_ERROR_NONE;
}
API void zb_destroy_write_attr_record(write_attr_record_h handle)
{
struct write_attribute_record_s* h = handle;
+
RET_IF(NULL == h);
+
if (h->value)
free(h->value);
free(h);
API int zb_create_write_attr_status(write_attr_status_record_h *handle)
{
- RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
write_attr_status_record_h simple = calloc(1,
sizeof(struct write_attribute_status_record_s));
+
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
+
+ RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETVM_IF(NULL == simple, ZIGBEE_ERROR_OUT_OF_MEMORY, "calloc() Fail(%d)", errno);
+
*handle = simple;
+
return ZIGBEE_ERROR_NONE;
}
API void zb_destroy_write_attr_status(write_attr_status_record_h handle)
{
struct write_attribute_status_record_s *h = handle;
+
free(h);
}
API void zb_destroy_report_config_record(report_config_record_h handle)
{
struct reporting_configuration_record_s *h = handle;
+
RET_IF(NULL == h);
+
if (h->change)
free(h->change);
free(h);
API int zb_create_read_report_config_record(read_report_config_record_h *handle)
{
- RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
read_report_config_record_h t =
calloc(1, sizeof(struct read_reporting_configuration_record_s));
+
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
+
+ RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETVM_IF(NULL == t, ZIGBEE_ERROR_OUT_OF_MEMORY, "calloc() Fail(%d)", errno);
+
*handle = t;
+
return ZIGBEE_ERROR_NONE;
}
API void zb_destroy_read_report_config_record(read_report_config_record_h handle)
{
struct read_reporting_configuration_record_s *h = handle;
+
free(h);
}
API int zb_create_report_config_response_record(
report_config_response_record_h *handle)
{
- RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
report_config_response_record_h t =
calloc(1, sizeof(struct reporting_configuration_response_record_s));
+
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
+
+ RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETVM_IF(NULL == t, ZIGBEE_ERROR_OUT_OF_MEMORY, "calloc() Fail(%d)", errno);
+
*handle = t;
+
return ZIGBEE_ERROR_NONE;
}
report_config_response_record_h handle)
{
struct reporting_configuration_response_record_s *h = handle;
+
free(h);
}
API int zb_create_attr_report(attr_report_h *handle)
{
- RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
attr_report_h t = calloc(1, sizeof(struct attribute_report_s));
+
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
+
+ RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETVM_IF(NULL == t, ZIGBEE_ERROR_OUT_OF_MEMORY, "calloc() Fail(%d)", errno);
+
*handle = t;
+
return ZIGBEE_ERROR_NONE;
}
API void zb_destroy_attr_report(attr_report_h handle)
{
struct attribute_report_s *h = handle;
+
if (h) {
if (h->value)
free(h->value);
API int zb_create_extended_attr_info(extended_attr_info_h *handle)
{
- RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
extended_attr_info_h t = calloc(1, sizeof(struct extended_attribute_infomation_s));
+
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
+
+ RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETVM_IF(NULL == t, ZIGBEE_ERROR_OUT_OF_MEMORY, "calloc() Fail(%d)", errno);
+
*handle = t;
+
return ZIGBEE_ERROR_NONE;
}
API void zb_destroy_extended_attr_info(extended_attr_info_h handle)
{
struct extended_attribute_infomation_s *h = handle;
+
free(h);
}
#include <zcl/zb_zcl_alarm_cluster.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zcl_alarm_reset_alarm(zigbee_h handle, nwk_addr addr16, unsigned char ep,
unsigned char alarm_code, unsigned short cluster_id)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_alarm_get_alarm_rsp cb, void *user_data)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zb_error.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zcl_basic_reset_factory_default(zigbee_h handle, nwk_addr addr16,
unsigned char ep)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zcl/zb_zcl_color_control_cluster.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zcl_ccontrol_move_to_hue(zigbee_h handle, nwk_addr addr16,
unsigned char ep, unsigned char hue, unsigned char direction,
unsigned short transition_time)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep, unsigned char move_mode, unsigned char rate)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char transition_time)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned short transition_time)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep, unsigned char move_mode, unsigned char rate)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char transition_time)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned short transition_time)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned short transition_time)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep, unsigned short rate_x, unsigned short rate_y)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned short transition_time)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned short transition_time)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zcl/zb_zcl_global_commands.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
-#include "zb-utils.h"
+#include "zb_utils.h"
+#include "zb_common.h"
API int zb_zcl_global_read_attr(zigbee_h handle, nwk_addr addr16,
unsigned char src_ep, unsigned char dst_ep, unsigned char zcl_frame_ctl,
zb_zcl_global_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_global_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_global_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned short cluster_id, write_attr_record_h *records, int records_len)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_global_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_global_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_global_discover_attr_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#if (0 == ZIGBEE_SUPPORT_ORDERED_SEQUENCE_DATA)
return ZIGBEE_ERROR_NOT_SUPPORTED;
#endif
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#if (0 == ZIGBEE_SUPPORT_ORDERED_SEQUENCE_DATA)
return ZIGBEE_ERROR_NOT_SUPPORTED;
#endif
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char max_command_ids, zb_zcl_global_discover_cmds_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char max_command_ids, zb_zcl_global_discover_cmds_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zcl/zb_zcl_groups_cluster.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zcl_group_add_group(zigbee_h handle, nwk_addr addr16,
unsigned char ep, unsigned short group_id, char *group_name,
zb_zcl_group_add_group_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_group_get_group_membership_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep, unsigned short group_id, const char *group_name)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zcl/zb_zcl_identify_cluster.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zcl_identify(zigbee_h handle, nwk_addr addr16, unsigned char ep,
unsigned short identify_time)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_identify_query_cb cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zcl/zb_zcl_ias_zone_cluster.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zcl_zone_enroll_response(zigbee_h handle, nwk_addr addr16,
unsigned char ep, unsigned char enroll_response_code, unsigned char zone_id)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zb_error.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zcl_levelctrl_move_to_level(zigbee_h handle, nwk_addr addr16,
unsigned char ep, unsigned char level, unsigned short transition_time)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep, unsigned char move_mode, unsigned char rate)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char step_mode, unsigned char step_size, unsigned short transition_time)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
API int zb_zcl_levelctrl_stop(zigbee_h handle, nwk_addr addr16, unsigned char ep)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep, unsigned char level, unsigned short transition_time)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep, unsigned char move_mode, unsigned char rate)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned short transition_time)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zb_error.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zcl_onoff_control(zigbee_h handle, nwk_addr addr16, unsigned char ep,
zb_zcl_onoff_e on_off_type)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zcl/zb_zcl_poll_control_cluster.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zcl_pollctrl_check_in_response(zigbee_h handle, nwk_addr addr16,
unsigned char ep, unsigned char start_fast_polling,
unsigned short fast_poll_timeout)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_pollctrl_check_in cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_pollctrl_check_in cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zcl/zb_zcl_scenes_cluster.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zcl_scene_add_scene(zigbee_h handle, nwk_addr addr16, unsigned char ep,
unsigned short group_id, unsigned char scene_id, unsigned short transition_time,
const char *extension_field_sets, zb_zcl_scene_add_scene_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_scene_remove_scene_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char ep, unsigned short group_id, unsigned char scene_id)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zcl_scene_get_scene_membership_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zcl/zb_zcl_thermostat_cluster.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zcl_thermostat_adjust_setpoint(zigbee_h handle, nwk_addr addr16,
unsigned char ep, unsigned char mode, unsigned char amount)
{
int ret = ZIGBEE_ERROR_NONE;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zdo/zb_zdo_type.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
-#include "zb-common.h"
+#include "zb_common.h"
#define CASE_TO_STR(x) case x: return #x;
API int zb_simple_desc_create(zb_zdo_simple_desc_h *handle)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
zb_zdo_simple_desc_h desc = calloc(1, sizeof(struct zb_zdo_simple_desc_s));
RETVM_IF(NULL == desc, ZIGBEE_ERROR_OUT_OF_MEMORY, "calloc() Fail(%d)", errno);
API int zb_simple_desc_copy(zb_zdo_simple_desc_h src, zb_zdo_simple_desc_h dst)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == src, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == dst, ZIGBEE_ERROR_INVALID_PARAMETER);
memcpy(dst, src, sizeof(struct zb_zdo_simple_desc_s));
API int zb_simple_desc_destroy(zb_zdo_simple_desc_h handle)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
free(handle);
return ZIGBEE_ERROR_NONE;
{
int ret;
unsigned char cnt;
+
RETV_IF(NULL == count, ZIGBEE_ERROR_INVALID_PARAMETER);
ret = zbl_get_all_device_info(list, &cnt);
*count = cnt;
API int zb_node_power_desc_create(zb_zdo_node_power_descriptor_h *handle)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
zb_zdo_node_power_descriptor_h desc =
calloc(1, sizeof(struct zb_zdo_node_power_descriptor_s));
API int zb_node_power_desc_copy(zb_zdo_node_power_descriptor_h src,
zb_zdo_node_power_descriptor_h dst)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == src, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == dst, ZIGBEE_ERROR_INVALID_PARAMETER);
memcpy(dst, src, sizeof(struct zb_zdo_node_power_descriptor_s));
API int zb_node_power_desc_destroy(zb_zdo_node_power_descriptor_h handle)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
free(handle);
return ZIGBEE_ERROR_NONE;
API int zb_node_desc_create(zb_zdo_node_descriptor_h *handle)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
zb_zdo_node_descriptor_h desc = calloc(1, sizeof(struct zb_zdo_node_descriptor_s));
RETVM_IF(NULL == desc, ZIGBEE_ERROR_OUT_OF_MEMORY, "calloc() Fail(%d)", errno);
API int zb_node_desc_copy(zb_zdo_node_descriptor_h src,
zb_zdo_node_descriptor_h dst)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == src, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == dst, ZIGBEE_ERROR_INVALID_PARAMETER);
memcpy(dst, src, sizeof(struct zb_zdo_node_descriptor_s));
API int zb_node_desc_destroy(zb_zdo_node_descriptor_h handle)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
free(handle);
return ZIGBEE_ERROR_NONE;
#include <zdo/zb_zdo_bind_mgr.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zdo_bind_req(zigbee_h handle, nwk_addr dst_addr16,
ieee_addr src_addr64, unsigned char src_ep, unsigned short cluster_id,
unsigned char dst_ep, zb_zdo_bind_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == src_ep || 0 == dst_ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
unsigned char dst_ep, zb_zdo_unbind_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == src_ep || 0 == dst_ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
#include <zdo/zb_zdo_dev_disc.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zdo_nwk_addr_req(zigbee_h handle, ieee_addr addr64,
unsigned char request_type, unsigned char start_idx, zb_zdo_addr_rsp cb,
void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(NULL == addr64, ZIGBEE_ERROR_INVALID_PARAMETER);
void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(NULL == cb, ZIGBEE_ERROR_INVALID_PARAMETER);
void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(NULL == cb, ZIGBEE_ERROR_INVALID_PARAMETER);
zb_zdo_simple_desc_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
API int zb_zdo_extended_simple_desc_req(zigbee_h handle, nwk_addr addr16,
unsigned char start_idx, zb_zdo_extended_simple_desc_rsp cb, void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(NULL == cb, ZIGBEE_ERROR_INVALID_PARAMETER);
unsigned short *out_clusters, zb_zdo_match_desc_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zdo_node_desc_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zdo_power_desc_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zdo_complex_desc_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zdo_user_desc_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
API int zb_zdo_user_desc_set(zigbee_h handle, nwk_addr addr16, unsigned char len,
unsigned char *user_desc, zb_zdo_user_desc_conf cb, void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char capability)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16 || 0 == addr64, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zdo/zb_zdo_nwk_mgr.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
API int zb_zdo_mgmt_nwk_disc_req(zigbee_h handle, nwk_addr addr16,
unsigned int scan_channels, unsigned char scan_duration, unsigned char scan_count,
unsigned char start_idx, zb_zdo_mgmt_nwk_disc_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
ret = zbl_mgmt_nwk_disc_req(addr16, scan_channels, scan_duration, scan_count,
unsigned char start_idx, zb_zdo_mgmt_lqi_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
ret = zbl_mgmt_lqi_req(addr16, start_idx, cb, user_data);
unsigned char start_idx, zb_zdo_mgmt_rtg_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
ret = zbl_mgmt_rtg_req(addr16, start_idx, cb, user_data);
unsigned char start_idx, zb_zdo_mgmt_bind_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
ret = zbl_mgmt_bind_req(addr16, start_idx, cb, user_data);
void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr64, ZIGBEE_ERROR_INVALID_ADDRESS);
API int zb_zdo_mgmt_direct_join_req(zigbee_h handle, ieee_addr addr64,
unsigned char capability, zb_zdo_mgmt_direct_join_rsp cb, void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr64, ZIGBEE_ERROR_INVALID_ADDRESS);
zb_zdo_mgmt_permit_joining_rsp cb, void *user_data)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
ret = zbl_mgmt_permit_joining_req(addr16, duration, tc_significance, cb, user_data);
API int zb_zdo_mgmt_cache_req(zigbee_h handle, nwk_addr addr16,
unsigned char start_idx, zb_zdo_mgmt_cache_rsp cb, void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
return ZIGBEE_ERROR_NONE;
nwk_addr nwk_manager_addr)
{
int ret;
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == nwk_manager_addr, ZIGBEE_ERROR_INVALID_ADDRESS);
#include <zdo/zb_zdo_dev_disc.h>
#include "zbl.h"
-#include "zb-log.h"
+#include "zb_log.h"
#include "zbl_dbus.h"
+#include "zb_common.h"
#ifdef ZB_SUPPORT_PRIORITY_5
API int zb_zdo_system_server_discover_req(zigbee_h handle,
unsigned short server_mask, zb_zdo_system_server_discover_rsp cb, void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
return ZIGBEE_ERROR_NONE;
API int zb_zdo_find_node_cache_req(zigbee_h handle, nwk_addr addr16,
ieee_addr addr64, zb_zdo_find_node_cache_rsp cb, void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16 || 0 == addr64, ZIGBEE_ERROR_INVALID_ADDRESS);
API int zb_zdo_discovery_cache_req(zigbee_h handle, nwk_addr addr16,
ieee_addr addr64, zb_zdo_discovery_cache_rsp cb, void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16 || 0 == addr64, ZIGBEE_ERROR_INVALID_ADDRESS);
unsigned char active_ep_size, unsigned char simple_desc_count,
unsigned char *simple_desc_list, zb_zdo_discovery_store_rsp cb, void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16 || 0 == addr64, ZIGBEE_ERROR_INVALID_ADDRESS);
ieee_addr addr64, zb_zdo_node_descriptor_h nodedsc, zb_zdo_node_desc_store_rsp cb,
void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16 || 0 == addr64, ZIGBEE_ERROR_INVALID_ADDRESS);
ieee_addr addr64, zb_zdo_node_power_descriptor_h powerdsc,
zb_zdo_power_desc_store_rsp cb, void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
return ZIGBEE_ERROR_NONE;
ieee_addr addr64, unsigned char active_ep_count, unsigned char *ep_list,
zb_zdo_active_ep_store_rsp cb, void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16 || 0 == addr64, ZIGBEE_ERROR_INVALID_ADDRESS);
ieee_addr addr64, zb_zdo_simple_desc_h simpledsc, zb_zdo_simple_desc_store_rsp cb,
void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16 || 0 == addr64, ZIGBEE_ERROR_INVALID_ADDRESS);
API int zb_zdo_remove_node_cache_req(zigbee_h handle, nwk_addr addr16,
ieee_addr addr64, zb_zdo_remove_node_cache_rsp cb, void *user_data)
{
+ CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
RETV_IF(0 == addr16 || 0 == addr64, ZIGBEE_ERROR_INVALID_ADDRESS);
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(capi-base-common)
+BuildRequires: pkgconfig(capi-system-info)
%if 0%{?tizen_version_major} >= 3
BuildRequires: pkgconfig(cynara-client)
BuildRequires: pkgconfig(cynara-session)