From 2c42a6fe740f0e0052b3224c07477aed1bbe4e3f Mon Sep 17 00:00:00 2001 From: "saerome.kim" Date: Wed, 18 Jul 2018 09:36:08 +0900 Subject: [PATCH] Fixed build error - GBS system in TestHub seems not to recognize PATTERN matching in CMakeFiles.txt so, removing filtering PATTERN. Change-Id: Id172020e3f7c1456a1f1a09fdc98b4281e5d5080 Signed-off-by: saerome.kim --- CMakeLists.txt | 118 +++++++++++++++++++++++++-- capi-network-zigbee.pc.in | 13 +++ common/CMakeLists.txt | 14 ---- include/zigbee-zcl_private.h | 77 +++++++---------- lib/CMakeLists.txt | 31 ------- lib/capi-network-zigbee.pc.in | 11 --- packaging/capi-network-zigbee.spec | 23 ++++-- {lib => src}/zbl-custom.c | 0 {lib => src}/zbl-dbus.c | 4 - {lib => src}/zbl-dbus.h | 0 {lib => src}/zbl-zcl-alarm.c | 0 {lib => src}/zbl-zcl-basic.c | 0 {lib => src}/zbl-zcl-color-control.c | 0 {lib => src}/zbl-zcl-global-cmd.c | 0 {lib => src}/zbl-zcl-groups.c | 0 {lib => src}/zbl-zcl-identify.c | 0 {lib => src}/zbl-zcl-isa-zone.c | 0 {lib => src}/zbl-zcl-level-control.c | 0 {lib => src}/zbl-zcl-on-off.c | 0 {lib => src}/zbl-zcl-poll-control.c | 0 {lib => src}/zbl-zcl-scenes.c | 0 {lib => src}/zbl-zcl-thermostat.c | 0 {lib => src}/zbl-zcl.c | 0 {lib => src}/zbl-zdo-bind-mgr.c | 0 {lib => src}/zbl-zdo-dev-disc.c | 0 {lib => src}/zbl-zdo-nwk-mgr.c | 0 {lib => src}/zbl-zdo-svc-disc.c | 0 {lib => src}/zbl-zdo.c | 0 {lib => src}/zbl.c | 0 {lib => src}/zbl.h | 0 test/main.c | 4 +- 31 files changed, 173 insertions(+), 122 deletions(-) create mode 100644 capi-network-zigbee.pc.in delete mode 100644 common/CMakeLists.txt delete mode 100644 lib/CMakeLists.txt delete mode 100644 lib/capi-network-zigbee.pc.in rename {lib => src}/zbl-custom.c (100%) rename {lib => src}/zbl-dbus.c (99%) rename {lib => src}/zbl-dbus.h (100%) rename {lib => src}/zbl-zcl-alarm.c (100%) rename {lib => src}/zbl-zcl-basic.c (100%) rename {lib => src}/zbl-zcl-color-control.c (100%) rename {lib => src}/zbl-zcl-global-cmd.c (100%) rename {lib => src}/zbl-zcl-groups.c (100%) rename {lib => src}/zbl-zcl-identify.c (100%) rename {lib => src}/zbl-zcl-isa-zone.c (100%) rename {lib => src}/zbl-zcl-level-control.c (100%) rename {lib => src}/zbl-zcl-on-off.c (100%) rename {lib => src}/zbl-zcl-poll-control.c (100%) rename {lib => src}/zbl-zcl-scenes.c (100%) rename {lib => src}/zbl-zcl-thermostat.c (100%) rename {lib => src}/zbl-zcl.c (100%) rename {lib => src}/zbl-zdo-bind-mgr.c (100%) rename {lib => src}/zbl-zdo-dev-disc.c (100%) rename {lib => src}/zbl-zdo-nwk-mgr.c (100%) rename {lib => src}/zbl-zdo-svc-disc.c (100%) rename {lib => src}/zbl-zdo.c (100%) rename {lib => src}/zbl.c (100%) rename {lib => src}/zbl.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3e97a5..d7f9185 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,23 +1,125 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(capi-network-zigbee C) +SET(fw_name "capi-network-zigbee") -INCLUDE(FindPkgConfig) +PROJECT(${fw_name}) + +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) + +SET(LIB ${LIB_PATH}) +SET(LIBDIR ${PREFIX}/${LIB_PATH}) + +SET(INC_DIR include) +INCLUDE_DIRECTORIES(${INC_DIR}) +INCLUDE_DIRECTORIES(common) -#SET(EXTRA_CFLAGS "-Wall -Werror-implicit-function-declaration -fvisibility=hidden -fsanitize=address") -SET(EXTRA_CFLAGS "-Wall -Werror-implicit-function-declaration -fvisibility=hidden") -SET(CMAKE_C_FLAGS ${CMAKE_CFALGS} ${EXTRA_CFLAGS}) +SET(dependents "dlog capi-system-info glib-2.0 gio-2.0") +SET(pc_dependents "") SET(CAPI_NETWORK_ZIGBEE "capi-network-zigbee") SET(CLIENT ${PROJECT_NAME}) + +# for D-Bus SET(DBUS_INTERFACE "org.tizen.zigbee") SET(DBUS_OBJECT_PATH "/org/tizen/zigbee") +ADD_DEFINITIONS("-DZIGBEE_DBUS_INTERFACE=\"${DBUS_INTERFACE}\"") +ADD_DEFINITIONS("-DZIGBEE_DBUS_OBJPATH=\"${DBUS_OBJECT_PATH}\"") # enable client log ADD_DEFINITIONS("-DZB_ENABLE_CLIENT_LOG") + +# Enable Global Command Response Async. IF(ZB_FEATURE_GLOBAL_RSP_SYNC) -ADD_DEFINITIONS("-DZB_FEATURE_GLOBAL_RSP_SYNC") + ADD_DEFINITIONS("-DZB_FEATURE_GLOBAL_RSP_SYNC") ENDIF(ZB_FEATURE_GLOBAL_RSP_SYNC) -ADD_SUBDIRECTORY(common) -ADD_SUBDIRECTORY(lib) +INCLUDE(FindPkgConfig) +pkg_check_modules(${fw_name} REQUIRED ${dependents} ${APPFW_REQUIRED_PKGS}) +FOREACH(flag ${${fw_name}_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +IF(BUILD_GCOV) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror-implicit-function-declaration -Werror -g -fvisibility=hidden -fprofile-arcs -ftest-coverage") + +ELSE(BUILD_GCOV) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror-implicit-function-declaration -Werror -g -fvisibility=hidden") + +ENDIF(BUILD_GCOV) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror-implicit-function-declaration -Werror -g -fvisibility=hidden") + +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") + +IF("${ARCH}" STREQUAL "arm") + ADD_DEFINITIONS("-DTARGET") +ENDIF("${ARCH}" STREQUAL "arm") + +ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") +ADD_DEFINITIONS("-DTIZEN_DEBUG") + +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIBDIR}") + +aux_source_directory(common COMMON_SOURCES) +aux_source_directory(src SOURCES) +ADD_LIBRARY(${fw_name} SHARED ${COMMON_SOURCES} ${SOURCES}) + +TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS}) + +SET_TARGET_PROPERTIES(${fw_name} + PROPERTIES + VERSION ${FULLVER} + SOVERSION ${MAJORVER} + CLEAN_DIRECT_OUTPUT 1 +) + +INSTALL(TARGETS ${fw_name} DESTINATION ${LIB}) +INSTALL( + DIRECTORY ${INC_DIR}/ DESTINATION include/network + FILES_MATCHING + PATTERN "_private.h" EXCLUDE + PATTERN "${INC_DIR}/*.h" + ) + +SET(PC_NAME ${fw_name}) +SET(PC_REQUIRED ${pc_dependents}) +SET(PC_LDFLAGS -l${fw_name}) + +CONFIGURE_FILE( + ${fw_name}.pc.in + ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc + @ONLY +) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB}/pkgconfig) + ADD_SUBDIRECTORY(test) + +IF(UNIX) + +ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution) +ADD_CUSTOM_COMMAND( + DEPENDS clean + COMMENT "distribution clean" + COMMAND find + ARGS . + -not -name config.cmake -and \( + -name tester.c -or + -name Testing -or + -name CMakeFiles -or + -name cmake.depends -or + -name cmake.check_depends -or + -name CMakeCache.txt -or + -name cmake.check_cache -or + -name *.cmake -or + -name Makefile -or + -name core -or + -name core.* -or + -name gmon.out -or + -name install_manifest.txt -or + -name *.pc -or + -name *~ \) + | grep -v TC | xargs rm -rf + TARGET distclean + VERBATIM +) + +ENDIF(UNIX) diff --git a/capi-network-zigbee.pc.in b/capi-network-zigbee.pc.in new file mode 100644 index 0000000..b4937b7 --- /dev/null +++ b/capi-network-zigbee.pc.in @@ -0,0 +1,13 @@ +# Package Information for pkg-config + +prefix=@PREFIX@ +exec_prefix=${prefix}/bin +libdir=@LIB_INSTALL_DIR@ +includedir=@INCLUDE_INSTALL_DIR@/network + +Name: @PC_NAME@ +Description: @PACKAGE_DESCRIPTION@ +Version: @FULLVER@ +Requires: @PC_REQUIRED@ +Libs: -L${libdir} @PC_LDFLAGS@ +Cflags: -I${includedir} -I${includedir}/network diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt deleted file mode 100644 index 7837c17..0000000 --- a/common/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -#FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen) - -#MESSAGE("${GDBUS_CODEGEN}") -#ADD_CUSTOM_COMMAND( -# OUTPUT dbus -# COMMAND ${GDBUS_CODEGEN} --generate-c-code ${ZB_DBUS} -# --interface-prefix org.tizen.zigbee. -# --c-namespace zb -# ${ZB_DBUS}.xml -# DEPENDS ${ZB_DBUS}.xml) - -#ADD_CUSTOM_TARGET(GENERATED_DBUS_CODE DEPENDS dbus) - -#MESSAGE("${dbus}") diff --git a/include/zigbee-zcl_private.h b/include/zigbee-zcl_private.h index ff0b359..b337f65 100644 --- a/include/zigbee-zcl_private.h +++ b/include/zigbee-zcl_private.h @@ -253,6 +253,36 @@ int zb_report_config_response_record_set_status( zb_zcl_report_config_response_record_h handle, zb_zcl_status_e status); +/** + * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RESPONSE_RECORD_MODULE + * @brief Sets the attribute identifier to a reporting configuration response record. + * @details The attribute identifier field is 16 bits in length and shall contain the + * identifier of the attribute that the reporting configuration details apply to. + * + * @since_tizen 4.0 + * + * @param[in] handle The handle of write attribute status record + * @param[out] id Attribute identifier + * + * @return 0 on success, otherwise a negative error value. + * @retval #ZIGBEE_ERROR_NONE Successful + * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported + * + * @see zb_zcl_global_config_report_write_cb() + * @see zb_report_config_response_record_clone() + * @see zb_report_config_response_record_destroy() + * @see zb_report_config_response_record_get_status() + * @see zb_report_config_response_record_get_dir() + * @see zb_report_config_response_record_get_id() + * @see zb_report_config_response_record_set_status() + * @see zb_report_config_response_record_set_dir() + * @see zb_report_config_response_record_set_id() + */ +int zb_report_config_response_record_set_id( + zb_zcl_report_config_response_record_h handle, + zb_attribute_id id); + /** * @brief Sets direction to reporting configuration response record. * @details The direction field specifies whether values of the attribute are reported @@ -293,53 +323,6 @@ int zb_report_config_response_record_set_dir( zb_zcl_report_config_response_record_h handle, zb_zcl_fc_direction_e dir); -/** - * @brief Gets change from reporting configuration record (type 5). - * @details The reportable change field shall contain the minimum change to the attribute - * that will result in a report being issued. This field is of variable length. - * - * For attributes with 'analog' data type the field has the same data type as the attribute. - * - * The sign (if any) of the reportable change field is ignored. - * For attributes of 'discrete' data type - * this field is omitted. - * - * @since_tizen 4.0 - * - * @param[in] handle The handle of write attribute status record - * @param[out] type attribute type - * @param[out] value attribute data (only analog data type is allowed) - * @param[out] size attribute data size - * - * @return 0 on success, otherwise a negative error value. - * @retval #ZIGBEE_ERROR_NONE Successful - * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported - * - * @see zb_zcl_global_read_report_config_cb() - * @see zb_report_config_record_create() - * @see zb_report_config_record_clone() - * @see zb_report_config_record_destroy() - * @see zb_report_config_record_get_id() - * @see zb_report_config_record_set_id() - * @see zb_report_config_record_get_dir() - * @see zb_report_config_record_set_dir() - * @see zb_report_config_record_get_type() - * @see zb_report_config_record_get_min_interval() - * @see zb_report_config_record_set_min_interval() - * @see zb_report_config_record_get_max_interval() - * @see zb_report_config_record_set_max_interval() - * @see zb_report_config_record_get_change() - * @see zb_report_config_record_set_change() - * @see zb_report_config_record_get_timeout() - * @see zb_report_config_record_set_timeout() - */ -int zb_report_config_record_get_change_3( - zb_zcl_reporting_config_record_h handle, - zb_zcl_data_type_e *type, - unsigned char *value, - int *size); - /** * @brief Gets direction from read reporting configuration record. * @details The direction field specifies whether values of the attribute are reported diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt deleted file mode 100644 index ce45060..0000000 --- a/lib/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) - -SET(CLIENT_PKG_CONF_FILE "capi-network-zigbee") - -FILE(GLOB CLIENT_SRCS *.c ${CMAKE_SOURCE_DIR}/common/*.c) -#SET(CLIENT_SRCS ${CLIENT_SRCS} ${CMAKE_SOURCE_DIR}/common/${ZB_DBUS}.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 capi-system-info) -INCLUDE_DIRECTORIES(${client_pkgs_INCLUDE_DIRS}) - -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror -pthread") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O0 -g") - -ADD_DEFINITIONS("-DZIGBEE_DBUS_INTERFACE=\"${DBUS_INTERFACE}\"") -ADD_DEFINITIONS("-DZIGBEE_DBUS_OBJPATH=\"${DBUS_OBJECT_PATH}\"") - -ADD_LIBRARY(${CLIENT} SHARED ${CLIENT_SRCS}) -#ADD_DEPENDENCIES(${CLIENT} GENERATED_DBUS_CODE) -TARGET_LINK_LIBRARIES(${CLIENT} ${client_pkgs_LIBRARIES}) -SET_TARGET_PROPERTIES(${CLIENT} PROPERTIES VERSION ${FULLVER} SUBVERSION ${MAJORVER}) -INSTALL(TARGETS ${CLIENT} DESTINATION ${LIB_INSTALL_DIR}) - -CONFIGURE_FILE(${CLIENT_PKG_CONF_FILE}.pc.in ${CLIENT_PKG_CONF_FILE}.pc @ONLY) -INSTALL(FILES ${CLIENT_PKG_CONF_FILE}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) - -FILE(GLOB CLIENT_HEADER ${CMAKE_SOURCE_DIR}/include/*.h) -list(FILTER CLIENT_HEADER EXCLUDE REGEX ".*_private.h$") -INSTALL(FILES ${CLIENT_HEADER} DESTINATION ${INCLUDE_INSTALL_DIR}/network) diff --git a/lib/capi-network-zigbee.pc.in b/lib/capi-network-zigbee.pc.in deleted file mode 100644 index 7aa7398..0000000 --- a/lib/capi-network-zigbee.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix}/bin -libdir=@LIB_INSTALL_DIR@ -includedir=@INCLUDE_INSTALL_DIR@/network - -Name: @CLIENT@ -Description: Network/Wireless zigbee -Version: @FULLVER@ -Requires: -Libs: -L${libdir} -l@CLIENT@ -Cflags: -I${includedir} diff --git a/packaging/capi-network-zigbee.spec b/packaging/capi-network-zigbee.spec index 542b38f..d7858dc 100644 --- a/packaging/capi-network-zigbee.spec +++ b/packaging/capi-network-zigbee.spec @@ -1,6 +1,10 @@ +%define major 0 +%define minor 1 +%define patchlevel 1 + Name: capi-network-zigbee Summary: Network Zigbee Service in Tizen CAPI -Version: 0.0.1 +Version: %{major}.%{minor}.%{patchlevel} Release: 0 Group: Network & Connectivity/Other License: Apache-2.0 @@ -34,11 +38,20 @@ chmod g-w %_sourcedir/* cp %{SOURCE1001} ./%{name}.manifest %build -MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` +%if 0%{?gcov:1} +export LDFLAGS+=" -lgcov" +%endif -%cmake . -DMAJORVER=%{MAJORVER} -DFULLVER=%{version} \ - -DBIN_INSTALL_DIR:PATH=%{_bindir} \ - -DZB_FEATURE_GLOBAL_RSP_SYNC=1 +MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DLIB_INSTALL_DIR=%{_libdir} \ + -DBIN_INSTALL_DIR=%{_bindir} \ + -DINCLUDE_INSTALL_DIR=%{_includedir} \ + -DLIB_PATH=%{_lib} \ + -DFULLVER=%{version} \ + -DMAJORVER=${MAJORVER} \ + -DZB_FEATURE_GLOBAL_RSP_SYNC=1 \ + -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} %install rm -rf %{buildroot}/BUILD/%{name} diff --git a/lib/zbl-custom.c b/src/zbl-custom.c similarity index 100% rename from lib/zbl-custom.c rename to src/zbl-custom.c diff --git a/lib/zbl-dbus.c b/src/zbl-dbus.c similarity index 99% rename from lib/zbl-dbus.c rename to src/zbl-dbus.c index f040020..0951abe 100644 --- a/lib/zbl-dbus.c +++ b/src/zbl-dbus.c @@ -2812,10 +2812,6 @@ GLOBAL_CONFIGURE_REPORTING_REQ_OUT: goto GLOBAL_READ_CONFIGURE_REPORTING_REQ_OUT; } } - if (!records) { - ERR("calloc() Fail(%d)", errno); - goto GLOBAL_READ_CONFIGURE_REPORTING_REQ_OUT; - } DBG("record_length %d", record_length); status = calloc(record_length, sizeof(unsigned char)); diff --git a/lib/zbl-dbus.h b/src/zbl-dbus.h similarity index 100% rename from lib/zbl-dbus.h rename to src/zbl-dbus.h diff --git a/lib/zbl-zcl-alarm.c b/src/zbl-zcl-alarm.c similarity index 100% rename from lib/zbl-zcl-alarm.c rename to src/zbl-zcl-alarm.c diff --git a/lib/zbl-zcl-basic.c b/src/zbl-zcl-basic.c similarity index 100% rename from lib/zbl-zcl-basic.c rename to src/zbl-zcl-basic.c diff --git a/lib/zbl-zcl-color-control.c b/src/zbl-zcl-color-control.c similarity index 100% rename from lib/zbl-zcl-color-control.c rename to src/zbl-zcl-color-control.c diff --git a/lib/zbl-zcl-global-cmd.c b/src/zbl-zcl-global-cmd.c similarity index 100% rename from lib/zbl-zcl-global-cmd.c rename to src/zbl-zcl-global-cmd.c diff --git a/lib/zbl-zcl-groups.c b/src/zbl-zcl-groups.c similarity index 100% rename from lib/zbl-zcl-groups.c rename to src/zbl-zcl-groups.c diff --git a/lib/zbl-zcl-identify.c b/src/zbl-zcl-identify.c similarity index 100% rename from lib/zbl-zcl-identify.c rename to src/zbl-zcl-identify.c diff --git a/lib/zbl-zcl-isa-zone.c b/src/zbl-zcl-isa-zone.c similarity index 100% rename from lib/zbl-zcl-isa-zone.c rename to src/zbl-zcl-isa-zone.c diff --git a/lib/zbl-zcl-level-control.c b/src/zbl-zcl-level-control.c similarity index 100% rename from lib/zbl-zcl-level-control.c rename to src/zbl-zcl-level-control.c diff --git a/lib/zbl-zcl-on-off.c b/src/zbl-zcl-on-off.c similarity index 100% rename from lib/zbl-zcl-on-off.c rename to src/zbl-zcl-on-off.c diff --git a/lib/zbl-zcl-poll-control.c b/src/zbl-zcl-poll-control.c similarity index 100% rename from lib/zbl-zcl-poll-control.c rename to src/zbl-zcl-poll-control.c diff --git a/lib/zbl-zcl-scenes.c b/src/zbl-zcl-scenes.c similarity index 100% rename from lib/zbl-zcl-scenes.c rename to src/zbl-zcl-scenes.c diff --git a/lib/zbl-zcl-thermostat.c b/src/zbl-zcl-thermostat.c similarity index 100% rename from lib/zbl-zcl-thermostat.c rename to src/zbl-zcl-thermostat.c diff --git a/lib/zbl-zcl.c b/src/zbl-zcl.c similarity index 100% rename from lib/zbl-zcl.c rename to src/zbl-zcl.c diff --git a/lib/zbl-zdo-bind-mgr.c b/src/zbl-zdo-bind-mgr.c similarity index 100% rename from lib/zbl-zdo-bind-mgr.c rename to src/zbl-zdo-bind-mgr.c diff --git a/lib/zbl-zdo-dev-disc.c b/src/zbl-zdo-dev-disc.c similarity index 100% rename from lib/zbl-zdo-dev-disc.c rename to src/zbl-zdo-dev-disc.c diff --git a/lib/zbl-zdo-nwk-mgr.c b/src/zbl-zdo-nwk-mgr.c similarity index 100% rename from lib/zbl-zdo-nwk-mgr.c rename to src/zbl-zdo-nwk-mgr.c diff --git a/lib/zbl-zdo-svc-disc.c b/src/zbl-zdo-svc-disc.c similarity index 100% rename from lib/zbl-zdo-svc-disc.c rename to src/zbl-zdo-svc-disc.c diff --git a/lib/zbl-zdo.c b/src/zbl-zdo.c similarity index 100% rename from lib/zbl-zdo.c rename to src/zbl-zdo.c diff --git a/lib/zbl.c b/src/zbl.c similarity index 100% rename from lib/zbl.c rename to src/zbl.c diff --git a/lib/zbl.h b/src/zbl.h similarity index 100% rename from lib/zbl.h rename to src/zbl.h diff --git a/test/main.c b/test/main.c index e0ed940..ab28b6a 100644 --- a/test/main.c +++ b/test/main.c @@ -431,13 +431,13 @@ static void _zb_event_cb(zb_nwk_addr addr16, zb_ieee_addr addr64, zb_event_e e, &type ); msg(" type = [0x%02X][%s]", type, zb_zcl_get_data_type_str(type)); - zb_attr_report_get_value( + ret = zb_attr_report_get_value( records[j], &type, &buf, &count ); - if (ZIGBEE_ERROR_NONE == ret) { + if (0 < count && ZIGBEE_ERROR_NONE == ret) { for (i = 0; i < count; i++) msg(" 0x%02X ", buf[i]); } -- 2.34.1