From: Abhishek Sharma Date: Thu, 18 Aug 2016 05:50:50 +0000 (+0530) Subject: Coap Over TCP support for Tizen X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11a75930ae8b3630d8dc1e1f447863ba4bddf300;p=contrib%2Fiotivity.git Coap Over TCP support for Tizen Change-Id: If1a7d61aa6499282182138d188b0e600133f49c1 Signed-off-by: Abhishek Sharma Reviewed-on: https://gerrit.iotivity.org/gerrit/10583 Reviewed-by: Jaehong Jo Tested-by: jenkins-iotivity Reviewed-by: Ashok Babu Channa --- diff --git a/resource/csdk/stack/samples/tizen/SimpleClientServer/packaging/com.oic.ri.sample.spec b/resource/csdk/stack/samples/tizen/SimpleClientServer/packaging/com.oic.ri.sample.spec index 9aabba5..63b90e2 100644 --- a/resource/csdk/stack/samples/tizen/SimpleClientServer/packaging/com.oic.ri.sample.spec +++ b/resource/csdk/stack/samples/tizen/SimpleClientServer/packaging/com.oic.ri.sample.spec @@ -31,7 +31,7 @@ OIC RIsample application %build scons TARGET_OS=tizen -c -scons VERBOSE=%{VERBOSE} TARGET_OS=tizen TARGET_TRANSPORT=%{TARGET_TRANSPORT} SECURED=%{SECURED} RELEASE=%{RELEASE} ROUTING=%{ROUTING} +scons TARGET_OS=tizen TARGET_TRANSPORT=%{TARGET_TRANSPORT} SECURED=%{SECURED} RELEASE=%{RELEASE} ROUTING=%{ROUTING} WITH_TCP=%{WITH_TCP} %install diff --git a/resource/csdk/stack/samples/tizen/SimpleClientServer/scons/SConscript b/resource/csdk/stack/samples/tizen/SimpleClientServer/scons/SConscript index f4e7e59..5237143 100644 --- a/resource/csdk/stack/samples/tizen/SimpleClientServer/scons/SConscript +++ b/resource/csdk/stack/samples/tizen/SimpleClientServer/scons/SConscript @@ -68,6 +68,11 @@ else: else: env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER']) + if env.get('WITH_TCP'): + env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER', 'WITH_TCP']) + else: + env.AppendUnique(CPPDEFINES = ['NO_TCP_ADAPTER']) + #ri_sample_src = [sample_dir + '/occlient.cpp'] #print " ri sample src %s" % ri_sample_src diff --git a/resource/csdk/stack/samples/tizen/build/SConscript b/resource/csdk/stack/samples/tizen/build/SConscript index 1e3722a..e3c922b 100644 --- a/resource/csdk/stack/samples/tizen/build/SConscript +++ b/resource/csdk/stack/samples/tizen/build/SConscript @@ -13,6 +13,7 @@ release_mode = env.get('RELEASE') secured = env.get('SECURED') logging = env.get('LOGGING') routing = env.get('ROUTING') +with_tcp = env.get('WITH_TCP') env.PrependUnique(CPPPATH = [ '../../../../logger/include', @@ -33,7 +34,7 @@ print "Given Transport is %s" % transport print "Given OS is %s" % target_os if target_os == 'tizen': - command = "sh resource/csdk/stack/samples/tizen/build/gbsbuild.sh %s %s %s %s %s %s" % (transport, secured, buildsample, release_mode, logging, routing) + command = "sh resource/csdk/stack/samples/tizen/build/gbsbuild.sh %s %s %s %s %s %s %s" % (transport, secured, buildsample, release_mode, logging, routing, with_tcp) print "Created Command is %s" % command gbs_script = env.Command('gbs_build', None, command) AlwaysBuild ('gbs_script') \ No newline at end of file diff --git a/resource/csdk/stack/samples/tizen/build/gbsbuild.sh b/resource/csdk/stack/samples/tizen/build/gbsbuild.sh index b4906c9..af03a20 100644 --- a/resource/csdk/stack/samples/tizen/build/gbsbuild.sh +++ b/resource/csdk/stack/samples/tizen/build/gbsbuild.sh @@ -26,6 +26,9 @@ export LOGGING=$5 echo $6 export ROUTING=$6 +echo $7 +export WITH_TCP=$7 + echo $TARGET_TRANSPORT echo $BUILD_SAMPLE @@ -89,7 +92,7 @@ if [ ! -d .git ]; then fi echo "Calling core gbs build command" -gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI-OIC --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6'" +gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI-OIC --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6' --define 'WITH_TCP $7'" echo $gbscommand if eval $gbscommand; then echo "Core build is successful" @@ -112,7 +115,7 @@ if echo $BUILD_SAMPLE|grep -qi '^ON$'; then git commit -m "Initial commit" fi echo "Calling sample gbs build command" - gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI-OIC --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6'" + gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI-OIC --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6' --define 'WITH_TCP $7'" echo $gbscommand if eval $gbscommand; then echo "Sample build is successful" diff --git a/resource/csdk/stack/samples/tizen/build/packaging/com.oic.ri.spec b/resource/csdk/stack/samples/tizen/build/packaging/com.oic.ri.spec index 4802499..2bc78f8 100644 --- a/resource/csdk/stack/samples/tizen/build/packaging/com.oic.ri.spec +++ b/resource/csdk/stack/samples/tizen/build/packaging/com.oic.ri.spec @@ -37,7 +37,7 @@ SLP oicri application echo %{ROOTDIR} scons TARGET_OS=tizen -c -scons VERBOSE=%{VERBOSE} TARGET_OS=tizen TARGET_TRANSPORT=%{TARGET_TRANSPORT} SECURED=%{SECURED} RELEASE=%{RELEASE} LOGGING=%{LOGGING} ROUTING=%{ROUTING} +scons TARGET_OS=tizen TARGET_TRANSPORT=%{TARGET_TRANSPORT} SECURED=%{SECURED} RELEASE=%{RELEASE} LOGGING=%{LOGGING} ROUTING=%{ROUTING} WITH_TCP=%{WITH_TCP} %install mkdir -p %{DEST_INC_DIR} diff --git a/resource/csdk/stack/samples/tizen/build/scons/SConscript b/resource/csdk/stack/samples/tizen/build/scons/SConscript index 914db6f..b9d0bd4 100644 --- a/resource/csdk/stack/samples/tizen/build/scons/SConscript +++ b/resource/csdk/stack/samples/tizen/build/scons/SConscript @@ -42,4 +42,9 @@ else: else: env.AppendUnique(CPPDEFINES = ['NO_WIFI_ADAPTER']) + if env.get('WITH_TCP'): + env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER', 'WITH_TCP']) + else: + env.AppendUnique(CPPDEFINES = ['NO_TCP_ADAPTER']) + env.SConscript(['../resource/SConscript']) diff --git a/tools/tizen/iotivity.spec b/tools/tizen/iotivity.spec index 1c042c3..9a82719 100644 --- a/tools/tizen/iotivity.spec +++ b/tools/tizen/iotivity.spec @@ -1,7 +1,7 @@ Name: iotivity Version: 1.1.1 Release: 0 -Summary: IoT Connectivity sponsored by the OIC +Summary: IoT Connectivity sponsored by the OCF Group: Network & Connectivity/Other License: Apache-2.0 URL: https://www.iotivity.org/ @@ -38,6 +38,7 @@ Requires(post): /sbin/ldconfig %{!?SECURED: %define SECURED 1} %{!?LOGGING: %define LOGGING True} %{!?ROUTING: %define ROUTING EP} +%{!?WITH_TCP: %define WITH_TCP true} %{!?ES_TARGET_ENROLLEE: %define ES_TARGET_ENROLLEE tizen} %{!?VERBOSE: %define VERBOSE 1} @@ -112,6 +113,7 @@ scons -j2 --prefix=%{_prefix} \ ES_TARGET_ENROLLEE=%{ES_TARGET_ENROLLEE} LIB_INSTALL_DIR=%{_libdir} + %install rm -rf %{buildroot} CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; @@ -121,6 +123,7 @@ scons install --install-sandbox=%{buildroot} --prefix=%{_prefix} \ ES_TARGET_ENROLLEE=%{ES_TARGET_ENROLLEE} LIB_INSTALL_DIR=%{_libdir} + # For Example %if %{RELEASE} == "True" %define build_mode release