From: Jooseok Park Date: Wed, 26 Apr 2017 09:17:08 +0000 (+0900) Subject: Use OCInit2() instead of OCInit() in case of tv product X-Git-Tag: submit/tizen/20170426.092839^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04a304b4ddc016292f11e4a6b43d0f61599d6b6f;p=platform%2Fcore%2Fiot%2Fiotcon.git Use OCInit2() instead of OCInit() in case of tv product Change-Id: Iad10beb61c48a109c7f5f96fe18016b4e12b519c --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ca6d5cb..4862de3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,10 @@ ENDFOREACH(flag) INCLUDE_DIRECTORIES(${pkgs_INCLUDE_DIRS}) LINK_DIRECTORIES(${pkgs_LIBRARY_DIRS}) +IF(PRODUCT_TV) + ADD_DEFINITIONS("-DTIZEN_PRODUCT_TV") +ENDIF(PRODUCT_TV) + ADD_LIBRARY(${LIB} SHARED ${SRCS}) TARGET_LINK_LIBRARIES(${LIB} ${pkgs_LIBRARIES} pthread) SET_TARGET_PROPERTIES(${LIB} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER}) diff --git a/packaging/iotcon.spec b/packaging/iotcon.spec index 57ac9a5..0860007 100644 --- a/packaging/iotcon.spec +++ b/packaging/iotcon.spec @@ -1,6 +1,6 @@ Name: iotcon Summary: Tizen IoT Connectivity -Version: 0.3.18 +Version: 0.3.19 Release: 0 Group: Network & Connectivity/Service License: Apache-2.0 @@ -45,11 +45,18 @@ Tizen IoT Connectivity Test Programs %build + +%if "%{?TIZEN_PRODUCT_TV}" == "1" +%define PRODUCT_TV 1 +%else +%define PRODUCT_TV 0 +%endif + MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DMAJORVER=${MAJORVER} \ -DFULLVER=%{version} \ - -DBIN_INSTALL_DIR:PATH=%{_bindir} - + -DBIN_INSTALL_DIR:PATH=%{_bindir} \ + -DPRODUCT_TV=%{PRODUCT_TV} %install diff --git a/src/ic-ioty.c b/src/ic-ioty.c index 79f5392..cf63637 100644 --- a/src/ic-ioty.c +++ b/src/ic-ioty.c @@ -251,7 +251,13 @@ int icl_ioty_init(pthread_t *out_thread) ERR("icl_ioty_mutex_lock() Fail(%d)", ret); return ret; } +#ifdef TIZEN_PRODUCT_TV + INFO("OCInit2() called.."); + ret = OCInit2(OC_CLIENT_SERVER, OC_DEFAULT_FLAGS, OC_DEFAULT_FLAGS, + OC_ADAPTER_IP|OC_ADAPTER_TCP); +#else ret = OCInit(NULL, 0, OC_CLIENT_SERVER); +#endif icl_ioty_mutex_unlock(); if (OC_STACK_OK != ret) { ERR("OCInit() Fail(%d)", ret);