From 9da28233060c4a6afbcdf15bba7d0b0681b4de0f Mon Sep 17 00:00:00 2001 From: "chleun.moon" Date: Tue, 16 Aug 2016 11:56:29 +0900 Subject: [PATCH] Fixed feature check Change-Id: Ic86022a323e6ff507c1eea11036724a53e0827f9 Signed-off-by: cheoleun --- CMakeLists.txt | 2 +- packaging/capi-network-nsd.spec | 3 ++- src/dns-sd/dns-sd-util.h | 6 +----- src/ssdp/ssdp-util.h | 12 ++++-------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54adba6..322ebe5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ INCLUDE(FindPkgConfig) ########################## search for packages ################################ -SET(COMMON_DEPS "dlog glib-2.0 gio-2.0 capi-base-common gio-unix-2.0 gssdp-1.0 dns_sd") +SET(COMMON_DEPS "dlog glib-2.0 gio-2.0 capi-base-common capi-system-info gio-unix-2.0 gssdp-1.0 dns_sd") SET(PC_DEPS "capi-base-common") diff --git a/packaging/capi-network-nsd.spec b/packaging/capi-network-nsd.spec index b4adcce..fa24bf7 100644 --- a/packaging/capi-network-nsd.spec +++ b/packaging/capi-network-nsd.spec @@ -1,6 +1,6 @@ Name: capi-network-nsd Summary: A Network Service Discovery libraries in Native API -Version: 0.0.5 +Version: 0.0.6 Release: 1 Group: System/Network License: Apache-2.0 @@ -11,6 +11,7 @@ Source1003: libnsd-ssdp.manifest Source1004: nsd-tests.manifest BuildRequires: cmake BuildRequires: pkgconfig(capi-base-common) +BuildRequires: pkgconfig(capi-system-info) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(dns_sd) diff --git a/src/dns-sd/dns-sd-util.h b/src/dns-sd/dns-sd-util.h index 7b330cc..93c4872 100644 --- a/src/dns-sd/dns-sd-util.h +++ b/src/dns-sd/dns-sd-util.h @@ -20,6 +20,7 @@ #include #include #include +#include #undef LOG_TAG #define LOG_TAG "CAPI_NETWORK_DNSSD" @@ -34,7 +35,6 @@ #define NETWORK_SERVICE_DISCOVERY_FEATURE "http://tizen.org/feature/network.service_discovery.dnssd" -#if 0 #define CHECK_FEATURE_SUPPORTED(feature_name)\ do {\ bool feature_supported = FALSE;\ @@ -53,10 +53,6 @@ } \ } while (0) -#else -#define CHECK_FEATURE_SUPPORTED(feature_name) -#endif - #define IPV4_LEN 4 #define IPV6_LEN 16 diff --git a/src/ssdp/ssdp-util.h b/src/ssdp/ssdp-util.h index b0d1fd7..967df10 100644 --- a/src/ssdp/ssdp-util.h +++ b/src/ssdp/ssdp-util.h @@ -20,6 +20,7 @@ #define USE_DLOG #ifdef USE_DLOG #include +#include #undef LOG_TAG #define LOG_TAG "CAPI_NETWORK_SSDP" @@ -44,27 +45,22 @@ #endif /* USE_DLOG */ -#define NETWORK_SERVICE_DISCOVERY_FEATURE "http://tizen.org/feature/network.service_discovery" +#define NETWORK_SERVICE_DISCOVERY_FEATURE "http://tizen.org/feature/network.service_discovery.ssdp" -#if 0 #define CHECK_FEATURE_SUPPORTED(feature_name)\ do {\ bool feature_supported = FALSE;\ if (!system_info_get_platform_bool(feature_name, &feature_supported)) {\ if (feature_supported == FALSE) {\ LOGE("%s feature is disabled", feature_name);\ - return NSD_ERROR_NOT_SUPPORTED;\ + return SSDP_ERROR_NOT_SUPPORTED;\ } \ } else {\ LOGE("Error - Feature getting from System Info");\ - return NSD_ERROR_OPERATION_FAILED;\ + return SSDP_ERROR_OPERATION_FAILED;\ } \ } while (0) -#else -#define CHECK_FEATURE_SUPPORTED(feature_name) -#endif - #define GLIST_ITER_START(arg_list, elem) \ GList *temp = NULL; \ temp = g_list_first(arg_list); \ -- 2.7.4