diff options
author | DoHyun Pyun <dh79.pyun@samsung.com> | 2019-05-09 13:35:39 +0900 |
---|---|---|
committer | DoHyun Pyun <dh79.pyun@samsung.com> | 2019-05-15 08:57:04 +0900 |
commit | 0e2281a1d503c8ffb6fba02345355965fb498d83 (patch) | |
tree | 70ac4026196cfcbecfcb49213af1ff7407ce3ef7 | |
parent | 65fac2cc16be31ddd75b98a52078aec544672e60 (diff) | |
download | iotivity-0e2281a1d503c8ffb6fba02345355965fb498d83.tar.gz iotivity-0e2281a1d503c8ffb6fba02345355965fb498d83.tar.bz2 iotivity-0e2281a1d503c8ffb6fba02345355965fb498d83.zip |
Modify Tizen BLE 3.0 / 4.0 build option
tizen4 flag was defined in the code, but it was not used.
So tizen BLE CA layer is using internal APIs. This patchset
modifies build options and disable internal API usage.
Change-Id: I283085e4525207c4df2cd40b683e6f67b3aa6662
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
-rwxr-xr-x | build_common/SConscript | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | packaging/iotivity.spec | 4 | ||||
-rw-r--r-- | resource/csdk/connectivity/src/bt_le_adapter/tizen/SConscript | 7 | ||||
-rw-r--r-- | resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_mcd.c | 6 | ||||
-rw-r--r-- | resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_vd.c | 6 | ||||
-rw-r--r-- | tools/tizen/iotivity.spec | 17 |
6 files changed, 25 insertions, 17 deletions
diff --git a/build_common/SConscript b/build_common/SConscript index 577cbff93..f0322ee16 100755 --- a/build_common/SConscript +++ b/build_common/SConscript @@ -133,7 +133,7 @@ help_vars.Add(EnumVariable('WITH_UPSTREAM_LIBCOAP', 'Use latest stable version o help_vars.Add(EnumVariable('BLE_CUSTOM_ADV', 'Build with CUSTOM Advertisement', 'False', allowed_values=('True', 'False'))) help_vars.Add(EnumVariable('BLE_DIVISION', 'BLE Build with division code', 'OFF', allowed_values=('OFF', 'MCD', 'VD'))) help_vars.Add(EnumVariable('BLE_TIZEN_30', 'Build with tizen 3.0 BLE api', 'False', allowed_values=('True', 'False'))) -help_vars.Add(EnumVariable('TIZEN_4', 'Build with tizen 4.0 api', 'False', allowed_values=('True', 'False'))) +help_vars.Add(EnumVariable('BLE_TIZEN_40', 'Build with tizen 4.0 BLE api', 'False', allowed_values=('True', 'False'))) help_vars.Add(PathVariable('TIZENRT_OS_DIR', 'Absolute Path to TizenRT OS directory', None, PathVariable.PathAccept)) help_vars.Add(EnumVariable('PLATFORM_TLS', 'Use platform tls instead of local mbedtls', '0', allowed_values=('0', '1'))) help_vars.Add(EnumVariable('OIC_SUPPORT_TIZEN_TRACE', 'Tizen Trace(T-trace) api availability', 'False', allowed_values=('True', 'False'))) diff --git a/packaging/iotivity.spec b/packaging/iotivity.spec index d09744a06..46e8332f4 100755..100644 --- a/packaging/iotivity.spec +++ b/packaging/iotivity.spec @@ -86,9 +86,9 @@ Source1002: %{name}-test.manifest %{!?RD_MODE: %define RD_MODE CLIENT} %{!?BLE_CUSTOM_ADV: %define BLE_CUSTOM_ADV False} %{!?BLE_DIVISION: %define BLE_DIVISION VD} -%{!?BLE_TIZEN_30: %define BLE_TIZEN_30 True} %{!?DISABLE_BLE_SERVER: %define DISABLE_BLE_SERVER 0} %{!?MULTIPLE_OWNER: %define MULTIPLE_OWNER 1} +%{!?BLE_TIZEN_40: %define BLE_TIZEN_40 True} BuildRequires: expat-devel BuildRequires: python, libcurl-devel @@ -184,7 +184,7 @@ scons %{JOB} --prefix=%{_prefix} \ RD_MODE=%{RD_MODE} \ BLE_CUSTOM_ADV=%{BLE_CUSTOM_ADV} \ BLE_DIVISION=%{BLE_DIVISION} \ - BLE_TIZEN_30=%{BLE_TIZEN_30} \ + BLE_TIZEN_40=%{BLE_TIZEN_40} \ DISABLE_BLE_SERVER=%{DISABLE_BLE_SERVER} \ MULTIPLE_OWNER=%{MULTIPLE_OWNER} \ LOG_LEVEL=%{log_level} \ diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/SConscript b/resource/csdk/connectivity/src/bt_le_adapter/tizen/SConscript index 3d59fdb75..455838081 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/SConscript +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/SConscript @@ -8,6 +8,7 @@ import os.path root_dir = os.pardir division = env.get('BLE_DIVISION') tizen30 = env.get('BLE_TIZEN_30') +tizen40 = env.get('BLE_TIZEN_40') env.PrependUnique(CPPPATH = [ os.path.join(src_dir, 'tizen')]) @@ -17,7 +18,11 @@ if 'MCD' in division: env.AppendUnique(CPPDEFINES = ['BLE_MCD']) print "BLE for MCD" -if tizen30 == 'True': +if tizen40 == 'True': + env.AppendUnique(CPPDEFINES = ['BLE_TIZEN_30']) + env.AppendUnique(CPPDEFINES = ['BLE_TIZEN_40']) + print "Build using Tizen 4.0 BLE API" +elif tizen30 == 'True': env.AppendUnique(CPPDEFINES = ['BLE_TIZEN_30']) print "Build using Tizen 3.0 BLE API" diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_mcd.c b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_mcd.c index cf81f3738..5c36a0324 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_mcd.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_mcd.c @@ -28,7 +28,7 @@ #include "oic_malloc.h" #include "caleutil.h" #include "cautilinterface.h" -#ifndef TIZEN_4 +#ifndef BLE_TIZEN_40 #include <bluetooth_internal.h> #endif @@ -1185,7 +1185,7 @@ uint16_t CALEServerGetMtuSize(const char* address) unsigned int mtu = CA_DEFAULT_BLE_MTU_SIZE; int ret = 0; -#ifdef TIZEN_4 +#ifdef BLE_TIZEN_40 bt_gatt_client_h client = NULL; ret = bt_gatt_client_create(address, &client); if (0 != ret) @@ -1218,7 +1218,7 @@ uint16_t CALEServerGetMtuSize(const char* address) "bt_device_get_att_mtu failed with return [%s]", CALEGetErrorMsg(ret)); return CA_DEFAULT_BLE_MTU_SIZE; } -#endif // TIZEN_4 +#endif // BLE_TIZEN_40 OIC_LOG_V(INFO, TAG, "mtu size(including header) from bt_device_get_att_mtu is %d", mtu); OIC_LOG(DEBUG, TAG, "OUT"); diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_vd.c b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_vd.c index 901d3d8f6..bcfe6d41f 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_vd.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_vd.c @@ -29,7 +29,7 @@ #include "caleutil.h" #include "caadapterutils.h" #include <glib.h> -#ifndef TIZEN_4 +#ifndef BLE_TIZEN_40 #include <bluetooth_internal.h> #endif @@ -1047,7 +1047,7 @@ uint16_t CALEServerGetMtuSize(const char* address) unsigned int mtu = CA_DEFAULT_BLE_MTU_SIZE; int ret = 0; -#ifdef TIZEN_4 +#ifdef BLE_TIZEN_40 bt_gatt_client_h client = NULL; ret = bt_gatt_client_create(address, &client); if (0 != ret) @@ -1080,7 +1080,7 @@ uint16_t CALEServerGetMtuSize(const char* address) "bt_device_get_att_mtu failed with return [%s]", CALEGetErrorMsg(ret)); return CA_DEFAULT_BLE_MTU_SIZE; } -#endif // TIZEN_4 +#endif // BLE_TIZEN_40 OIC_LOG_V(INFO, TAG, "mtu size(including header) from bt_device_get_att_mtu is %d", mtu); OIC_LOG(DEBUG, TAG, "OUT"); diff --git a/tools/tizen/iotivity.spec b/tools/tizen/iotivity.spec index 2817e65ec..46e8332f4 100644 --- a/tools/tizen/iotivity.spec +++ b/tools/tizen/iotivity.spec @@ -1,7 +1,7 @@ Name: iotivity Version: 1.2.1 Release: 0 -Summary: IoT Connectivity sponsored by the OCF +Summary: Samsung IoT Connectivity Group: Network & Connectivity / IoT Connectivity License: Apache-2.0 URL: https://www.iotivity.org/ @@ -57,6 +57,7 @@ Source1002: %{name}-test.manifest %define ex_lib_dir %{buildroot}%{_libdir} %define ex_include_dir %{buildroot}%{_includedir} +%if 0%{?tizen_version_major} < 3 %if ! 0%{?license:0} %define license %doc %endif @@ -64,6 +65,7 @@ Source1002: %{name}-test.manifest %if ! 0%{?manifest:0} %define manifest %doc %endif +%endif # Default values to be eventually overiden BEFORE or as gbs params: %{!?ES_TARGET_ENROLLEE: %define ES_TARGET_ENROLLEE tizen} @@ -80,12 +82,13 @@ Source1002: %{name}-test.manifest %{!?WITH_MQ: %define WITH_MQ OFF} %{!?WITH_PROXY: %define WITH_PROXY 0} %{!?WITH_TCP: %define WITH_TCP 1} +%{!?DISABLE_TCP_SERVER: %define DISABLE_TCP_SERVER 1} %{!?RD_MODE: %define RD_MODE CLIENT} %{!?BLE_CUSTOM_ADV: %define BLE_CUSTOM_ADV False} %{!?BLE_DIVISION: %define BLE_DIVISION VD} -%{!?BLE_TIZEN_30: %define BLE_TIZEN_30 True} %{!?DISABLE_BLE_SERVER: %define DISABLE_BLE_SERVER 0} -%{!?MULTIPLE_OWNER: %define MULTIPLE_OWNER 0} +%{!?MULTIPLE_OWNER: %define MULTIPLE_OWNER 1} +%{!?BLE_TIZEN_40: %define BLE_TIZEN_40 True} BuildRequires: expat-devel BuildRequires: python, libcurl-devel @@ -177,13 +180,13 @@ scons %{JOB} --prefix=%{_prefix} \ WITH_MQ=%{WITH_MQ} \ WITH_PROXY=%{WITH_PROXY} \ WITH_TCP=%{WITH_TCP} \ + DISABLE_TCP_SERVER=%{DISABLE_TCP_SERVER} \ RD_MODE=%{RD_MODE} \ BLE_CUSTOM_ADV=%{BLE_CUSTOM_ADV} \ BLE_DIVISION=%{BLE_DIVISION} \ - BLE_TIZEN_30=%{BLE_TIZEN_30} \ + BLE_TIZEN_40=%{BLE_TIZEN_40} \ DISABLE_BLE_SERVER=%{DISABLE_BLE_SERVER} \ MULTIPLE_OWNER=%{MULTIPLE_OWNER} \ - OIC_SUPPORT_TIZEN_TRACE=%{OIC_SUPPORT_TIZEN_TRACE} \ LOG_LEVEL=%{log_level} \ #eol @@ -196,7 +199,6 @@ cp LICENSE %{buildroot}/%{_datadir}/license/%{name} mkdir -p %{ex_install_dir} mkdir -p %{ex_include_dir} mkdir -p %{ex_lib_dir}/pkgconfig - #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/examples/OICMiddle/OICMiddle %{ex_install_dir} #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/devicediscoveryclient %{ex_install_dir} #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/devicediscoveryserver %{ex_install_dir} @@ -246,6 +248,7 @@ mkdir -p %{ex_include_dir}/mbedtls cp -R ./extlibs/mbedtls/mbedtls/include/mbedtls/ %{buildroot}%{_includedir} cp ./resource/csdk/security/include/*.h %{buildroot}%{_includedir} cp ./resource/csdk/connectivity/api/*.h %{buildroot}%{_includedir}/ +cp ./resource/csdk/security/include/internal/*.h %{buildroot}%{_includedir}/ cp ./resource/csdk/security/provisioning/include/oxm/*.h %{buildroot}%{_includedir} cp ./resource/csdk/security/provisioning/include/internal/*.h %{buildroot}%{_includedir} cp ./resource/csdk/security/provisioning/include/*.h %{buildroot}%{_includedir} @@ -256,6 +259,7 @@ cp ./resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.dat %endif + mkdir -p %{ex_include_dir}/service/resource-encapsulation mkdir -p %{ex_include_dir}/service/notification mkdir -p %{ex_include_dir}/service/easy-setup @@ -280,7 +284,6 @@ cp resource/csdk/stack/include/*.h %{buildroot}%{_includedir}/resource cp resource/oc_logger/include/*.h %{buildroot}%{_includedir}/resource cp resource/oc_logger/include/*.hpp %{buildroot}%{_includedir}/resource - cp resource/c_common/*.h %{buildroot}%{_includedir} cp resource/c_common/ocrandom/include/*.h %{buildroot}%{_includedir} cp resource/c_common/oic_string/include/*.h %{buildroot}%{_includedir} |