Fix ACR issue
authorsaerome.kim <saerome.kim@samsung.com>
Wed, 22 Mar 2017 13:44:37 +0000 (22:44 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Thu, 11 May 2017 09:07:20 +0000 (18:07 +0900)
 - Add feature check routines for feature dependent APIs

Change-Id: I07e84a869f9ce363887bf409b15db06ff512dd8c
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
28 files changed:
common/zb_common.h [moved from common/zb-common.h with 95% similarity]
common/zb_log.h [moved from common/zb-log.h with 100% similarity]
common/zb_utils.c [moved from common/zb-utils.c with 97% similarity]
common/zb_utils.h [moved from common/zb-utils.h with 100% similarity]
include/zb_error.h
lib/CMakeLists.txt
lib/zbl.c
lib/zbl_custom.c
lib/zbl_dbus.c
lib/zbl_zcl.c
lib/zbl_zcl_alarm.c
lib/zbl_zcl_basic.c
lib/zbl_zcl_color_control.c
lib/zbl_zcl_global_commands.c
lib/zbl_zcl_groups.c
lib/zbl_zcl_identify.c
lib/zbl_zcl_isa_zone.c
lib/zbl_zcl_level_control.c
lib/zbl_zcl_on_off.c
lib/zbl_zcl_poll_control.c
lib/zbl_zcl_scenes.c
lib/zbl_zcl_thermostat.c
lib/zbl_zdo.c
lib/zbl_zdo_bind_mgr.c
lib/zbl_zdo_dev_disc.c
lib/zbl_zdo_nwk_mgr.c
lib/zbl_zdo_svc_disc.c
packaging/capi-network-zigbee.spec

similarity index 95%
rename from common/zb-common.h
rename to common/zb_common.h
index 08de6e3..758ce2c 100644 (file)
 #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"
similarity index 100%
rename from common/zb-log.h
rename to common/zb_log.h
similarity index 97%
rename from common/zb-utils.c
rename to common/zb_utils.c
index aea0bd1..8886d21 100644 (file)
@@ -18,7 +18,7 @@
 #include <string.h>
 #include <zcl/zb_zcl_type.h>
 
-#include "zb-log.h"
+#include "zb_log.h"
 
 char* zb_utils_strdup(const char *src)
 {
similarity index 100%
rename from common/zb-utils.h
rename to common/zb_utils.h
index 1a4fc15..3b8f502 100644 (file)
@@ -44,6 +44,7 @@ typedef enum {
        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;
 
 /**
index e283b00..1a50b5e 100644 (file)
@@ -8,7 +8,7 @@ FILE(GLOB CLIENT_SRCS *.c ${CMAKE_SOURCE_DIR}/common/*.c)
 #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
index 8494fc8..630874c 100644 (file)
--- a/lib/zbl.c
+++ b/lib/zbl.c
@@ -18,8 +18,8 @@
 #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"
index 15ead9f..ff103cd 100644 (file)
@@ -18,8 +18,8 @@
 #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"
index be28d60..99e217d 100644 (file)
 #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>
 
index e49a9ff..6ccb1e8 100644 (file)
@@ -8,8 +8,8 @@
 #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)
@@ -428,17 +428,24 @@ API int zb_get_data_size(unsigned char type)
 
 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);
@@ -610,6 +617,7 @@ API int zb_set_value_to_read_attr_status_record(read_attr_status_record_h handle
 
 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);
@@ -622,6 +630,7 @@ API void zb_destroy_value(zb_value_h handle)
        struct zb_value_s* h = handle;
 
        RET_IF(NULL == h);
+
        if (h->str) {
                if (h->str->v)
                        free(h->str->v);
@@ -729,6 +738,8 @@ API int zb_get_value(zb_value_h handle, unsigned char *type, unsigned char **val
 
 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));
@@ -740,6 +751,7 @@ API int zb_create_discover_attr_info(discover_attr_info_record_h *handle)
 API void zb_destroy_discover_attr_info(discover_attr_info_record_h handle)
 {
        struct discover_attribute_info_record_s *h = handle;
+
        free(h);
 }
 
@@ -788,9 +800,13 @@ API int zb_set_type_to_discover_attr_info(
 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;
 }
@@ -798,7 +814,9 @@ API int zb_create_write_attr_record(
 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);
@@ -905,17 +923,23 @@ API int zb_set_value_to_write_attr_record(write_attr_record_h handle, zb_value_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);
 }
 
@@ -970,7 +994,9 @@ API int zb_create_report_config_record(report_config_record_h *handle)
 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);
@@ -1236,17 +1262,23 @@ API int zb_get_change_from_report_config_record3(report_config_record_h handle,
 
 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);
 }
 
@@ -1292,11 +1324,16 @@ API int zb_get_id_from_read_report_config_record(read_report_config_record_h han
 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;
 }
 
@@ -1304,6 +1341,7 @@ API void zb_destroy_report_config_response_record(
                report_config_response_record_h handle)
 {
        struct reporting_configuration_response_record_s *h = handle;
+
        free(h);
 }
 
@@ -1366,16 +1404,22 @@ API int zb_set_id_to_report_config_response_record(
 
 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);
@@ -1573,16 +1617,22 @@ struct write_attribute_structured_record_s {
 
 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);
 }
 
index ac6c1a6..b58b660 100644 (file)
 #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);
@@ -38,6 +40,7 @@ API int zb_zcl_alarm_reset_all_alarm(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);
@@ -51,6 +54,7 @@ API int zb_zcl_alarm_get_alarm(zigbee_h handle, nwk_addr addr16, unsigned char e
                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);
@@ -64,6 +68,7 @@ API int zb_zcl_alarm_reset_all_alarm_log(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);
index a56607e..110aef6 100644 (file)
 #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);
index 027a748..0069a30 100644 (file)
 #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);
@@ -39,6 +41,7 @@ API int zb_zcl_ccontrol_move_hue(zigbee_h handle, nwk_addr addr16,
                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);
@@ -53,6 +56,7 @@ API int zb_zcl_ccontrol_step_hue(zigbee_h handle, nwk_addr addr16,
                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);
@@ -67,6 +71,7 @@ API int zb_zcl_ccontrol_move_to_saturation(zigbee_h handle,
                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);
@@ -80,6 +85,7 @@ API int zb_zcl_ccontrol_move_saturation(zigbee_h handle, nwk_addr addr16,
                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);
@@ -94,6 +100,7 @@ API int zb_zcl_ccontrol_step_saturation(zigbee_h handle, nwk_addr addr16,
                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);
@@ -108,6 +115,7 @@ API int zb_zcl_ccontrol_move_to_hue_and_saturation(zigbee_h handle,
                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);
@@ -122,6 +130,7 @@ API int zb_zcl_ccontrol_move_to_color(zigbee_h handle, nwk_addr addr16,
                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);
@@ -135,6 +144,7 @@ API int zb_zcl_ccontrol_move_color(zigbee_h handle, nwk_addr addr16,
                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);
@@ -149,6 +159,7 @@ API int zb_zcl_ccontrol_step_color(zigbee_h handle, nwk_addr addr16,
                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);
@@ -163,6 +174,7 @@ API int zb_zcl_ccontrol_move_to_color_temperature(zigbee_h handle,
                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);
index bb9b103..5dd8f11 100644 (file)
 #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,
@@ -28,6 +29,7 @@ API int zb_zcl_global_read_attr(zigbee_h handle, nwk_addr addr16,
                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);
@@ -45,6 +47,7 @@ API int zb_zcl_global_write_attr(zigbee_h handle, nwk_addr addr16,
                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);
@@ -62,6 +65,7 @@ API int zb_zcl_global_write_attr_undivided(zigbee_h handle,
                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);
@@ -78,6 +82,7 @@ API int zb_zcl_global_write_attr_no_rsp(zigbee_h handle, nwk_addr addr16,
                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);
@@ -95,6 +100,7 @@ API int zb_zcl_global_config_report(zigbee_h handle, nwk_addr addr16,
                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);
@@ -112,6 +118,7 @@ API int zb_zcl_global_read_config_report(zigbee_h handle, nwk_addr addr16,
                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);
@@ -129,6 +136,7 @@ API int zb_zcl_global_discover_attr(zigbee_h handle, nwk_addr addr16,
                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);
@@ -146,6 +154,7 @@ API int zb_zcl_global_read_attr_structured(zigbee_h handle, nwk_addr addr16,
 #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);
@@ -164,6 +173,7 @@ API int zb_zcl_global_write_attr_structured(zigbee_h handle, nwk_addr addr16,
 #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);
@@ -180,6 +190,7 @@ API int zb_zcl_global_discover_cmds_received(zigbee_h handle,
                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);
@@ -195,6 +206,7 @@ API int zb_zcl_global_discover_cmds_generated(zigbee_h handle,
                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);
@@ -211,6 +223,7 @@ API int zb_zcl_global_discover_attr_extended(zigbee_h handle,
                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);
index ae00aeb..519067e 100644 (file)
 #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);
@@ -40,6 +42,7 @@ API int zb_zcl_group_view_group(zigbee_h handle, nwk_addr addr16,
                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);
@@ -53,6 +56,7 @@ API int zb_zcl_group_get_group_membership(zigbee_h handle, nwk_addr addr16,
                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);
@@ -67,6 +71,7 @@ API int zb_zcl_group_remove_group(zigbee_h handle, nwk_addr addr16,
                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);
@@ -79,6 +84,7 @@ API int zb_zcl_group_remove_all_group(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);
@@ -91,6 +97,7 @@ API int zb_zcl_group_add_group_if_identifying(zigbee_h handle, nwk_addr addr16,
                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);
index 1246ba3..4c08406 100644 (file)
 #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);
@@ -37,6 +39,7 @@ API int zb_zcl_identify_query(zigbee_h handle, nwk_addr addr16, unsigned char ep
                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);
index fcc8dc2..2dd6e7c 100644 (file)
 #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);
index 80e031c..13a6483 100644 (file)
 #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);
@@ -37,6 +39,7 @@ API int zb_zcl_levelctrl_move(zigbee_h handle, nwk_addr addr16,
                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);
@@ -50,6 +53,7 @@ API int zb_zcl_levelctrl_step(zigbee_h handle, nwk_addr addr16, unsigned char ep
                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);
@@ -62,6 +66,7 @@ API int zb_zcl_levelctrl_step(zigbee_h handle, nwk_addr addr16, unsigned char ep
 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);
@@ -75,6 +80,7 @@ API int zb_zcl_levelctrl_move_to_level_with_on_off(zigbee_h handle, nwk_addr add
                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);
@@ -88,6 +94,7 @@ API int zb_zcl_levelctrl_move_with_on_off(zigbee_h handle, nwk_addr addr16,
                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);
@@ -102,6 +109,7 @@ API int zb_zcl_levelctrl_step_with_on_off(zigbee_h handle, nwk_addr addr16,
                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);
index 9c13857..935b212 100644 (file)
 #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);
index 20afba6..cd461b2 100644 (file)
 #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);
@@ -39,6 +41,7 @@ API int zb_zcl_pollctrl_fast_poll_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);
@@ -52,6 +55,7 @@ API int zb_zcl_pollctrl_set_long_poll_interval(zigbee_h handle,
                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);
@@ -66,6 +70,7 @@ API int zb_zcl_pollctrl_set_short_poll_interval(zigbee_h handle,
                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);
index c9c2d4f..cbfdd0e 100644 (file)
@@ -18,8 +18,9 @@
 #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,
@@ -27,6 +28,7 @@ API int zb_zcl_scene_add_scene(zigbee_h handle, nwk_addr addr16, unsigned char e
                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);
@@ -43,6 +45,7 @@ API int zb_zcl_scene_view_scene(zigbee_h handle, nwk_addr addr16, unsigned char
                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);
@@ -56,6 +59,7 @@ API int zb_zcl_scene_remove_scene(zigbee_h handle, nwk_addr addr16,
                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);
@@ -69,6 +73,7 @@ API int zb_zcl_scene_remove_all_scene(zigbee_h handle, nwk_addr addr16,
                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);
@@ -82,6 +87,7 @@ API int zb_zcl_scene_store_scene(zigbee_h handle, nwk_addr addr16, unsigned char
                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);
@@ -94,6 +100,7 @@ API int zb_zcl_scene_recall_scene(zigbee_h handle, nwk_addr addr16,
                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);
@@ -107,6 +114,7 @@ API int zb_zcl_scene_get_scene_membership(zigbee_h handle, nwk_addr addr16,
                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);
index e3c558c..4ec843b 100644 (file)
 #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);
index 577c973..16546cc 100644 (file)
@@ -23,9 +23,9 @@
 #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;
 
@@ -117,6 +117,7 @@ API const char* zb_get_device_id_string(int device_id)
 
 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);
@@ -126,6 +127,7 @@ API int zb_simple_desc_create(zb_zdo_simple_desc_h *handle)
 
 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));
@@ -134,6 +136,7 @@ API int zb_simple_desc_copy(zb_zdo_simple_desc_h src, zb_zdo_simple_desc_h dst)
 
 API int zb_simple_desc_destroy(zb_zdo_simple_desc_h handle)
 {
+       CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
        RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
        free(handle);
        return ZIGBEE_ERROR_NONE;
@@ -284,6 +287,7 @@ API int zb_get_all_device_list(zigbee_h handle, int *count, zb_end_device_info_h
 {
        int ret;
        unsigned char cnt;
+
        RETV_IF(NULL == count, ZIGBEE_ERROR_INVALID_PARAMETER);
        ret = zbl_get_all_device_info(list, &cnt);
        *count = cnt;
@@ -457,6 +461,7 @@ API int zb_get_security_capabilty(zb_end_device_info_h handle,
 
 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));
@@ -468,6 +473,7 @@ API int zb_node_power_desc_create(zb_zdo_node_power_descriptor_h *handle)
 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));
@@ -476,6 +482,7 @@ API int zb_node_power_desc_copy(zb_zdo_node_power_descriptor_h src,
 
 API int zb_node_power_desc_destroy(zb_zdo_node_power_descriptor_h handle)
 {
+       CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
        RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
        free(handle);
        return ZIGBEE_ERROR_NONE;
@@ -555,6 +562,7 @@ API int zb_node_power_desc_set_current_power_source_level(
 
 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);
@@ -565,6 +573,7 @@ API int zb_node_desc_create(zb_zdo_node_descriptor_h *handle)
 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));
@@ -573,6 +582,7 @@ API int zb_node_desc_copy(zb_zdo_node_descriptor_h src,
 
 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;
index 22e9363..dc2f314 100644 (file)
@@ -19,8 +19,9 @@
 #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,
@@ -28,6 +29,7 @@ API int zb_zdo_bind_req(zigbee_h handle, nwk_addr dst_addr16,
                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);
@@ -42,6 +44,7 @@ API int zb_zdo_unbind_req(zigbee_h handle, nwk_addr dst_addr16,
                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);
index f7f8c18..313bef1 100644 (file)
 #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);
@@ -41,6 +43,7 @@ API int zb_zdo_ieee_addr_req(zigbee_h handle, nwk_addr addr16, zb_zdo_addr_rsp c
                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);
@@ -52,6 +55,7 @@ API int zb_zdo_active_ep(zigbee_h handle, nwk_addr addr16, zb_zdo_active_ep_rsp
                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);
@@ -63,6 +67,7 @@ API int zb_zdo_simple_desc_req(zigbee_h handle, nwk_addr addr16, unsigned char e
                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);
@@ -75,6 +80,7 @@ API int zb_zdo_simple_desc_req(zigbee_h handle, nwk_addr addr16, unsigned char e
 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);
@@ -88,6 +94,7 @@ API int zb_zdo_match_desc_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -104,6 +111,7 @@ API int zb_zdo_node_desc_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -116,6 +124,7 @@ API int zb_zdo_power_desc_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -128,6 +137,7 @@ API int zb_zdo_complex_desc_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -140,6 +150,7 @@ API int zb_zdo_user_desc_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -151,6 +162,7 @@ API int zb_zdo_user_desc_req(zigbee_h handle, nwk_addr addr16,
 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);
@@ -162,6 +174,7 @@ API int zb_zdo_device_annce(zigbee_h handle, nwk_addr addr16, ieee_addr addr64,
                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);
index 8252b1f..3a32c4b 100644 (file)
 #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,
@@ -38,6 +40,7 @@ API int zb_zdo_mgmt_lqi_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -48,6 +51,7 @@ API int zb_zdo_mgmt_rtg_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -58,6 +62,7 @@ API int zb_zdo_mgmt_bind_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -69,6 +74,7 @@ API int zb_zdo_mgmt_leave_req(zigbee_h handle, ieee_addr addr64,
                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);
@@ -80,6 +86,7 @@ API int zb_zdo_mgmt_leave_req(zigbee_h handle, ieee_addr addr64,
 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);
@@ -92,6 +99,7 @@ API int zb_zdo_mgmt_permit_joining_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -102,6 +110,7 @@ API int zb_zdo_mgmt_permit_joining_req(zigbee_h handle, nwk_addr addr16,
 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;
@@ -113,6 +122,7 @@ API int zb_zdo_mgmt_nwk_update_req(zigbee_h handle, unsigned int scan_channels,
        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);
index 5d6f1d1..9316b39 100644 (file)
 #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;
@@ -35,6 +37,7 @@ API int zb_zdo_system_server_discover_req(zigbee_h handle,
 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);
@@ -44,6 +47,7 @@ API int zb_zdo_find_node_cache_req(zigbee_h handle, nwk_addr addr16,
 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);
@@ -56,6 +60,7 @@ API int zb_zdo_discovery_store_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -68,6 +73,7 @@ API int zb_zdo_node_desc_store_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -80,6 +86,7 @@ API int zb_zdo_power_desc_store_req(zigbee_h handle, nwk_addr addr16,
                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;
@@ -89,6 +96,7 @@ API int zb_zdo_active_ep_store_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -101,6 +109,7 @@ API int zb_zdo_simple_desc_store_req(zigbee_h handle, nwk_addr addr16,
                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);
@@ -112,6 +121,7 @@ API int zb_zdo_simple_desc_store_req(zigbee_h handle, nwk_addr addr16,
 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);
index fe58f9a..679e769 100644 (file)
@@ -13,6 +13,7 @@ BuildRequires: pkgconfig(dbus-glib-1)
 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)