Remove Profile Build Dependency: do it at runtime 22/101822/2
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 2 Dec 2016 07:52:04 +0000 (16:52 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 5 Dec 2016 01:38:35 +0000 (10:38 +0900)
- This is for Tizen 4.0.

  : Tizen 4.0 Configurability and Build Blocks require
  to remove all profile-depending build options in spec files.
  (No More profile macros)

- It is recommended to distinguish features/profiles at runtime.
 unless it incurs too much overhead, which requires you to
 create multiple binaries and subpackages.

- If you intent not to have capi-network-bluetooth-test.rpm in
 TV profile, please create a JIRA-TRE issue of package removal,
 not %if TV; test fiels; #endif.

Change-Id: I2d80c4745202c028ca5c2a2f1662933c60d38b33
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
CMakeLists.txt
include/bluetooth_private.h
packaging/capi-network-bluetooth.spec
src/bluetooth-adapter.c
src/bluetooth-audio.c
src/bluetooth-common.c
src/bluetooth-gatt.c
test/bt_unit_test.c
test/bt_unit_test.h

index 616bfa28d246e41812c2afa806b15e631a83b32f..575a9866abf26d8318f21bc1461cd55f832d30f8 100644 (file)
@@ -9,11 +9,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(INC_DIR include)
 INCLUDE_DIRECTORIES(${INC_DIR})
 
-IF (TIZEN_PROFILE_TV)
-       SET(dependents "dlog glib-2.0 capi-base-common capi-system-info bluetooth-api db-util")
-ELSE ()
-       SET(dependents "dlog glib-2.0 capi-base-common capi-system-info bluetooth-api")
-ENDIF (TIZEN_PROFILE_TV)
+SET(dependents "dlog glib-2.0 capi-base-common capi-system-info bluetooth-api db-util")
 SET(pc_dependents "capi-base-common glib-2.0")
 
 INCLUDE(FindPkgConfig)
@@ -34,24 +30,7 @@ ADD_DEFINITIONS("-DTIZEN_DEBUG")
 
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
 
-IF (TIZEN_PROFILE_TV)
-SET(SOURCES
-src/bluetooth-common.c
-src/bluetooth-adapter.c
-src/bluetooth-device.c
-src/bluetooth-socket.c
-src/bluetooth-opp-server.c
-src/bluetooth-opp-client.c
-src/bluetooth-pan.c
-src/bluetooth-hdp.c
-src/bluetooth-hid.c
-src/bluetooth-audio.c
-src/bluetooth-avrcp.c
-src/bluetooth-gatt.c
-src/bluetooth-ipsp.c
-src/bluetooth-dpm.c
-)
-ELSE ()
+
 SET(SOURCES
 src/bluetooth-common.c
 src/bluetooth-adapter.c
@@ -67,12 +46,10 @@ src/bluetooth-avrcp.c
 src/bluetooth-gatt.c
 src/bluetooth-ipsp.c
 src/bluetooth-dpm.c
-src/bluetooth-proximity.c
 )
-IF (TIZEN_PROFILE_WEARABLE OR TIZEN_PROFILE_IVI)
+
+LIST(APPEND SOURCES src/bluetooth-proximity.c)
 LIST(APPEND SOURCES src/bluetooth-pbap.c)
-ENDIF (TIZEN_PROFILE_WEARABLE OR TIZEN_PROFILE_IVI)
-ENDIF (TIZEN_PROFILE_TV)
 
 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
 
@@ -105,10 +82,7 @@ CONFIGURE_FILE(
 )
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
-IF (TIZEN_PROFILE_TV)
-ELSE ()
 ADD_SUBDIRECTORY(test)
-ENDIF (TIZEN_PROFILE_TV)
 
 IF(UNIX)
 
index 71cd10951ba115652fafffa78224b4a48328e03f..2ce25d9a6e8c4d8e1b70627e40472c9d681d03c5 100644 (file)
@@ -115,13 +115,11 @@ typedef enum {
        BT_EVENT_GATT_CLIENT_READ_DESCRIPTOR, /**< GATT descriptor value read callback */
        BT_EVENT_GATT_CLIENT_WRITE_DESCRIPTOR, /**< GATT descriptor value write callback */
        BT_EVENT_GATT_SERVER_READ_REQUESTED, /**< GATT Characteristic/Descriptor Read Requested callback*/
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
        BT_EVENT_GATT_CLIENT_CHARACTERISTIC_DISCOVERED_LEGACY, /**< GATT characteristic discovered callback */
        BT_EVENT_GATT_CLIENT_CHARACTERISTIC_DESCRIPTOR_DISCOVERED_LEGACY, /**< GATT characteristic descriptor discovered callback */
        BT_EVENT_GATT_CLIENT_VALUE_CHANGED_LEGACY, /**< GATT characteristic value changed callback */
        BT_EVENT_GATT_CLIENT_READ_CHARACTERISTIC_LEGACY, /**< GATT characteristic value read callback */
        BT_EVENT_GATT_CLIENT_WRITE_CHARACTERISTIC_LEGACY, /**< GATT characteristic value write callback */
-#endif
        BT_EVENT_IPSP_INIT_STATE_CHANGED, /**< IPSP Init status changed callback */
        BT_EVENT_IPSP_CONNECTION_STATUS, /**< IPSP connection status callback */
        BT_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length changed callback */
@@ -136,7 +134,6 @@ typedef enum {
        BT_EVENT_SUPPORTED_TRUSTED_PROFILE_EVENT, /**< Trusted Profile callback */
        BT_EVENT_PROXIMITY_CONNECTION_STATE_CHANGED, /**< Proximity Monitor/Reporter Connection sgate changed */
        BT_EVENT_PROXIMITY_REPORTER_PROPERTY_CHANGED, /**< Proximity property changed */
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
        BT_EVENT_PBAP_CONNECTION_STATUS, /**< PBAP connection status callback */
        BT_EVENT_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size status callback */
        BT_EVENT_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull status callback */
@@ -151,7 +148,6 @@ typedef enum {
        BT_EVENT_HF_CALL_STATUS_UPDATED_EVENT, /**< Audio - HF call status updated callback */
        BT_EVENT_HF_REMOTE_CALL_EVENT, /**< Audio - HF : call state event callback */
        BT_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED, /**< Audio - HF : device state changed callback */
-#endif
        BT_EVENT_MAX
 } bt_event_e;
 
@@ -160,8 +156,6 @@ typedef enum {
        BT_GATT_ROLE_CLIENT = 0x02,
 } bt_gatt_role_e;
 
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
-#endif
 
 /**
  * @internal
@@ -686,7 +680,6 @@ bt_adapter_visibility_mode_e _bt_get_bt_visibility_mode_e(bluetooth_discoverable
  */
 void _bt_audio_event_proxy(int event, bt_audio_event_param_t *param, void *user_data);
 
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE
  * @brief  Enumerations for the device state event from Audio-Gateway device
@@ -766,7 +759,6 @@ typedef void (*bt_hf_vendor_dep_cmd_event_cb) (bt_hf_vendor_dep_at_cmd_s cmd, vo
  * @brief Since the HF call back and event proxy call backs have different prototype it is wrapper function.
  */
 void _bt_hf_event_proxy(int event, bt_hf_event_param_t *param, void *user_data);
-#endif
 
 /**
  * @internal
@@ -788,9 +780,7 @@ void _bt_hid_event_proxy(int event, hid_event_param_t *param, void *user_data);
 
 void _bt_adapter_le_invoke_advertising_state_cb(int handle, int result, bt_adapter_le_advertising_state_e adv_state);
 
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
 bool _bt_gatt_is_legacy_client_mode(void);
-#endif
 
 bt_gatt_client_h _bt_gatt_get_client(const char *remote_addr);
 
@@ -887,6 +877,31 @@ int _bt_check_proximity_is_initialized(bool *is_initialized);
  */
 int _bt_proximity_connection_set_state_changed(int result, const char *remote_address, bool connected);
 
+typedef enum {
+       _PROFILE_UNKNOWN = 0,
+       _PROFILE_MOBILE = 0x1,
+       _PROFILE_WEARABLE = 0x2,
+       _PROFILE_TV = 0x4,
+       _PROFILE_IVI = 0x8,
+       _PROFILE_COMMON = 0x10,
+} tizen_profile_t;
+extern tizen_profile_t _get_tizen_profile();
+extern tizen_profile_t profile;
+
+#define TIZEN_PROFILE_(x) (( (__builtin_expect(profile != _PROFILE_UNKNOWN, 1)) ? \
+                                       (profile) : _get_tizen_profile()) \
+                               & (x))
+
+#define TIZEN_PROFILE_MOBILE   TIZEN_PROFILE_(_PROFILE_MOBILE)
+#define TIZEN_PROFILE_COMMON   TIZEN_PROFILE_(_PROFILE_COMMON)
+#define TIZEN_PROFILE_TV       TIZEN_PROFILE_(_PROFILE_TV)
+#define TIZEN_PROFILE_WEARABLE TIZEN_PROFILE_(_PROFILE_WEARABLE)
+#define TIZEN_PROFILE_IVI      TIZEN_PROFILE_(_PROFILE_IVI)
+
+#define TIZEN_PROFILE_WEARABLE_IVI     TIZEN_PROFILE_(_PROFILE_WEARABLE | _PROFILE_IVI)
+
+#define TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT                TIZEN_PROFILE_MOBILE
+
 #ifdef __cplusplus
 }
 #endif
index b441145f0834166889e0c9c7d79a7eb6a0df4975..4d2200950584017f4df67546d493449f0ce9747d 100644 (file)
@@ -14,9 +14,7 @@ BuildRequires:  pkgconfig(dbus-glib-1)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(vconf)
-%if "%{?profile}" == "tv"
 BuildRequires:  pkgconfig(db-util)
-%endif
 BuildRequires:  pkgconfig(bluetooth-api)
 BuildRequires:  pkgconfig(capi-appfw-application)
 BuildRequires:  pkgconfig(capi-base-common)
@@ -50,24 +48,6 @@ cp %{SOURCE1001} %{SOURCE1002} .
 
 %build
 
-%if "%{?profile}" == "wearable"
-export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_PROFILE_WEARABLE"
-export FFLAGS="$FFLAGS -DTIZEN_PROFILE_WEARABLE"
-%endif
-
-%if "%{?profile}" == "mobile"
-export CFLAGS="$CFLAGS -DTIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT"
-export FFLAGS="$FFLAGS -DTIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT"
-%endif
-
-%if "%{?profile}" == "ivi"
-export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_PROFILE_IVI"
-export FFLAGS="$FFLAGS -DTIZEN_PROFILE_IVI"
-%endif
-
 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_AUDIO_HF_DISABLE -DTIZEN_FEATURE_IPSP_SUPPORT"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_FEATURE_AUDIO_HF_DISABLE -DTIZEN_FEATURE_IPSP_SUPPORT"
 export FFLAGS="$FFLAGS -DTIZEN_FEATURE_AUDIO_HF_DISABLE -DTIZEN_FEATURE_IPSP_SUPPORT"
@@ -86,18 +66,7 @@ export CXXFLAGS+=" -DARCH64"
 export FFLAGS+=" -DARCH64"
 %endif
 
-%cmake \
-%if "%{?profile}" == "wearable"
-       -DTIZEN_PROFILE_WEARABLE=YES \
-%else
-%if "%{?profile}" == "tv"
-       -DTIZEN_PROFILE_TV=YES \
-%else
-%if "%{?profile}" == "ivi"
-       -DTIZEN_PROFILE_IVI=YES \
-%endif
-%endif
-%endif
+%cmake
 
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
@@ -124,9 +93,7 @@ install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/capi-network-bluetoot
 
 %files test
 %manifest %{name}.manifest
-%if "%{?profile}" != "tv"
 %{_bindir}/bt_unit_test
-%endif
 #%{_bindir}/bt_onoff
 #/etc/smack/accesses.d/capi-network-bluetooth-test.efl
 
index 4039c7dceb836e4e38f6de367db31c8376ed9ff6..2ed50a445ba0be7e17425a6a38b6b6809caac1ed 100644 (file)
@@ -861,7 +861,6 @@ int bt_adapter_set_device_discovery_state_changed_cb(bt_adapter_device_discovery
        return BT_ERROR_NONE;
 }
 
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
 int bt_adapter_le_set_device_discovery_state_changed_cb(bt_adapter_le_device_discovery_state_changed_cb callback,
                                                        void *user_data)
 {
@@ -876,7 +875,6 @@ int bt_adapter_le_set_device_discovery_state_changed_cb(bt_adapter_le_device_dis
                                                callback, user_data);
        return BT_ERROR_NONE;
 }
-#endif
 
 int bt_adapter_unset_state_changed_cb(void)
 {
@@ -941,7 +939,6 @@ int bt_adapter_unset_device_discovery_state_changed_cb(void)
        return BT_ERROR_NONE;
 }
 
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
 int bt_adapter_le_unset_device_discovery_state_changed_cb(void)
 {
        BT_INFO("DEPRECATION WARNING: bt_adapter_le_unset_device_discovery_state_changed_cb() is deprecated and will be removed from next release.");
@@ -952,7 +949,6 @@ int bt_adapter_le_unset_device_discovery_state_changed_cb(void)
        _bt_le_adapter_deinit();
        return BT_ERROR_NONE;
 }
-#endif
 
 int bt_adapter_start_device_discovery(void)
 {
@@ -1003,7 +999,6 @@ int bt_adapter_is_discovering(bool *is_discovering)
        }
 }
 
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
 int bt_adapter_le_start_device_discovery(void)
 {
        int error_code = BT_ERROR_NONE;
@@ -1054,7 +1049,6 @@ int bt_adapter_le_is_discovering(bool *is_discovering)
                return ret; /* LCOV_EXCL_LINE */
        }
 }
-#endif
 
 int bt_adapter_get_local_oob_data(unsigned char **hash,
                                        unsigned char **randomizer,
@@ -2312,7 +2306,6 @@ int bt_adapter_le_clear_advertising_data(bt_advertiser_h advertiser,
        return ret;
 }
 
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
 int bt_adapter_le_start_advertising(bt_advertiser_h advertiser,
                bt_adapter_le_advertising_params_s *adv_params,
                bt_adapter_le_advertising_state_changed_cb cb,
@@ -2380,7 +2373,6 @@ int bt_adapter_le_start_advertising(bt_advertiser_h advertiser,
 
        return ret;
 }
-#endif
 
 int bt_adapter_le_stop_advertising(bt_advertiser_h advertiser)
 {
index 5929f96bc8939fb038b01b6b21f30fd96146288b..222afd79cb3d1529a52ff0aed98d7e4c716d6eff 100644 (file)
@@ -31,9 +31,7 @@ typedef struct _call_list_s {
 } call_list_s;
 
 static bool is_audio_a2dp_initialized = false;
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
 static bool is_audio_hf_initialized = false;
-#endif
 static bool is_audio_ag_initialized = false;
 
 #define BT_CHECK_AUDIO_SUPPORT() \
@@ -134,14 +132,14 @@ int bt_audio_initialize(void)
        else
                is_audio_a2dp_initialized = true;
 
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
-       error = bluetooth_hf_init(_bt_hf_event_proxy, NULL);
-       error = _bt_get_error_code(error);
-       if (BT_ERROR_NONE != error)
-               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error);
-       else
-               is_audio_hf_initialized = true;
-#endif
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
+               error = bluetooth_hf_init(_bt_hf_event_proxy, NULL);
+               error = _bt_get_error_code(error);
+               if (BT_ERROR_NONE != error)
+                       BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error);
+               else
+                       is_audio_hf_initialized = true;
+       }
 
 #ifndef TIZEN_FEATURE_HFP_DISABLE /* B2_3G */
        error = bluetooth_telephony_init((void *)_bt_telephony_event_proxy, NULL);
@@ -154,9 +152,7 @@ int bt_audio_initialize(void)
 
        /* There is no success case for 3 profiles */
        if (!is_audio_a2dp_initialized &&
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
-               !is_audio_hf_initialized &&
-#endif
+               (!TIZEN_PROFILE_WEARABLE_IVI || !is_audio_hf_initialized) &&
                 !is_audio_ag_initialized) {
                return BT_ERROR_OPERATION_FAILED;
        }
@@ -178,14 +174,14 @@ int bt_audio_deinitialize(void)
 
        is_audio_a2dp_initialized = false;
 
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
-       error = bluetooth_hf_deinit();
-       error = _bt_get_error_code(error);
-       if (BT_ERROR_NONE != error)
-               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error);
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
+               error = bluetooth_hf_deinit();
+               error = _bt_get_error_code(error);
+               if (BT_ERROR_NONE != error)
+                       BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error);
 
-       is_audio_hf_initialized = false;
-#endif
+               is_audio_hf_initialized = false;
+       }
 
 #ifndef TIZEN_FEATURE_HFP_DISABLE /* B2_3G */
        error = bluetooth_telephony_deinit();
@@ -242,14 +238,14 @@ int bt_audio_connect(const char *remote_address, bt_audio_profile_type_e type)
        case BT_AUDIO_PROFILE_TYPE_A2DP:
                error = bluetooth_av_connect(&addr_hex);
                break;
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
-       case BT_AUDIO_PROFILE_TYPE_AG:
-               error = bluetooth_hf_connect(&addr_hex);
-               break;
-#endif
        case BT_AUDIO_PROFILE_TYPE_A2DP_SINK:
                error = bluetooth_av_source_connect(&addr_hex);
                break;
+       case BT_AUDIO_PROFILE_TYPE_AG:
+               if (TIZEN_PROFILE_WEARABLE_IVI) {
+                       error = bluetooth_hf_connect(&addr_hex);
+                       break;
+               } /* else: goto default */
        case BT_AUDIO_PROFILE_TYPE_ALL:
        default:
                error = bluetooth_audio_connect(&addr_hex);
@@ -300,14 +296,14 @@ int bt_audio_disconnect(const char *remote_address, bt_audio_profile_type_e type
        case BT_AUDIO_PROFILE_TYPE_A2DP:
                error = bluetooth_av_disconnect(&addr_hex);
                break;
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
-       case BT_AUDIO_PROFILE_TYPE_AG:
-               error = bluetooth_hf_disconnect(&addr_hex);
-               break;
-#endif
        case BT_AUDIO_PROFILE_TYPE_A2DP_SINK:
                error = bluetooth_av_source_disconnect(&addr_hex);
                break;
+       case BT_AUDIO_PROFILE_TYPE_AG:
+               if (TIZEN_PROFILE_WEARABLE_IVI) {
+                       error = bluetooth_hf_disconnect(&addr_hex);
+                       break;
+               } /* else goto default */
        case BT_AUDIO_PROFILE_TYPE_ALL:
        default:
                error = bluetooth_audio_disconnect(&addr_hex);
@@ -829,7 +825,6 @@ int bt_a2dp_set_content_protection(bool status)
 }
 /* LCOV_EXCL_STOP */
 
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
 int bt_hf_initialize(void)
 {
        BT_CHECK_INIT_STATUS();
@@ -1257,4 +1252,3 @@ int bt_hf_unset_remote_device_state_changed_cb(void)
                _bt_unset_cb(BT_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED);
        return BT_ERROR_NONE;
 }
-#endif
index 790d9c7aa29df02595175b5c4797d5c34066de47..c3859ff964a04a36ee75da822c4a22cfb87b1856 100644 (file)
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <stdbool.h>
 #include <bluetooth-api.h>
+#include <system_info.h>
 
 #include "bluetooth.h"
 #include "bluetooth_internal.h"
@@ -51,10 +52,8 @@ static void __bt_free_bt_adapter_device_discovery_info_s(bt_adapter_device_disco
 static int __bt_get_bt_adapter_le_device_scan_info_s(bt_adapter_le_device_scan_result_info_s **scan_info, bluetooth_le_device_info_t *source_info);
 static void __bt_free_bt_adapter_le_device_scan_info_s(bt_adapter_le_device_scan_result_info_s *scan_info);
 
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
 static int __bt_get_bt_adapter_le_device_discovery_info_s(bt_adapter_le_device_discovery_info_s **le_discovery_info, bluetooth_le_device_info_t *source_info);
 static void __bt_free_bt_adapter_le_device_discovery_info_s(bt_adapter_le_device_discovery_info_s *discovery_info);
-#endif
 static int __bt_gatt_client_update_characteristics(bt_gatt_handle_info_t char_handles, bt_gatt_service_s *service);
 static int __bt_gatt_client_update_descriptors(bt_gatt_handle_info_t desc_handles, bt_gatt_characteristic_s *characteristic);
 
@@ -934,7 +933,6 @@ void _bt_audio_event_proxy(int event, bt_audio_event_param_t *param, void *user_
        __bt_event_proxy(event, &new_param, user_data);
 }
 
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
 void _bt_hf_event_proxy(int event, bt_hf_event_param_t *param, void *user_data)
 {
        bluetooth_event_param_t new_param;
@@ -944,7 +942,6 @@ void _bt_hf_event_proxy(int event, bt_hf_event_param_t *param, void *user_data)
        new_param.user_data = NULL;
        __bt_event_proxy(event, &new_param, user_data);
 }
-#endif
 
 void _bt_telephony_event_proxy(int event, telephony_event_param_t *param, void *user_data)
 {
@@ -1024,9 +1021,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
        bluetooth_device_address_t *bd_addr = NULL;
        telephony_event_callid_t *call_data = NULL;
        char *device_addr = NULL;
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
        char *phone_number = NULL;
-#endif
        int error_code = BT_ERROR_NONE;
        int event_index = -1;
        bluetooth_network_device_info_t *dev_info = NULL;
@@ -1870,8 +1865,8 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                device_addr = NULL;
                break;
        }
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
-       case BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED: {
+       case BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED:
+       if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                BT_INFO("BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED");
                if (_bt_gatt_is_legacy_client_mode()) {
                        bt_gatt_discovered_char_t *svc_char = param->param_data;
@@ -1887,14 +1882,14 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                        _bt_unset_cb(BT_EVENT_GATT_CLIENT_CHARACTERISTIC_DISCOVERED_LEGACY);
                }
                break;
+       } else {
+               break; /* goto default */
        }
-#endif
        case BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED:
                BT_INFO("BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED");
                char_val = (bt_gatt_char_value_t *)(param->param_data);
 
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
-               if (_bt_gatt_is_legacy_client_mode()) {
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT && _bt_gatt_is_legacy_client_mode()) {
                        bt_gatt_char_value_t *char_val = param->param_data;
 
                        if (char_val == NULL)
@@ -1904,7 +1899,6 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                                 bt_event_slot_container[event_index].user_data);
                        break;
                }
-#endif
                if (char_val == NULL)
                        return;
 
@@ -1920,8 +1914,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
 
                BT_INFO("BLUETOOTH_EVENT_GATT_READ_CHAR");
 
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
-               if (_bt_gatt_is_legacy_client_mode()) {
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT && _bt_gatt_is_legacy_client_mode()) {
                        bt_gatt_char_value_t *char_val = param->param_data;
 
                        ((bt_gatt_characteristic_read_cb)bt_event_slot_container[event_index].callback)
@@ -1930,7 +1923,6 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                        _bt_unset_cb(BT_EVENT_GATT_CLIENT_READ_CHARACTERISTIC_LEGACY);
                        break;
                }
-#endif
                _bt_unset_cb(BT_EVENT_GATT_CLIENT_READ_CHARACTERISTIC);
                ret = _bt_get_error_code(param->result);
                if (ret == BT_ERROR_NONE) {
@@ -1950,15 +1942,13 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
 
                BT_INFO("BLUETOOTH_EVENT_GATT_WRITE_CHAR");
 
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
-               if (_bt_gatt_is_legacy_client_mode()) {
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT && _bt_gatt_is_legacy_client_mode()) {
                        ((bt_gatt_characteristic_write_cb)bt_event_slot_container[event_index].callback)
                                (bt_event_slot_container[event_index].user_data);
 
                        _bt_unset_cb(BT_EVENT_GATT_CLIENT_WRITE_CHARACTERISTIC_LEGACY);
                        break;
                }
-#endif
                _bt_unset_cb(BT_EVENT_GATT_CLIENT_WRITE_CHARACTERISTIC);
 
                /* Send actual ATT error code to Application
@@ -2086,8 +2076,8 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
 
                break;
        }
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
-       case BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED: {
+       case BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED:
+       if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                BT_INFO("BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED");
                if (_bt_gatt_is_legacy_client_mode()) {
                        bt_gatt_char_property_t *char_desc = param->param_data;
@@ -2101,8 +2091,9 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                        _bt_unset_cb(BT_EVENT_GATT_CLIENT_CHARACTERISTIC_DESCRIPTOR_DISCOVERED_LEGACY);
                }
                break;
+       } else {
+               break; /* goto default */
        }
-#endif
        case BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED: {
                const GSList *server_list = NULL;
                BT_INFO("BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED");
@@ -2304,8 +2295,8 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                if (device_addr != NULL)
                        free(device_addr); /* LCOV_EXCL_STOP */
                break;
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
-       case BLUETOOTH_PBAP_CONNECTED: {
+       case BLUETOOTH_PBAP_CONNECTED:
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
                bt_pbap_connection_state_changed_cb cb = bt_event_slot_container[event_index].callback;
                void *user_data = bt_event_slot_container[event_index].user_data;
                bt_pbap_connected_t *connected = (bt_pbap_connected_t *)param->param_data;
@@ -2319,8 +2310,11 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                        free(device_addr);
 
                break;
+       } else {
+               break; /* goto default; */
        }
-       case BLUETOOTH_PBAP_DISCONNECTED: {
+       case BLUETOOTH_PBAP_DISCONNECTED:
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
                bt_pbap_connection_state_changed_cb cb = bt_event_slot_container[event_index].callback;
                void *user_data = bt_event_slot_container[event_index].user_data;
                bt_pbap_connected_t *connected = (bt_pbap_connected_t *)param->param_data;
@@ -2334,8 +2328,11 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                        free(device_addr);
 
                break;
+       } else {
+               break; /* goto default; */
        }
-       case BLUETOOTH_PBAP_PHONEBOOK_SIZE: {
+       case BLUETOOTH_PBAP_PHONEBOOK_SIZE:
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
                bt_pbap_phone_book_size_cb cb = bt_event_slot_container[event_index].callback;
                void *user_data = bt_event_slot_container[event_index].user_data;
                bt_pbap_phonebook_size_t *pb_size = (bt_pbap_phonebook_size_t *)param->param_data;
@@ -2350,8 +2347,11 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                        free(device_addr);
 
                break;
+       } else {
+               break; /* goto default; */
        }
-       case BLUETOOTH_PBAP_PHONEBOOK_PULL: {
+       case BLUETOOTH_PBAP_PHONEBOOK_PULL:
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
                bt_pbap_phone_book_received_cb cb = bt_event_slot_container[event_index].callback;
                void *user_data = bt_event_slot_container[event_index].user_data;
                bt_pbap_phonebook_pull_t *pb_pull = (bt_pbap_phonebook_pull_t *)(param->param_data);
@@ -2367,8 +2367,11 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                        free(device_addr);
 
                break;
+       } else {
+               break; /* goto default; */
        }
-       case BLUETOOTH_PBAP_VCARD_LIST: {
+       case BLUETOOTH_PBAP_VCARD_LIST:
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
                int i;
                bt_pbap_list_vcards_cb cb = bt_event_slot_container[event_index].callback;
                void *user_data = bt_event_slot_container[event_index].user_data;
@@ -2397,10 +2400,12 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                                g_free((char *)vcard_info[i].contact_name);
                        free(vcard_info);
                }
-
                break;
+       } else {
+               break; /* goto default; */
        }
-       case BLUETOOTH_PBAP_VCARD_PULL: {
+       case BLUETOOTH_PBAP_VCARD_PULL:
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
                bt_pbap_phone_book_received_cb cb = bt_event_slot_container[event_index].callback;
                void *user_data = bt_event_slot_container[event_index].user_data;
                bt_pbap_vcard_pull_t *vc_pull = (bt_pbap_vcard_pull_t *)(param->param_data);
@@ -2416,8 +2421,11 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                        free(device_addr);
 
                break;
+       } else {
+               break; /* goto default; */
        }
-       case BLUETOOTH_PBAP_PHONEBOOK_SEARCH: {
+       case BLUETOOTH_PBAP_PHONEBOOK_SEARCH:
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
                bt_pbap_list_vcards_cb cb = bt_event_slot_container[event_index].callback;
                void *user_data = bt_event_slot_container[event_index].user_data;
                bt_pbap_phonebook_search_list_t *vc_list = (bt_pbap_phonebook_search_list_t *)(param->param_data);
@@ -2441,8 +2449,11 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                        free(vcard_info);
 
                break;
+       } else {
+               break; /* goto default; */
        }
        case BLUETOOTH_EVENT_HF_CONNECTED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CONNECTED");
                device_addr = (char *)(param->param_data);
                ((bt_audio_connection_state_changed_cb)bt_event_slot_container[event_index].callback)
@@ -2450,6 +2461,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_DISCONNECTED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_DISCONNECTED");
                device_addr = (char *)(param->param_data);
                ((bt_audio_connection_state_changed_cb)bt_event_slot_container[event_index].callback)
@@ -2457,6 +2469,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_AUDIO_CONNECTED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_AUDIO_CONNECTED");
                device_addr = (char *)(param->param_data);
                ((bt_hf_sco_state_changed_cb)bt_event_slot_container[event_index].callback)
@@ -2464,6 +2477,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED");
                device_addr = (char *)(param->param_data);
                ((bt_hf_sco_state_changed_cb)bt_event_slot_container[event_index].callback)
@@ -2471,6 +2485,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_RING_INDICATOR:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_RING_INDICATOR");
                phone_number = (char *)(param->param_data);
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
@@ -2478,66 +2493,77 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALL_TERMINATED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALL_TERMINATED");
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_CALL_EVENT_CALL_TERMINATED, NULL,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALL_FAILED_TO_DIAL");
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_CALL_EVENT_FAILED_TO_DIALING, NULL,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALL_IDLE:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALL_IDLE");
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_CALL_EVENT_IDLE, NULL,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING");
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_CALL_EVENT_INCOMING, NULL,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALLSETUP_DIALING:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALLSETUP_DIALING");
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_CALL_EVENT_DIALING, NULL,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING");
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_CALL_EVENT_ALERTING, NULL,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALL_STARTED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALL_STARTED");
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_CALL_EVENT_CALL_STARTED, NULL,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALL_ENDED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALL_ENDED");
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_CALL_EVENT_CALL_ENDED, NULL,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED");
                ((bt_hf_remote_device_state_changed_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_DEVICE_STATE_VOICE_RECOGNITON, TRUE,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED");
                ((bt_hf_remote_device_state_changed_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_DEVICE_STATE_VOICE_RECOGNITON, FALSE,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALL_WAITING:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALL_WAITING");
                phone_number = (char *)(param->param_data);
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
@@ -2545,24 +2571,28 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALL_ON_HOLD:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALL_ON_HOLD");
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_CALL_EVENT_HELD, NULL,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALL_UNHOLD:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALL_UNHOLD");
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_CALL_EVENT_UNHELD, NULL,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_CALL_SWAPPED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_CALL_SWAPPED");
                ((bt_hf_remote_call_event_cb)bt_event_slot_container[event_index].callback)
                (BT_HF_REMOTE_CALL_EVENT_SWAPPED, NULL,
                bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD:
+               if (!TIZEN_PROFILE_WEARABLE_IVI) break;
                BT_INFO("BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD");
                bluetooth_vendor_dep_at_cmd_t *cmd = (bluetooth_vendor_dep_at_cmd_t *)(param->param_data);
                bt_hf_vendor_dep_at_cmd_s command = {0, };
@@ -2571,14 +2601,18 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                ((bt_hf_vendor_dep_cmd_event_cb)bt_event_slot_container[event_index].callback)
                (command, bt_event_slot_container[event_index].user_data);
                break;
-       case BLUETOOTH_EVENT_HF_VOLUME_SPEAKER: {
+       case BLUETOOTH_EVENT_HF_VOLUME_SPEAKER:
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
                BT_INFO("BLUETOOTH_EVENT_HF_VOLUME_SPEAKER");
                int *spk_gain = (int *)(param->param_data);
                ((bt_hf_speaker_gain_changed_cb)bt_event_slot_container[event_index].callback)
                (*spk_gain, bt_event_slot_container[event_index].user_data);
                break;
+       } else {
+               break; /* goto default; */
        }
-       case BLUETOOTH_EVENT_HF_CALL_STATUS: {
+       case BLUETOOTH_EVENT_HF_CALL_STATUS:
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
                BT_INFO("BLUETOOTH_EVENT_HF_CALL_STATUS");
                bt_hf_call_list_s *handle = (bt_hf_call_list_s *)(param->param_data);
                GList *l = NULL;
@@ -2600,8 +2634,11 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                ((bt_hf_call_status_updated_event_cb)bt_event_slot_container[event_index].callback)
                (call_list, bt_event_slot_container[event_index].user_data);
                break;
+       } else {
+               break; /* goto default; */
        }
-       case BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED: {
+       case BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED:
+       if (TIZEN_PROFILE_WEARABLE_IVI) {
                bluetooth_hf_ciev_device_event_t *device_event = (bluetooth_hf_ciev_device_event_t *)(param->param_data);
 
                BT_INFO("BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED (status %d)(value %d)",
@@ -2611,8 +2648,9 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                ((bt_hf_remote_device_state_e) device_event->event, device_event->value,
                bt_event_slot_container[event_index].user_data);
                break;
+       } else {
+               break; /* goto default; */
        }
-#endif
        case BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED: {
                BT_DBG("BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED"); /* LCOV_EXCL_LINE */
                ((bt_ipsp_init_state_changed_cb)bt_event_slot_container[event_index].callback) /* LCOV_EXCL_LINE */
@@ -2642,9 +2680,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
 static void __bt_le_event_proxy(int event, bluetooth_event_param_t *param, void *user_data)
 {
        bt_adapter_le_device_scan_result_info_s *scan_info = NULL;
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
        bt_adapter_le_device_discovery_info_s *discovery_info = NULL;
-#endif
        int event_index = -1;
 
        event_index = __bt_get_cb_index(event);
@@ -2665,19 +2701,24 @@ static void __bt_le_event_proxy(int event, bluetooth_event_param_t *param, void
                    (_bt_get_error_code(param->result), BT_ADAPTER_LE_DISABLED, bt_event_slot_container[event_index].user_data);
                break;
 
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
        case BLUETOOTH_EVENT_LE_DISCOVERY_STARTED:
-               BT_INFO("BLUETOOTH_EVENT_LE_DISCOVERY_STARTED"); /* LCOV_EXCL_LINE */
-               ((bt_adapter_le_device_discovery_state_changed_cb) bt_event_slot_container[event_index].callback) /* LCOV_EXCL_LINE */
-                       (_bt_get_error_code(param->result), BT_ADAPTER_LE_DEVICE_DISCOVERY_STARTED, NULL, bt_event_slot_container[event_index].user_data);
-               break;
+               if (!TIZEN_PROFILE_WEARABLE_IVI) {
+                       BT_INFO("BLUETOOTH_EVENT_LE_DISCOVERY_STARTED"); /* LCOV_EXCL_LINE */
+                       ((bt_adapter_le_device_discovery_state_changed_cb) bt_event_slot_container[event_index].callback) /* LCOV_EXCL_LINE */
+                               (_bt_get_error_code(param->result), BT_ADAPTER_LE_DEVICE_DISCOVERY_STARTED, NULL, bt_event_slot_container[event_index].user_data);
+                       break;
+               } else {
+                       break; /* goto default */
+               }
        case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
-               BT_INFO("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED"); /* LCOV_EXCL_LINE */
-               ((bt_adapter_le_device_discovery_state_changed_cb)bt_event_slot_container[event_index].callback) /* LCOV_EXCL_LINE */
-                       (_bt_get_error_code(param->result), BT_ADAPTER_LE_DEVICE_DISCOVERY_FINISHED, NULL, bt_event_slot_container[event_index].user_data);
-               break;
-#endif
-
+               if (!TIZEN_PROFILE_WEARABLE_IVI) {
+                       BT_INFO("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED"); /* LCOV_EXCL_LINE */
+                       ((bt_adapter_le_device_discovery_state_changed_cb)bt_event_slot_container[event_index].callback) /* LCOV_EXCL_LINE */
+                               (_bt_get_error_code(param->result), BT_ADAPTER_LE_DEVICE_DISCOVERY_FINISHED, NULL, bt_event_slot_container[event_index].user_data);
+                       break;
+               } else {
+                       break; /* goto default */
+               }
        case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
                BT_INFO("BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND");
                event_index = BT_EVENT_LE_SCAN_RESULT_UPDATED;
@@ -2691,19 +2732,19 @@ static void __bt_le_event_proxy(int event, bluetooth_event_param_t *param, void
                                        (_bt_get_error_code(param->result), NULL, bt_event_slot_container[event_index].user_data);
                        }
                }
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
-               event_index = BT_EVENT_LE_DEVICE_DISCOVERY_STATE_CHANGED;
-               if (bt_event_slot_container[event_index].callback != NULL) {
-                       if (__bt_get_bt_adapter_le_device_discovery_info_s(&discovery_info, (bluetooth_le_device_info_t *)(param->param_data)) == BT_ERROR_NONE) { /* LCOV_EXCL_LINE */
-                               ((bt_adapter_le_device_discovery_state_changed_cb)bt_event_slot_container[event_index].callback) /* LCOV_EXCL_LINE */
-                                       (_bt_get_error_code(param->result), BT_ADAPTER_LE_DEVICE_DISCOVERY_FOUND, discovery_info, bt_event_slot_container[event_index].user_data);
-                               __bt_free_bt_adapter_le_device_discovery_info_s(discovery_info); /* LCOV_EXCL_LINE */
-                       } else {
-                               ((bt_adapter_le_device_discovery_state_changed_cb)bt_event_slot_container[event_index].callback) /* LCOV_EXCL_LINE */
-                                       (_bt_get_error_code(param->result), BT_ADAPTER_LE_DEVICE_DISCOVERY_FOUND, NULL, bt_event_slot_container[event_index].user_data);
+               if (!TIZEN_PROFILE_WEARABLE_IVI) {
+                       event_index = BT_EVENT_LE_DEVICE_DISCOVERY_STATE_CHANGED;
+                       if (bt_event_slot_container[event_index].callback != NULL) {
+                               if (__bt_get_bt_adapter_le_device_discovery_info_s(&discovery_info, (bluetooth_le_device_info_t *)(param->param_data)) == BT_ERROR_NONE) { /* LCOV_EXCL_LINE */
+                                       ((bt_adapter_le_device_discovery_state_changed_cb)bt_event_slot_container[event_index].callback) /* LCOV_EXCL_LINE */
+                                               (_bt_get_error_code(param->result), BT_ADAPTER_LE_DEVICE_DISCOVERY_FOUND, discovery_info, bt_event_slot_container[event_index].user_data);
+                                       __bt_free_bt_adapter_le_device_discovery_info_s(discovery_info); /* LCOV_EXCL_LINE */
+                               } else {
+                                       ((bt_adapter_le_device_discovery_state_changed_cb)bt_event_slot_container[event_index].callback) /* LCOV_EXCL_LINE */
+                                               (_bt_get_error_code(param->result), BT_ADAPTER_LE_DEVICE_DISCOVERY_FOUND, NULL, bt_event_slot_container[event_index].user_data);
+                               }
                        }
                }
-#endif
                break;
 
        default:
@@ -2848,7 +2889,6 @@ static void __bt_free_bt_adapter_le_device_scan_info_s(bt_adapter_le_device_scan
 }
 
 /* LCOV_EXCL_START */
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
 static int __bt_get_bt_adapter_le_device_discovery_info_s(
                        bt_adapter_le_device_discovery_info_s **le_discovery_info,
                        bluetooth_le_device_info_t *source_info)
@@ -2900,9 +2940,6 @@ static void __bt_free_bt_adapter_le_device_discovery_info_s(bt_adapter_le_device
        discovery_info = NULL;
 }
 
-#endif
-
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
 static int __bt_get_gatt_client_cb_index(int event)
 {
        switch (event) {
@@ -2925,7 +2962,6 @@ static int __bt_get_gatt_client_cb_index(int event)
 
        return -1;
 }
-#endif
 /* LCOV_EXCL_STOP */
 static int __bt_get_cb_index(int event)
 {
@@ -3078,23 +3114,26 @@ static int __bt_get_cb_index(int event)
                return BT_EVENT_HID_DEVICE_CONNECTION_STATUS;
        case BLUETOOTH_HID_DEVICE_DATA_RECEIVED:
                return BT_EVENT_HID_DEVICE_DATA_RECEIVED;
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
        case BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED:
+               if (!TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT)
+                       return -1; /* default */
                return BT_EVENT_GATT_CLIENT_CHARACTERISTIC_DISCOVERED_LEGACY;
        case BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED:
+               if (!TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT)
+                       return -1; /* default */
                return BT_EVENT_GATT_CLIENT_CHARACTERISTIC_DESCRIPTOR_DISCOVERED_LEGACY;
        case BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED:
-       case BLUETOOTH_EVENT_GATT_READ_CHAR:
-       case BLUETOOTH_EVENT_GATT_WRITE_CHAR:
-               return __bt_get_gatt_client_cb_index(event);
-#else
-       case BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT)
+                       return __bt_get_gatt_client_cb_index(event);
                return BT_EVENT_GATT_CLIENT_VALUE_CHANGED;
        case BLUETOOTH_EVENT_GATT_READ_CHAR:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT)
+                       return __bt_get_gatt_client_cb_index(event);
                return BT_EVENT_GATT_CLIENT_READ_CHARACTERISTIC;
        case BLUETOOTH_EVENT_GATT_WRITE_CHAR:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT)
+                       return __bt_get_gatt_client_cb_index(event);
                return BT_EVENT_GATT_CLIENT_WRITE_CHARACTERISTIC;
-#endif
        case BLUETOOTH_EVENT_GATT_READ_DESC:
                return BT_EVENT_GATT_CLIENT_READ_DESCRIPTOR;
        case BLUETOOTH_EVENT_GATT_WRITE_DESC:
@@ -3126,27 +3165,46 @@ static int __bt_get_cb_index(int event)
                return BT_EVENT_SUPPORTED_TRUSTED_PROFILE_EVENT;
        case BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED:
                return BT_EVENT_LE_DATA_LENGTH_CHANGED; /* LCOV_EXCL_LINE */
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
        case BLUETOOTH_PBAP_CONNECTED:
        case BLUETOOTH_PBAP_DISCONNECTED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_PBAP_CONNECTION_STATUS;
        case BLUETOOTH_PBAP_PHONEBOOK_SIZE:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_PBAP_PHONEBOOK_SIZE;
        case BLUETOOTH_PBAP_PHONEBOOK_PULL:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_PBAP_PHONEBOOK_PULL;
        case BLUETOOTH_PBAP_VCARD_LIST:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_PBAP_VCARD_LIST;
        case BLUETOOTH_PBAP_VCARD_PULL:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_PBAP_VCARD_PULL;
        case BLUETOOTH_PBAP_PHONEBOOK_SEARCH:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_PBAP_PHONEBOOK_SEARCH;
        case BLUETOOTH_EVENT_HF_CONNECTED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_AUDIO_CONNECTION_STATUS;
        case BLUETOOTH_EVENT_HF_DISCONNECTED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_AUDIO_CONNECTION_STATUS;
        case BLUETOOTH_EVENT_HF_AUDIO_CONNECTED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_HF_SCO_CONNECTION_STATUS;
        case BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_HF_SCO_CONNECTION_STATUS;
        case BLUETOOTH_EVENT_HF_RING_INDICATOR:
        case BLUETOOTH_EVENT_HF_CALL_TERMINATED:
@@ -3161,18 +3219,27 @@ static int __bt_get_cb_index(int event)
        case BLUETOOTH_EVENT_HF_CALLSETUP_INCOMING:
        case BLUETOOTH_EVENT_HF_CALLSETUP_DIALING:
        case BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_HF_REMOTE_CALL_EVENT;
        case BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_HF_VENDOR_DEP_CMD_EVENT;
        case BLUETOOTH_EVENT_HF_VOLUME_SPEAKER:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_HF_SPEAKER_GAIN_CHANGE;
        case BLUETOOTH_EVENT_HF_CALL_STATUS:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_HF_CALL_STATUS_UPDATED_EVENT;
        case BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED:
        case BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED:
        case BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       return -1;
                return BT_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED;
-#endif
        case BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED:
                return  BT_EVENT_IPSP_INIT_STATE_CHANGED;
        case BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED:
@@ -3428,3 +3495,37 @@ next:
        return BT_ERROR_NONE;
 }
 /* LCOV_EXCL_STOP */
+
+tizen_profile_t profile = _PROFILE_UNKNOWN;
+tizen_profile_t _get_tizen_profile()
+{
+       char *profileName;
+
+       if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
+               return profile;
+
+       system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+       switch (*profileName) {
+       case 'm':
+       case 'M':
+               profile = _PROFILE_MOBILE;
+               break;
+       case 'w':
+       case 'W':
+               profile = _PROFILE_WEARABLE;
+               break;
+       case 't':
+       case 'T':
+               profile = _PROFILE_TV;
+               break;
+       case 'i':
+       case 'I':
+               profile = _PROFILE_IVI;
+               break;
+       default: // common or unknown ==> ALL ARE COMMON.
+               profile = _PROFILE_COMMON;
+       }
+       free(profileName);
+
+       return profile;
+}
index f790f01fbcf9eaebf53ce3a720a2ab5fc7b0d66c..2a50411b3f599e560a9ab23e0a349d34dffc74ec 100644 (file)
@@ -387,7 +387,6 @@ next:
        return BT_ERROR_NONE;
 }
 
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
 bool _bt_gatt_is_legacy_client_mode(void)
 {
        if (gatt_client_list) {
@@ -800,7 +799,6 @@ int bt_gatt_discover_characteristic_descriptor(bt_gatt_attribute_h characteristi
 
        return ret; /* LCOV_EXCL_STOP */
 }
-#endif
 
 int bt_gatt_connect(const char *address, bool auto_connect)
 {
index e9c6ad3caf36662db15781536e4d1aadb0c4b9a5..a60d8ea0c2258235b5d4b36cf249156459dd5729 100644 (file)
@@ -95,12 +95,10 @@ static int total_time = 0;
 static struct timeval check_time = {0,};
 
 static gboolean is_sub_index = FALSE;
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
 int service_index;
 int char_service_index;
 static int selected_service_index = -1;
 static int selected_char_index = 0;
-#endif
 
 static bt_advertiser_h advertiser = NULL;
 static bt_advertiser_h advertiser_list[3] = {NULL, };
@@ -125,11 +123,9 @@ bt_proximity_reporter_h reporter;
 bt_proximity_monitor_h monitor;
 bt_scan_filter_h pxp_scan_filter;
 
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
 bt_gatt_attribute_h service_clone[MAX_SERVICES];
 bt_gatt_attribute_h characteristics[MAX_SERVICES];
 bt_gatt_attribute_h characteristics_services[MAX_SERVICES];
-#endif
 
 static unsigned char *hash = NULL;
 static unsigned char *randomizer = NULL;
@@ -177,12 +173,10 @@ tc_table_t tc_main[] = {
                , BT_UNIT_TEST_TABLE_DPM},
        {"PXP"
                , BT_UNIT_TEST_TABLE_PXP},
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
        {"HF Role"
                , BT_UNIT_TEST_TABLE_HF},
        {"PBAP Client"
                , BT_UNIT_TEST_TABLE_PBAP_CLIENT},
-#endif
        {"etc.(Automated test, AppControl)"
                , BT_UNIT_TEST_TABLE_ETC},
        {"Initialize All"
@@ -291,12 +285,10 @@ tc_table_t tc_adapter_le[] = {
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_SCAN},
        {"bt_adapter_le_stop_scan"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_SCAN},
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
        {"bt_adapter_le_start_device_discovery"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_DEVICE_DISCOVERY},
        {"bt_adapter_le_stop_device_discovery"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_DEVICE_DISCOVERY},
-#endif
        {"bt_adapter_le_add_advertising_data"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ADD_ADVERTISING_DATA},
        {"bt_adapter_le_set_advertising_mode"
@@ -307,20 +299,16 @@ tc_table_t tc_adapter_le[] = {
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_ADVERTISING_CONNECTABLE},
        {"bt_adapter_le_start_advertising_new"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_ADVERTISING_NEW},
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
        {"bt_adapter_le_start_advertising"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_ADVERTISING},
-#endif
        {"bt_adapter_le_stop_advertising"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_ADVERTISING},
        {"bt_adapter_le_add_white_list"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ADD_WHITE_LIST},
        {"bt_adapter_le_remove_white_list"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REMOVE_WHITE_LIST},
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
        {"bt_adapter_le_clear_white_list"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_CLEAR_WHITE_LIST},
-#endif
        {"bt_adapter_le_enable_privacy"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ENABLE_PRIVACY},
        {"Register scan filter (Device Address)"
@@ -333,12 +321,10 @@ tc_table_t tc_adapter_le[] = {
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REGISTER_SCAN_FILTER_IBEACON_DATA},
        {"Unregister all scan filters"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_UNREGISTER_ALL_SCAN_FILTERS},
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
        {"bt_adapter_le_set_device_discovery_state_changed_cb"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_DEVICE_DISCOVERY_STATE_CHANGED_CB},
        {"bt_adapter_le_unset_device_discovery_state_changed_cb"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_UNSET_DEVICE_DISCOVERY_STATE_CHANGED_CB},
-#endif
        {"bt_adater_le_read_maximum_data_length"
                , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_READ_MAXIMUM_DATA_LENGTH},
        {"bt_adater_le_wite_host_suggested_def_data_length"
@@ -627,7 +613,6 @@ tc_table_t tc_gatt[] = {
                , BT_UNIT_TEST_FUNCTION_ANCS_NEGATIVE_ACTION},
        {"ANCS (Get Noti. Attr.)"
                , BT_UNIT_TEST_FUNCTION_ANCS_GET_NOTI_ATTR},
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
        {"bt_gatt_foreach_primary_services"
                , BT_UNIT_TEST_FUNCTION_GATT_FOREACH_PRIMARY_SERVICES},
        {"bt_gatt_discover_characteristics"
@@ -654,7 +639,6 @@ tc_table_t tc_gatt[] = {
                , BT_UNIT_TEST_FUNCTION_GATT_WATCH_CHARACTERISTIC_CHANGES},
        {"bt_gatt_unwatch_characteristic_changes"
                , BT_UNIT_TEST_FUNCTION_GATT_UNWATCH_CHARACTERISTIC_CHANGES},
-#endif
        {"Select this menu to set parameters and then select the function again."
                , BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS},
        {NULL                                   , 0x0000},
@@ -1009,7 +993,6 @@ tc_table_t tc_DPM[] = {
        {NULL                                   , 0x0000},
 };
 
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
 tc_table_t tc_hf[] = {
        /* Handsfree role functions */
        {"BACK"
@@ -1091,7 +1074,6 @@ tc_table_t tc_pbap_client[] = {
                , BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS},
        {NULL                                   , 0x0000},
 };
-#endif
 
 tc_table_t tc_automated_test[] = {
        /* Automated test Functions*/
@@ -1170,14 +1152,16 @@ void tc_usage_print(void)
        case BT_UNIT_TEST_TABLE_PXP:
                tc_table = tc_pxp;
                break;
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
        case BT_UNIT_TEST_TABLE_HF:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       goto __default;
                tc_table = tc_hf;
                break;
        case BT_UNIT_TEST_TABLE_PBAP_CLIENT:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       goto __default;
                tc_table = tc_pbap_client;
                break;
-#endif
        case BT_UNIT_TEST_TABLE_ETC:
                if (input_automated_test_delay == true) {
                        TC_PRT("Input the delay for automated"
@@ -1191,6 +1175,7 @@ void tc_usage_print(void)
                TC_PRT("Key 0 : usage BACK");
                return;
        case BT_UNIT_TEST_TABLE_MAIN:
+__default__:
        default:
                tc_table = tc_main;
                break;
@@ -1294,7 +1279,6 @@ static const char *__bt_get_error_message(bt_error_e err)
        return err_str;
 }
 
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
 static gboolean __select_index_cb(GIOChannel *chan,
                                GIOCondition cond,
                                gpointer data)
@@ -1377,7 +1361,6 @@ static void __bt_free_gatt_characteristics_services(void)
        }
        char_service_index = 0;
 }
-#endif
 
 void __bt_adapter_state_changed_cb(int result,
                bt_adapter_state_e adapter_state, void *user_data)
@@ -1648,7 +1631,6 @@ void __bt_gatt_server_notification_state_change_cb(bool notify,
 }
 
 
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
 static void __bt_adapter_le_device_discovery_state_changed_cb(int result,
                bt_adapter_le_device_discovery_state_e discovery_state,
                bt_adapter_le_device_discovery_info_s *discovery_info,
@@ -1713,7 +1695,6 @@ static void __bt_adapter_le_device_discovery_state_changed_cb(int result,
 #endif
        }
 }
-#endif
 
 static void __bt_adapter_le_advertising_state_changed_cb(int result,
        bt_advertiser_h advertiser, bt_adapter_le_advertising_state_e adv_state,
@@ -2595,7 +2576,6 @@ bool __bt_gatt_server_foreach_svc_cb(int total,
        return true;
 }
 
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
 bool __bt_gatt_primary_service_cb(bt_gatt_attribute_h service,
        void *user_data)
 {
@@ -2706,7 +2686,6 @@ void __bt_gatt_remote_characteristic_write_cb(bt_gatt_attribute_h characteristic
        TC_PRT("updated characteristic is %s", (char *)characteristic);
        TC_PRT("new char value is %s", char_value);
 }
-#endif
 
 void __bt_avrcp_target_connection_state_changed_cb(bool connected,
        const char *remote_address, void *user_data)
@@ -2867,7 +2846,6 @@ void __bt_ipsp_connection_state_changed_cb(int result,
        memcpy(ipsp_iface_name, iface_name, strlen(iface_name));
 }
 
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
 void __bt_hf_sco_state_changed_cb(int result,
        bool opened, void *user_data)
 {
@@ -2988,7 +2966,6 @@ void __bt_pbap_vcard_list_cb(int result, const char *remote_address,
        TC_PRT("Listing Status: %s",
                (result == BT_ERROR_NONE) ? "Successful" : "Unsuccessful");
 }
-#endif
 
 void __bt_repeat_test_adapter_state_changed_cb(int result,
        bt_adapter_state_e adapter_state, void *user_data)
@@ -3058,17 +3035,17 @@ static void __bt_initialize_all(void)
                        __bt_adapter_device_discovery_state_changed_cb, NULL);
        if (ret != BT_ERROR_NONE)
                TC_PRT("returns %s\n", __bt_get_error_message(ret));
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
-       ret = bt_adapter_le_set_device_discovery_state_changed_cb(
-               __bt_adapter_le_device_discovery_state_changed_cb, NULL);
-       if (ret != BT_ERROR_NONE)
-               TC_PRT("returns %s\n", __bt_get_error_message(ret));
-#else
-       ret = bt_pbap_client_set_connection_state_changed_cb(__bt_pbap_connection_state_changed_cb,
-                       NULL);
-       if (ret != BT_ERROR_NONE)
-               TC_PRT("returns %s\n", __bt_get_error_message(ret));
-#endif
+       if (!TIZEN_PROFILE_WEARABLE_IVI) {
+               ret = bt_adapter_le_set_device_discovery_state_changed_cb(
+                       __bt_adapter_le_device_discovery_state_changed_cb, NULL);
+               if (ret != BT_ERROR_NONE)
+                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
+       } else {
+               ret = bt_pbap_client_set_connection_state_changed_cb(__bt_pbap_connection_state_changed_cb,
+                               NULL);
+               if (ret != BT_ERROR_NONE)
+                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
+       }
        ret = bt_socket_set_connection_state_changed_cb(
                __bt_socket_connection_state_changed_cb, NULL);
        if (ret != BT_ERROR_NONE)
@@ -4458,8 +4435,10 @@ int test_set_params(int test_id, char *param)
                break;
        }
 
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
-       case BT_UNIT_TEST_TABLE_HF: {
+       case BT_UNIT_TEST_TABLE_HF:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       goto __default__;
+       {
                switch (test_id) {
                default:
                        TC_PRT("There is no param to set\n");
@@ -4469,7 +4448,10 @@ int test_set_params(int test_id, char *param)
 
                break;
        }
-       case BT_UNIT_TEST_TABLE_PBAP_CLIENT: {
+       case BT_UNIT_TEST_TABLE_PBAP_CLIENT:
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       goto __default__;
+       {
                switch (test_id) {
                default:
                        TC_PRT("There is no param to set\n");
@@ -4479,7 +4461,6 @@ int test_set_params(int test_id, char *param)
 
                break;
        }
-#endif
        case BT_UNIT_TEST_TABLE_ETC: {
                switch (test_id) {
                case BT_UNIT_TEST_FUNCTION_CHECK_FEATURE: {
@@ -4520,6 +4501,7 @@ int test_set_params(int test_id, char *param)
 
                break;
        }
+__default__:
        default:
                TC_PRT("There is no param to set\n");
                need_to_set_params = false;
@@ -5003,17 +4985,19 @@ int test_input_callback(void *data)
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
 
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_DEVICE_DISCOVERY:
+                       if (TIZEN_PROFILE_WEARABLE_IVI)
+                               break;
                        ret = bt_adapter_le_start_device_discovery();
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
 
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_DEVICE_DISCOVERY:
+                       if (TIZEN_PROFILE_WEARABLE_IVI)
+                               break;
                        ret = bt_adapter_le_stop_device_discovery();
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
-#endif
 
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ADD_ADVERTISING_DATA: {
                        int adv_data_type = 3; /* default all */
@@ -5260,8 +5244,9 @@ int test_input_callback(void *data)
                                TC_PRT("failed with [0x%04x]", ret);
                        break;
                }
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_ADVERTISING: {
+                       if (TIZEN_PROFILE_WEARABLE_IVI)
+                               break;
                        bt_adapter_le_advertising_state_changed_cb cb;
                        bt_adapter_le_advertising_params_s adv_params = { 0, };
 
@@ -5288,7 +5273,6 @@ int test_input_callback(void *data)
                                TC_PRT("failed with [0x%04x]", ret);
                        break;
                }
-#endif
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_ADVERTISING: {
                        int slot_id = 0;
 
@@ -5333,13 +5317,13 @@ int test_input_callback(void *data)
                        break;
                }
 
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_CLEAR_WHITE_LIST: {
+                       if (TIZEN_PROFILE_WEARABLE_IVI)
+                               break;
                        ret = bt_adapter_le_clear_white_list();
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
                }
-#endif
 
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ENABLE_PRIVACY: {
                        static bool enable_privacy = false;
@@ -5455,18 +5439,20 @@ int test_input_callback(void *data)
                        break;
                }
 
-#if !defined(TIZEN_PROFILE_WEARABLE) && !defined(TIZEN_PROFILE_IVI)
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_DEVICE_DISCOVERY_STATE_CHANGED_CB:
+                       if (TIZEN_PROFILE_WEARABLE_IVI)
+                               break;
                        ret = bt_adapter_le_set_device_discovery_state_changed_cb(
                                __bt_adapter_le_device_discovery_state_changed_cb, NULL);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
 
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_UNSET_DEVICE_DISCOVERY_STATE_CHANGED_CB:
+                       if (TIZEN_PROFILE_WEARABLE_IVI)
+                               break;
                        ret = bt_adapter_le_unset_device_discovery_state_changed_cb();
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
-#endif
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_READ_MAXIMUM_DATA_LENGTH: {
 
                        TC_PRT("Read Maximum LE Data length");
@@ -7099,8 +7085,8 @@ int test_input_callback(void *data)
 
                        break;
                }
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
-               case BT_UNIT_TEST_FUNCTION_GATT_FOREACH_PRIMARY_SERVICES: {
+               case BT_UNIT_TEST_FUNCTION_GATT_FOREACH_PRIMARY_SERVICES:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        __bt_free_gatt_services();
 
                        ret = bt_gatt_foreach_primary_services(remote_addr,
@@ -7111,9 +7097,11 @@ int test_input_callback(void *data)
                                __select_index(&selected_service_index,
                                "Select primary service :");
                        break;
+               } else {
+                       break; /* go to default */
                }
-
-               case BT_UNIT_TEST_FUNCTION_GATT_DISCOVER_CHARACTERISTICS: {
+               case BT_UNIT_TEST_FUNCTION_GATT_DISCOVER_CHARACTERISTICS:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        __bt_free_gatt_characteristics();
 
                        if (selected_service_index < 0) {
@@ -7129,18 +7117,23 @@ int test_input_callback(void *data)
                        if (ret == BT_ERROR_NONE)
                                __select_index(&selected_char_index, "Select index :");
                        break;
-               }
-
-               case BT_UNIT_TEST_FUNCTION_GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS: {
+               } else {
+                       break; /* goto default */
+               } 
+               case BT_UNIT_TEST_FUNCTION_GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        ret = bt_gatt_discover_characteristic_descriptor(
                                        characteristics[selected_char_index],
                                        __bt_gatt_characteristic_descriptor_discovered_cb,
                                        NULL);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
+               } else {
+                       break; /* goto default */
                }
 
-               case BT_UNIT_TEST_FUNCTION_GATT_GET_SERVICE_UUID: {
+               case BT_UNIT_TEST_FUNCTION_GATT_GET_SERVICE_UUID:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        char *uuid = NULL;
                        char *name = NULL;
 
@@ -7161,9 +7154,12 @@ int test_input_callback(void *data)
                                g_free(uuid);
                        }
                        break;
+               } else {
+                       break; /* goto default */
                }
 
-               case BT_UNIT_TEST_FUNCTION_GATT_FOREACH_INCLUDED_SERVICES: {
+               case BT_UNIT_TEST_FUNCTION_GATT_FOREACH_INCLUDED_SERVICES:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        __bt_free_gatt_characteristics_services();
 
                        if (selected_service_index < 0) {
@@ -7177,23 +7173,32 @@ int test_input_callback(void *data)
                                        NULL);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
+               } else {
+                       break; /* goto default */
                }
 
-               case BT_UNIT_TEST_FUNCTION_GATT_SET_CHARACTERISTIC_CHANGED_CB: {
+               case BT_UNIT_TEST_FUNCTION_GATT_SET_CHARACTERISTIC_CHANGED_CB:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        ret = bt_gatt_set_characteristic_changed_cb(
                                        __bt_gatt_characteristic_changed_cb,
                                        NULL);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
+               } else {
+                       break; /* goto default */
                }
 
-               case BT_UNIT_TEST_FUNCTION_GATT_UNSET_CHARACTERISTIC_CHANGED_CB: {
+               case BT_UNIT_TEST_FUNCTION_GATT_UNSET_CHARACTERISTIC_CHANGED_CB:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        ret = bt_gatt_unset_characteristic_changed_cb();
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
+               } else {
+                       break; /* goto default */
                }
 
-               case BT_UNIT_TEST_FUNCTION_GATT_GET_CHARACTERISTIC_DECLARATION: {
+               case BT_UNIT_TEST_FUNCTION_GATT_GET_CHARACTERISTIC_DECLARATION:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        int i;
                        char *uuid = NULL;
                        char *name = NULL;
@@ -7217,9 +7222,12 @@ int test_input_callback(void *data)
                                g_free(value);
                        }
                        break;
+               } else {
+                       break; /* goto default */
                }
 
-               case BT_UNIT_TEST_FUNCTION_GATT_SET_CHARACTERISTIC_VALUE: {
+               case BT_UNIT_TEST_FUNCTION_GATT_SET_CHARACTERISTIC_VALUE:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        unsigned char value[] = { 1 };
                        if (selected_char_index == 0) {
                                TC_PRT("Need to select charateristic value \n");
@@ -7231,9 +7239,12 @@ int test_input_callback(void *data)
                                        value, 1);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
+               } else {
+                       break; /* goto default */
                }
 
-               case BT_UNIT_TEST_FUNCTION_GATT_SET_CHARACTERISTIC_VALUE_REQUEST: {
+               case BT_UNIT_TEST_FUNCTION_GATT_SET_CHARACTERISTIC_VALUE_REQUEST:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        unsigned char value[] = { 1 };
                        if (selected_char_index == 0) {
                                TC_PRT("Need to select charateristic value \n");
@@ -7245,9 +7256,12 @@ int test_input_callback(void *data)
                                        value, 1, __bt_gatt_char_write_cb);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
+               } else {
+                       break; /* goto default */
                }
 
-               case BT_UNIT_TEST_FUNCTION_GATT_READ_CHARACTERISTIC_VALUE: {
+               case BT_UNIT_TEST_FUNCTION_GATT_READ_CHARACTERISTIC_VALUE:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        if (selected_char_index == 0) {
                                TC_PRT("Need to select charateristic value \n");
                                break;
@@ -7258,9 +7272,12 @@ int test_input_callback(void *data)
                                        __bt_gatt_char_read_cb);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
+               } else {
+                       break; /* goto default */
                }
 
-               case BT_UNIT_TEST_FUNCTION_GATT_WATCH_CHARACTERISTIC_CHANGES: {
+               case BT_UNIT_TEST_FUNCTION_GATT_WATCH_CHARACTERISTIC_CHANGES:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        if (selected_service_index < 0) {
                                TC_PRT("Need to select primary service \n");
                                break;
@@ -7270,14 +7287,18 @@ int test_input_callback(void *data)
                                        service_clone[selected_service_index]);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
+               } else {
+                       break; /* goto default */
                }
-               case BT_UNIT_TEST_FUNCTION_GATT_UNWATCH_CHARACTERISTIC_CHANGES: {
+               case BT_UNIT_TEST_FUNCTION_GATT_UNWATCH_CHARACTERISTIC_CHANGES:
+               if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT) {
                        ret = bt_gatt_unwatch_characteristic_changes(
                                        service_clone[selected_service_index]);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
+               } else {
+                       break; /* goto default */
                }
-#endif
                case BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS:
                        need_to_set_params = true;
                        TC_PRT("Select the function again");
@@ -9254,8 +9275,9 @@ int test_input_callback(void *data)
                break;
        }
 
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
        case BT_UNIT_TEST_TABLE_HF: {
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       break;
                switch (test_id) {
                case BT_UNIT_TEST_FUNCTION_HF_INITIALIZE:
                        ret = bt_hf_initialize();
@@ -9426,6 +9448,8 @@ int test_input_callback(void *data)
                break;
        }
        case BT_UNIT_TEST_TABLE_PBAP_CLIENT: {
+               if (!TIZEN_PROFILE_WEARABLE_IVI)
+                       break;
                switch (test_id) {
 
                /*PBAP Test Cases */
@@ -9534,7 +9558,6 @@ int test_input_callback(void *data)
 
                break;
        }
-#endif
        case BT_UNIT_TEST_TABLE_ETC: {
                static unsigned int delay = 0;
                bt_onoff_cnt = 0;
index 37318a528639020949819a0ab68e25c8a916b4f3..fe10cf00a0d050bce38483d6594721c9c5e96921 100644 (file)
@@ -47,10 +47,8 @@ typedef enum {
        BT_UNIT_TEST_TABLE_HDP,
        BT_UNIT_TEST_TABLE_DPM,
        BT_UNIT_TEST_TABLE_PXP,
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
        BT_UNIT_TEST_TABLE_HF,
        BT_UNIT_TEST_TABLE_PBAP_CLIENT,
-#endif
        BT_UNIT_TEST_TABLE_ETC,
        BT_UNIT_TEST_FUNCTION_INITIALIZE_ALL,
        BT_UNIT_TEST_TABLE_FINISH = 0xFF,
@@ -104,34 +102,26 @@ typedef enum {
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_SCAN_MODE,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_SCAN,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_SCAN,
-#ifndef TIZEN_PROFILE_WEARABLE
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_DEVICE_DISCOVERY,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_DEVICE_DISCOVERY,
-#endif
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ADD_ADVERTISING_DATA,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_ADVERTISING_MODE,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_ADVERTISING_FILTER_POLICY,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_ADVERTISING_CONNECTABLE,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_ADVERTISING_NEW,
-#ifndef TIZEN_PROFILE_WEARABLE
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_ADVERTISING,
-#endif
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_ADVERTISING,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ADD_WHITE_LIST,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REMOVE_WHITE_LIST,
-#ifndef TIZEN_PROFILE_WEARABLE
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_CLEAR_WHITE_LIST,
-#endif
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ENABLE_PRIVACY,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REGISTER_SCAN_FILTER_DEVICE_ADDRESS,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REGISTER_SCAN_FILTER_SERVICE_UUID,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REGISTER_SCAN_FILTER_SERVICE_SOLICITATION_UUID,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REGISTER_SCAN_FILTER_IBEACON_DATA,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_UNREGISTER_ALL_SCAN_FILTERS,
-#ifndef TIZEN_PROFILE_WEARABLE
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_DEVICE_DISCOVERY_STATE_CHANGED_CB,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_UNSET_DEVICE_DISCOVERY_STATE_CHANGED_CB,
-#endif
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_READ_MAXIMUM_DATA_LENGTH,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_WRITE_HOST_SUGGESTED_DEFAULT_DATA_LENGTH,
        BT_UNIT_TEST_FUNCTION_ADAPTER_LE_READ_HOST_SUGGESTED_DEFAULT_DATA_LENGTH,
@@ -258,7 +248,6 @@ typedef enum {
        BT_UNIT_TEST_FUNCTION_ANCS_POSITIVE_ACTION,
        BT_UNIT_TEST_FUNCTION_ANCS_NEGATIVE_ACTION,
        BT_UNIT_TEST_FUNCTION_ANCS_GET_NOTI_ATTR,
-#ifdef TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT
        BT_UNIT_TEST_FUNCTION_GATT_FOREACH_PRIMARY_SERVICES,
        BT_UNIT_TEST_FUNCTION_GATT_DISCOVER_CHARACTERISTICS,
        BT_UNIT_TEST_FUNCTION_GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS,
@@ -272,7 +261,6 @@ typedef enum {
        BT_UNIT_TEST_FUNCTION_GATT_READ_CHARACTERISTIC_VALUE,
        BT_UNIT_TEST_FUNCTION_GATT_WATCH_CHARACTERISTIC_CHANGES,
        BT_UNIT_TEST_FUNCTION_GATT_UNWATCH_CHARACTERISTIC_CHANGES,
-#endif
        BT_UNIT_TEST_FUNCTION_HPS_CLIENT_CREATE = 1,
        BT_UNIT_TEST_FUNCTION_HPS_CLIENT_DESTROY,
        BT_UNIT_TEST_FUNCTION_HPS_CLIENT_PRINT_ALL,
@@ -394,7 +382,6 @@ typedef enum {
        BT_UNIT_TEST_FUNCTION_DPM_GET_LIMITED_DISCOVERABLE_STATE,
        BT_UNIT_TEST_FUNCTION_DPM_SET_DATA_TRANSFER_STATE,
        BT_UNIT_TEST_FUNCTION_DPM_GET_DATA_TRANSFER_STATE,
-#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
        BT_UNIT_TEST_FUNCTION_HF_INITIALIZE = 1,
        BT_UNIT_TEST_FUNCTION_HF_DEINITIALIZE,
        BT_UNIT_TEST_FUNCTION_HF_NOTIFY_CALL_ANSWER,
@@ -430,7 +417,6 @@ typedef enum {
        BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_VCARDPULL,
        BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_PHONEBOOKSEARCH,
        BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_VCARDLIST_MAXLIST_ZERO,
-#endif
        BT_UNIT_TEST_FUNCTION_ON_OFF_REPEAT_TEST = 1,
        BT_UNIT_TEST_FUNCTION_ON_OFF_REPEAT_TEST_1_SEC_DELAY,
        BT_UNIT_TEST_FUNCTION_ON_OFF_REPEAT_TEST_N_SEC_DELAY,