Remove the package dependency for bluetooth-api 62/208762/1 tizen_rt
authorDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 28 Jun 2019 04:49:09 +0000 (13:49 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 28 Jun 2019 04:49:09 +0000 (13:49 +0900)
Change-Id: I7e9286b4ebdae8bacf65ff99f411bbc8b1ad9f4c
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
CMakeLists.txt
adaptation/bt-adatation-gatt.c [new file with mode: 0644]
adaptation/include/bt-adaptation-common.h
adaptation/include/bt-adaptation-gatt.h [new file with mode: 0644]
include/bluetooth_private.h
packaging/capi-network-bluetooth.spec
src/bluetooth-audio.c
src/bluetooth-common.c
src/bluetooth-device.c
src/bluetooth-gatt.c
test/bt_unit_test.c

index f4a482f4effff406af77754943cc1109db6ae01f..35b5c0180c513b929ec2f78748758b64d1e691c4 100644 (file)
@@ -11,7 +11,7 @@ SET(ADAPTATION_INC_DIR adaptation/include)
 INCLUDE_DIRECTORIES(${INC_DIR})
 INCLUDE_DIRECTORIES(${ADAPTATION_INC_DIR})
 
-SET(dependents "glib-2.0 bluetooth-api")
+SET(dependents "glib-2.0")
 SET(pc_dependents "glib-2.0")
 
 INCLUDE(FindPkgConfig)
@@ -37,6 +37,7 @@ SET(SOURCES
 adaptation/bt-adatation-common.c
 adaptation/bt-adatation-adapter.c
 adaptation/bt-adatation-device.c
+adaptation/bt-adatation-gatt.c
 src/bluetooth-common.c
 src/bluetooth-adapter.c
 src/bluetooth-device.c
diff --git a/adaptation/bt-adatation-gatt.c b/adaptation/bt-adatation-gatt.c
new file mode 100644 (file)
index 0000000..2720e03
--- /dev/null
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include "bt-adaptation-gatt.h"
+
+#include "bluetooth.h"
+
+/* Need to include BT stack's header in here */
+
+/*******************************
+ *   GATT Common Functions     *
+********************************/
+
+int bt_adapt_gatt_free_svc_property(bt_gatt_svc_prop_t *svc_pty)
+{
+       g_free(svc_pty->uuid);
+       g_free(svc_pty->uuid);
+       g_free(svc_pty->handle);
+       g_strfreev(svc_pty->include_handles.handle);
+       g_strfreev(svc_pty->char_handle.handle);
+
+       memset(svc_pty, 0, sizeof(bt_gatt_svc_prop_t));
+
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_free_char_property(bt_gatt_char_prop_t *char_pty)
+{
+       g_free(char_pty->uuid);
+       g_free(char_pty->name);
+       g_free(char_pty->description);
+       g_free(char_pty->val);
+       g_free(char_pty->handle);
+       g_strfreev(char_pty->char_desc_handle.handle);
+
+       memset(char_pty, 0, sizeof(bt_gatt_char_prop_t));
+
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_free_desc_property(bt_gatt_char_desc_prop_t *desc_pty)
+{
+       g_free(desc_pty->uuid);
+       g_free(desc_pty->val);
+       g_free(desc_pty->handle);
+
+       memset(desc_pty, 0, sizeof(bt_gatt_char_desc_prop_t));
+
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_connect(const char *address, bool auto_connect, int client_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_disconnect(const char *address, int client_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+
+/*******************************
+ *   GATT Client Functions     *
+********************************/
+
+
+int bt_adapt_gatt_client_init(const char *address, int *client_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_deinit(       int client_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_get_primary_services(
+               const char *address, /* Remote GATT Server */
+               bt_gatt_handle_info_t *prim_svc) /* UUID & instance_id */
+{
+
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_get_svc_property(const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_svc_prop_t *service)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_get_char_property(const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle,
+               bt_gatt_char_prop_t *char_property)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_get_char_desc_property(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle,
+               bt_gatt_handle_prop_t *descriptor_handle,
+               bt_gatt_char_desc_prop_t *desc_prop)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_watch_char(
+                       const char *address,
+                       bt_gatt_handle_prop_t *service_handle,
+                       bt_gatt_handle_prop_t *char_handle,
+                       int client_id,
+                       bool is_notify,
+                       bool is_indicate)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_unwatch_char(
+                       const char *address,
+                       bt_gatt_handle_prop_t *service_handle,
+                       bt_gatt_handle_prop_t *char_handle,
+                       int client_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_read_char_value(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_read_desc_value(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle,
+               bt_gatt_handle_prop_t *descriptor_handle)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_write_char_value_by_type(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle,
+               bt_gatt_att_data_t *data,
+               bt_gatt_write_type_e  write_type)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_write_desc_value(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle,
+               bt_gatt_handle_prop_t *descriptor_handle,
+               bt_gatt_att_data_t *data,
+               bt_gatt_write_type_e  write_type)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_client_set_service_change_watcher(
+               const char *address, bool enable)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+
+/*******************************
+ *   GATT Server Functions     *
+********************************/
+
+int bt_adapt_gatt_server_init(int *instance_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_deinit(void)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_register(int instance_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_unregister(int instance_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_add_service(const char *svc_uuid, int type, int numhandles, int instance_id, int *service_handle)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_add_included_service(int instance_id, int service_handle, int included_handle)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_add_new_char(const char *char_uuid,
+               bt_gatt_permission_e permissions, int properties,
+               int service_handle, int instance_id, int *char_handle)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_add_desc(const char *desc_uuid,
+               bt_gatt_permission_e permissions, int service_handle,
+               int instance_id, int *descriptor_handle)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_start_service(int service_handle, int instance_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_stop_service(int service_handle, int instance_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_delete_service(int service_handle, int instance_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_send_indication(const char *address,
+               int atrribute_handle,
+               bool need_confirmation,
+               int instance_id,
+               const bt_gatt_att_data_t *att_value)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_send_response(bt_gatt_att_request_type_e req_type,
+               int request_id,
+               int response_status,
+               bool auth_req,
+               const bt_gatt_att_data_t *value)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_update_multi_adv_instance(const char *unique_name, int instance_id)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
+int bt_adapt_gatt_server_update_char(int instance_id,
+               int attribute_handle,
+               const char *value,
+               int length)
+{
+       /* To be implemented */
+       return BT_ERROR_NONE;
+}
+
index b654f777b61b2b9586a628638d8cba90a2f31c2b..eeb273bb335d9d8e0c4af3ef52243132e4054a60 100644 (file)
@@ -28,6 +28,7 @@ extern "C"
 
 #define BT_UUID_STR_MAX 50
 #define BT_ADDR_STR_MAX 18
+#define BT_ADDR_HEX_LEN 6
 
 int bt_adapt_init(void);
 
diff --git a/adaptation/include/bt-adaptation-gatt.h b/adaptation/include/bt-adaptation-gatt.h
new file mode 100644 (file)
index 0000000..d3367c8
--- /dev/null
@@ -0,0 +1,420 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __BT_ADAPTATION_GATT_H__
+#define __BT_ADAPTATION_GATT_H__
+
+#include "bt-adaptation-common.h"
+
+#include "bluetooth_type.h"
+#include "bluetooth_type_internal.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define BT_GATT_SERVICES_MAX 40 /**< This specifies maximum number of services
+                                                       a device can support */
+
+#define BT_ATT_DATA_MAX 610 /**< GATT ATT value max len */
+
+#define BT_UUID_HEX_MAX 16 /**< UUID complete len in hex */
+
+typedef enum {
+       BT_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01,
+       BT_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02,
+} bt_gatt_svc_change_type_t;
+
+/**
+ * GATT Server Response/Indication data
+ */
+typedef struct {
+       guint8 data[BT_ATT_DATA_MAX];
+       int length;
+       int offset;
+} bt_gatt_att_data_t;
+
+/**
+ * Structure to GATT attribute handle data
+ */
+typedef struct {
+       int count;
+       char **handle;
+       char uuids[BT_GATT_SERVICES_MAX][BT_UUID_STR_MAX];
+       int inst_id[BT_GATT_SERVICES_MAX];
+} bt_gatt_handle_info_t;
+
+/**
+ * Structure to a most basic GATT attribute handle data
+ */
+typedef struct {
+       int instance_id;
+       unsigned char uuid[BT_UUID_HEX_MAX];
+       char address[BT_ADDR_STR_MAX];
+} bt_gatt_handle_prop_t;
+
+/**
+ * Structure to GATT Remote service data
+ */
+
+typedef struct {
+       char *uuid;
+       char *handle;
+       gboolean primary;
+       bt_gatt_handle_info_t include_handles;
+       bt_gatt_handle_info_t char_handle;
+       bt_gatt_handle_prop_t prop; /* Added Service UUID, instance_id & associated remote device  */
+} bt_gatt_svc_prop_t;
+
+/**
+ * Structure to GATT Remote characteristic data
+ */
+
+typedef struct {
+       char *service_handle;
+       bt_gatt_handle_info_t handle_info;
+} bt_gatt_discovered_char_t;
+
+/**
+ * Structure to format of GATT Characteristic Value
+ */
+
+typedef struct {
+       unsigned char format;
+       unsigned char exponent;
+       unsigned short unit;
+       unsigned char name_space;
+       unsigned short description;
+} bt_gatt_char_format_t;
+
+/**
+ * Structure to GATT Characteristic property
+ */
+
+typedef struct {
+       char *handle;
+       char *uuid;
+       char *name;
+       char *description;
+       bt_gatt_char_format_t format;
+       unsigned char *val;
+       unsigned int val_len;
+       unsigned int permission;
+       char *representation;
+       bt_gatt_handle_info_t char_desc_handle;
+       bt_gatt_handle_prop_t prop;      /* Added Char UUID, instance_id */
+       bt_gatt_handle_prop_t svc_prop;  /* Added Service UUID, instance_id */
+       char value[BT_ATT_DATA_MAX]; /* Added */
+       char address[BT_ADDR_STR_MAX];         /* Added */
+} bt_gatt_char_prop_t;
+
+/**
+ * Structure to GATT Characteristic descriptor property
+ */
+
+typedef struct {
+       char *handle;
+       char *uuid;
+       unsigned char *val;
+       unsigned int val_len;
+       bt_gatt_handle_prop_t prop;      /* Added Descriptor UUID, instance_id */
+       bt_gatt_handle_prop_t char_prop; /* Added Char UUID, instance_id */
+       bt_gatt_handle_prop_t svc_prop;  /* Added Service UUID, instance_id */
+       char value[BT_ATT_DATA_MAX];/* Added */
+       char address[BT_ADDR_STR_MAX];          /* Added */
+} bt_gatt_char_desc_prop_t;
+
+/**
+ * Structure to GATT Characteristic value
+ */
+
+typedef struct {
+       char *char_handle;
+       guint8 *char_value;
+       guint32 val_len;
+} bt_gatt_char_value_t;
+
+typedef struct {
+       unsigned char UUID[BT_UUID_HEX_MAX];
+       char address[BT_ADDR_STR_MAX];
+       char *val;
+       int len;
+} bt_gatt_notify_req_t ;
+
+/**
+ * Structure to GATT Read Request
+ */
+typedef struct {
+       char *att_handle;
+       char *service_handle;
+       char *address;
+       guint16 offset;
+       guint req_id;
+} bt_gatt_read_req_t;
+
+/**
+ * Structure to GATT Value change
+ */
+typedef struct {
+       char *att_handle;
+       char *service_handle;
+       char *address;
+       guint req_id;
+       gboolean response_needed;
+       guint16 offset;
+       guint8 *att_value;
+       guint32 val_len;
+} bt_gatt_value_change_t;
+
+typedef struct {
+       char address[BT_ADDR_STR_MAX];
+       char *svc_path;
+       bt_gatt_svc_change_type_t change_type;
+} bt_gatt_svc_change_t;
+
+/**
+ * Structure to GATT characteristc Notification change
+ */
+typedef struct {
+       char *att_handle;
+       char *service_handle;
+       gboolean att_notify;
+} bt_gatt_char_notify_change_t;
+
+/**
+ * Structure to Indication confirmation
+ */
+typedef struct {
+       char *att_handle;
+       char *service_handle;
+       char *address;
+       gboolean complete;
+} bt_gatt_indicate_confirm_t;
+
+/**
+ * Structure for GATT response data
+ */
+typedef struct {
+       char *handle;
+       guint8 *value;
+       guint32 len;
+       gpointer user_data;
+} bt_gatt_resp_data_t;
+
+typedef struct {
+       char address[BT_ADDR_STR_MAX];
+       int count;
+       char uuids[BT_GATT_SERVICES_MAX][BT_UUID_STR_MAX];
+       int inst_id[BT_GATT_SERVICES_MAX];
+       int primary[BT_GATT_SERVICES_MAX];
+} bt_gatt_svc_browse_info_t;
+
+/* Structure used for browsing a particular service's properties(chars and Incldued svcs) */
+typedef struct {
+       char address[BT_ADDR_STR_MAX];
+       bt_gatt_handle_prop_t svc;
+} bt_gatt_svc_prop_info_t;
+
+typedef struct {
+       char address[BT_ADDR_STR_MAX];
+       int count;
+       unsigned char svc_uuid[BT_UUID_HEX_MAX];
+       int svc_inst_id;
+       char uuids[BT_GATT_SERVICES_MAX][BT_UUID_STR_MAX];
+       int inst_id[BT_GATT_SERVICES_MAX];
+       int props[BT_GATT_SERVICES_MAX];
+} bt_gatt_char_info_t;
+
+typedef struct {
+       char address[BT_ADDR_STR_MAX];
+       int count;
+       unsigned char svc_uuid[BT_UUID_HEX_MAX];
+       int svc_inst_id;
+       char uuids[BT_GATT_SERVICES_MAX][BT_UUID_STR_MAX];
+       int inst_id[BT_GATT_SERVICES_MAX];
+} bt_gatt_included_svc_info_t;
+
+typedef struct {
+       char address[BT_ADDR_STR_MAX];
+       int count;
+       unsigned char svc_uuid[BT_UUID_HEX_MAX];
+       int svc_inst_id;
+       unsigned char char_uuid[BT_UUID_HEX_MAX];
+       int char_inst_id;
+       int char_props_map;
+       char uuids[BT_GATT_SERVICES_MAX][BT_UUID_STR_MAX];
+       int inst_id[BT_GATT_SERVICES_MAX];
+} bt_gatt_desc_info_t;
+
+/* Structure used for browsing a particular charactertic's properties(descriptors)  or reading char's value */
+typedef struct {
+       char address[BT_ADDR_STR_MAX];
+       bt_gatt_handle_prop_t svc;
+       bt_gatt_handle_prop_t characteristic;
+} bt_gatt_char_prop_info_t;
+
+/* Structure used for reading Descriptor's value */
+typedef struct {
+       char address[BT_ADDR_STR_MAX];
+       bt_gatt_handle_prop_t svc;
+       bt_gatt_handle_prop_t characteristic;
+       bt_gatt_handle_prop_t descriptor;
+} bt_gatt_desc_prop_info_t;
+
+
+/*******************************
+ * GATT Common Function Header *
+********************************/
+
+int bt_adapt_gatt_free_svc_property(bt_gatt_svc_prop_t *svc_pty);
+
+int bt_adapt_gatt_free_char_property(bt_gatt_char_prop_t *char_pty);
+
+int bt_adapt_gatt_free_desc_property(bt_gatt_char_desc_prop_t *desc_pty);
+
+int bt_adapt_gatt_connect(const char *address, bool auto_connect, int client_id);
+
+int bt_adapt_gatt_disconnect(const char *address, int client_id);
+
+/*******************************
+ * GATT Client Function Header *
+********************************/
+
+int bt_adapt_gatt_client_init(const char *address, int *client_id);
+
+int bt_adapt_gatt_client_deinit(       int client_id);
+
+int bt_adapt_gatt_client_get_primary_services(
+               const char *address, /* Remote GATT Server */
+               bt_gatt_handle_info_t *prim_svc); /* UUID & instance_id */
+
+int bt_adapt_gatt_client_get_svc_property(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_svc_prop_t *service);
+
+int bt_adapt_gatt_client_get_char_property(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle,
+               bt_gatt_char_prop_t *char_property);
+
+int bt_adapt_gatt_client_get_char_desc_property(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle,
+               bt_gatt_handle_prop_t *descriptor_handle,
+               bt_gatt_char_desc_prop_t *desc_prop);
+
+int bt_adapt_gatt_client_watch_char(
+                       const char *address,
+                       bt_gatt_handle_prop_t *service_handle,
+                       bt_gatt_handle_prop_t *char_handle,
+                       int client_id,
+                       bool is_notify,
+                       bool is_indicate);
+
+int bt_adapt_gatt_client_unwatch_char(
+                       const char *address,
+                       bt_gatt_handle_prop_t *service_handle,
+                       bt_gatt_handle_prop_t *char_handle,
+                       int client_id);
+
+int bt_adapt_gatt_client_read_char_value(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle);
+
+int bt_adapt_gatt_client_read_desc_value(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle,
+               bt_gatt_handle_prop_t *descriptor_handle);
+
+int bt_adapt_gatt_client_write_char_value_by_type(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle,
+               bt_gatt_att_data_t *data,
+               bt_gatt_write_type_e  write_type);
+
+int bt_adapt_gatt_client_write_desc_value(
+               const char *address,
+               bt_gatt_handle_prop_t *service_handle,
+               bt_gatt_handle_prop_t *char_handle,
+               bt_gatt_handle_prop_t *descriptor_handle,
+               bt_gatt_att_data_t *data,
+               bt_gatt_write_type_e  write_type);
+
+int bt_adapt_gatt_client_set_service_change_watcher(
+               const char *address, bool enable);
+
+/*******************************
+ * GATT Server Function Header *
+********************************/
+
+int bt_adapt_gatt_server_init(int *instance_id);
+
+int bt_adapt_gatt_server_deinit(void);
+
+int bt_adapt_gatt_server_register(int instance_id);
+
+int bt_adapt_gatt_server_unregister(int instance_id);
+
+int bt_adapt_gatt_server_add_service(const char *svc_uuid, int type, int numhandles, int instance_id, int *service_handle);
+
+int bt_adapt_gatt_server_add_included_service(int instance_id, int service_handle, int included_handle);
+
+int bt_adapt_gatt_server_add_new_char(const char *char_uuid,
+               bt_gatt_permission_e permissions, int properties,
+               int service_handle, int instance_id, int *char_handle);
+
+int bt_adapt_gatt_server_add_desc(const char *desc_uuid,
+               bt_gatt_permission_e permissions, int service_handle,
+               int instance_id, int *descriptor_handle);
+
+int bt_adapt_gatt_server_start_service(int service_handle, int instance_id);
+
+int bt_adapt_gatt_server_stop_service(int service_handle, int instance_id);
+
+int bt_adapt_gatt_server_delete_service(int service_handle, int instance_id);
+
+int bt_adapt_gatt_server_send_indication(const char *address,
+               int atrribute_handle,
+               bool need_confirmation,
+               int instance_id,
+               const bt_gatt_att_data_t *att_value);
+
+int bt_adapt_gatt_server_send_response(bt_gatt_att_request_type_e req_type,
+               int request_id,
+               int response_status,
+               bool auth_req,
+               const bt_gatt_att_data_t *value);
+
+int bt_adapt_gatt_server_update_multi_adv_instance(const char *unique_name, int instance_id);
+
+int bt_adapt_gatt_server_update_char(int instance_id,
+               int attribute_handle,
+               const char *value,
+               int length);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __BT_ADAPTATION_GATT_H__ */
index 0de81e42e262d38a31915a38210358c3145065c7..9f616504d9a4f19b24222479deb9d12466e78811 100644 (file)
 #ifndef __TIZEN_NETWORK_BLUETOOTH_PRIVATE_H__
 #define __TIZEN_NETWORK_BLUETOOTH_PRIVATE_H__
 
-#include <dlog.h>
 #include <stdbool.h>
 #include <stdio.h>
-#include <bluetooth-api.h>
-#include <bluetooth-audio-api.h>
-#include <bluetooth-telephony-api.h>
-#include <bluetooth-media-control.h>
-#include <bluetooth-hid-api.h>
-#include <bluetooth-ipsp-api.h>
-
-#ifdef TIZEN_FEATURE_GATT_RELAY
-#include <bluetooth-gatt-server-api.h>
-#endif
 
-#ifdef TIZEN_GATT_CLIENT
-#include <bluetooth-gatt-client-api.h>
-#endif
+#include "bt-adaptation-common.h"
+#include "bt-adaptation-adapter.h"
+#include "bt-adaptation-device.h"
+#include "bt-adaptation-gatt.h"
 
 #include "bluetooth.h"
 #include "bluetooth_internal.h"
@@ -52,17 +42,6 @@ extern "C" {
 #define BT_DBG(fmt, args...) BT_PRT(fmt"\n", ##args)
 #define BT_ERR(fmt, args...) BT_PRT(fmt"\n", ##args)
 
-#define OPP_UUID "00001105-0000-1000-8000-00805f9b34fb"
-#define MAP_UUID "00001134-0000-1000-8000-00805f9b34fb"
-
-/* Manufacture ID for Apple iBeacons */
-#define COMPANY_ID_APPLE 0x004C
-
-/* Priximity Services UUID */
-#define PXP_IMMEDIATE_ALERT_SVC_UUID   "1802"
-#define PXP_LINK_LOSS_SVC_UUID         "1803"
-#define PXP_TX_POWER_SVC_UUID          "1804"
-
 /**
  * @internal
  * @brief Bluetooth callback.
@@ -334,9 +313,7 @@ typedef struct {
        bt_gatt_client_service_changed_cb service_changed_cb;
        void *service_changed_user_data;
        void *att_mtu_changed_user_data;
-#ifdef TIZEN_GATT_CLIENT
        int client_id;
-#endif
 } bt_gatt_client_s;
 
 typedef struct {
@@ -345,9 +322,7 @@ typedef struct {
        void *parent;
        char *path;
        char *uuid;
-#ifdef TIZEN_FEATURE_GATT_RELAY
        int handle;
-#endif
 } bt_gatt_common_s;
 
 typedef struct {
@@ -356,10 +331,9 @@ typedef struct {
        void *parent;
        char *path;
        char *uuid;
-#ifdef TIZEN_FEATURE_GATT_RELAY
        int handle;
        int numhandles;
-#endif
+
        bool is_included_service;
 
        bt_gatt_service_type_e service_type;
@@ -367,11 +341,10 @@ typedef struct {
        GSList *included_services;
        GSList *characteristics;
 
-#ifdef TIZEN_GATT_CLIENT
        int instance_id;  /* Instance ID of the service object */
        bt_gatt_handle_info_t svc_include_handles;
        bt_gatt_handle_info_t charc_handles;
-#endif
+
        char **include_handles;
        char **char_handles;
 } bt_gatt_service_s;
@@ -382,20 +355,18 @@ typedef struct {
        void *parent;
        char *path;
        char *uuid;
-#ifdef TIZEN_FEATURE_GATT_RELAY
        int handle;
-        bluetooth_device_address_t address;
-#endif
+       unsigned char addr[BT_ADDR_HEX_LEN];
+
        int permissions;
        int properties;
        bt_gatt_write_type_e write_type;
 
        GSList *descriptors;
 
-#ifdef TIZEN_GATT_CLIENT
        int instance_id;  /* Instance ID of the characteristic object */
        bt_gatt_handle_info_t descriptor_handles;
-#endif
+
        char **desc_handles;
 
        bt_gatt_client_characteristic_value_changed_cb value_changed_cb;
@@ -415,13 +386,11 @@ typedef struct {
 
        int value_length;
        char *value;
-#ifdef TIZEN_GATT_CLIENT
        bt_gatt_client_request_completed_cb read_cb;
        void *read_user_data;
 
        bt_gatt_client_request_completed_cb write_cb;
        void *write_user_data;
-#endif
 } bt_gatt_characteristic_s;
 
 typedef struct {
@@ -430,12 +399,9 @@ typedef struct {
        void *parent;
        char *path;
        char *uuid;
-#ifdef TIZEN_FEATURE_GATT_RELAY
        int handle;
-#endif
-#ifdef TIZEN_GATT_CLIENT
+
        int instance_id;  /* Instance ID of the descriptor object */
-#endif
        int permissions;
 
        bt_gatt_server_write_value_requested_cb write_value_requested_cb;
@@ -446,13 +412,11 @@ typedef struct {
 
        int value_length;
        char *value;
-#ifdef TIZEN_GATT_CLIENT
        bt_gatt_client_request_completed_cb read_cb;
        void *read_user_data;
 
        bt_gatt_client_request_completed_cb write_cb;
        void *write_user_data;
-#endif
 } bt_gatt_descriptor_s;
 
 typedef struct {
@@ -467,60 +431,9 @@ typedef struct {
        bt_gatt_client_request_completed_cb cb;
 } bt_gatt_client_cb_data_s;
 
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
- * @brief  Called when RSSI monitoring is enabled.
- * @since_tizen 3.0
- *
- * @param[in] remote_address Remote Device address
- * @param[in] link_type Link type for the connection (@c 0 = BR/EDR link, @c 1 = LE link).
- * @param[in] rssi_enabled RSSI monitoring status (@c 1 = enabled, @c 0 = disabled)
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_device_enable_rssi_monitor()
- * @see bt_device_disable_rssi_monitor()
- */
-typedef void (*bt_rssi_monitor_enabled_cb)(const char *remote_address,
-               bt_device_connection_link_type_e link_type,
-               int rssi_enabled, void *user_data);
-
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
- * @brief  Called when RSSI Alert is received.
- * @since_tizen 3.0
- *
- * @param[in] remote_address Remote Device address
- * @param[in] link_type Link type for the connection (@c 0 = BR/EDR link, @c 1 = LE link).
- * @param[in] rssi_alert_type RSSI Alert type (@c 1 = High Alert (In-Range Alert), @c 2 = Low Alert)
- * @param[in] rssi_alert_dbm RSSI Alert signal strength value
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_device_enable_rssi_monitor()
- * @see bt_device_disable_rssi_monitor()
- */
-typedef void (*bt_rssi_alert_cb)(char *bt_address,
-               bt_device_connection_link_type_e link_type,
-               int rssi_alert_type, int rssi_alert_dbm, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
- * @brief  Called when Raw RSSI signal strength is received.
- * @since_tizen 3.0
- *
- * @param[in] remote_address Remote Device address
- * @param[in] link_type Link type for the connection (@c 0 = BR/EDR link, @c 1 = LE link).
- * @param[in] rssi_dbm Raw RSSI signal strength value
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_device_get_rssi_strength()
- */
-typedef void (*bt_rssi_strength_cb)(char *bt_address,
-               bt_device_connection_link_type_e link_type,
-               int rssi_dbm, void *user_data);
-
-
 typedef void (*_bt_gatt_client_value_changed_cb)(char *char_path,
                unsigned char *value, int value_length, void *user_data);
 
-#ifdef TIZEN_GATT_CLIENT
 typedef void (*_bt_gatt_client_val_changed_cb)(unsigned char *uuid, char *remote_address,
                char *value, int value_length, void *user_data);
 
@@ -535,7 +448,6 @@ void _bt_handle_gatt_client_char_write_completed_event(int result,
 
 void _bt_handle_gatt_client_desc_write_completed_event(int result,
                void *resp);
-#endif
 
 /**
  * @internal
@@ -556,19 +468,19 @@ typedef void (*bt_adapter_passkey_notification_cb)(const char *remote_address, c
 
 #define BT_CHECK_INPUT_PARAMETER(arg) \
        if (arg == NULL) { \
-               LOGE("[%s] INVALID_PARAMETER(0%s=NULL)", __FUNCTION__, #arg); \
+               BT_PRT("INVALID_PARAMETER(0%s=NULL)", #arg); \
                return BT_ERROR_INVALID_PARAMETER; \
        }
 
 #define BT_CHECK_INPUT_PARAMETER_UINT(arg) \
        if (arg < -1) { \
-               LOGE("[%s] INVALID_PARAMETER_UINT(%s=%d)", __FUNCTION__, #arg, arg); \
+               BT_PRT("INVALID_PARAMETER_UINT(%s=%d)", #arg, arg); \
                return BT_ERROR_INVALID_PARAMETER; \
        }
 
 #define BT_CHECK_INPUT_PARAMETER_BOOL(arg) \
        if (arg < -1 || arg > 1) { \
-               LOGE("[%s] INVALID_PARAMETER_BOOL(%s=%d)", __FUNCTION__, #arg, arg); \
+               BT_PRT("INVALID_PARAMETER_BOOL(%s=%d)", #arg, arg); \
                return BT_ERROR_INVALID_PARAMETER; \
        }
 
@@ -602,13 +514,13 @@ int _bt_check_init_status(void);
 
 #define BT_CHECK_INIT_STATUS() \
        if (_bt_check_init_status() == BT_ERROR_NOT_INITIALIZED) { \
-               LOGE("[%s] NOT_INITIALIZED(0x%08x)", __FUNCTION__, BT_ERROR_NOT_INITIALIZED); \
+               BT_PRT("NOT_INITIALIZED(0x%08x)", BT_ERROR_NOT_INITIALIZED); \
                return BT_ERROR_NOT_INITIALIZED; \
        }
 
 #define BT_CHECK_ADAPTER_STATUS() \
        if (bluetooth_check_adapter() == BLUETOOTH_ADAPTER_DISABLED) { \
-               LOGE("[%s] BT_ERROR_NOT_ENABLED(0x%08x)", __FUNCTION__, BT_ERROR_NOT_ENABLED); \
+               BT_PRT("BT_ERROR_NOT_ENABLED(0x%08x)", BT_ERROR_NOT_ENABLED); \
                return BT_ERROR_NOT_ENABLED; \
        }
 
@@ -648,14 +560,6 @@ bool _bt_check_cb(int events);
  */
 int _bt_get_error_code(int origin_error);
 
-
-/**
- * @internal
- * @brief Convert Bluetooth F/W bluetooth_device_info_t to capi bt_device_info_s.
- */
-int _bt_get_bt_device_info_s(bt_device_info_s **dest_dev, bluetooth_device_info_t *source_dev);
-
-
 /**
  * @internal
  * @brief Filter Advertising data based on AD type.
@@ -673,14 +577,14 @@ void _bt_free_bt_device_info_s(bt_device_info_s *device_info);
  * @internal
  * @brief Convert Bluetooth F/W bluetooth_device_address_t to string.
  */
-int _bt_convert_address_to_string(char **addr_str, bluetooth_device_address_t *addr_hex);
+int _bt_convert_address_to_string(char **addr_str, unsigned char *addr);
 
 
 /**
  * @internal
  * @brief Convert string to Bluetooth F/W bluetooth_device_address_t.
  */
-void _bt_convert_address_to_hex(bluetooth_device_address_t *addr_hex, const char *addr_str);
+void _bt_convert_address_to_hex(unsigned char **addr, const char *addr_str);
 
 void _handle_gatt_client_read_completed_event(int result, bt_gatt_resp_data_t *resp);
 
@@ -699,81 +603,6 @@ char *_bt_convert_error_to_string(int error);
  */
 char* _bt_convert_uuid_to_uuid128(const char *uuid);
 
-/**
- * @internal
- * @brief Convert the visibility mode
- */
-bt_adapter_visibility_mode_e _bt_get_bt_visibility_mode_e(bluetooth_discoverable_mode_t mode);
-
-/**
- * @internal
- * @brief Since the Audio call back and event proxy call backs have different prototype it is wrapper function.
- */
-void _bt_audio_event_proxy(int event, bt_audio_event_param_t *param, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE
- * @brief  Enumerations for the device state event from Audio-Gateway device
- * @since_tizen 3.0
- */
-typedef enum {
-       BT_HF_REMOTE_DEVICE_STATE_BATTERY_LEVEL = 0x00,  /**< Battery charge level of AG (ranges from 0 to 5) */
-       BT_HF_REMOTE_DEVICE_STATE_SIGNAL_STRENGTH,  /**< Signal strength level of AG (ranges from 0 to 5) */
-       BT_HF_REMOTE_DEVICE_STATE_NETWORK_SERVICE,  /**< Network service availability (0:no service , 1:available) */
-       BT_HF_REMOTE_DEVICE_STATE_VOICE_RECOGNITON,  /**< Voice Recognition State (0:disabled , 1:enabled) */
-} bt_hf_remote_device_state_e;
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE
- * @brief  Called when a device status changed event happend from Audio-Gateway device
- * @since_tizen 3.0
- *
- * @param[in] event The device state chagned event from remote Audio-Gateway device
- * @param[in] value The new values to be changed.
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see bt_hf_set_remote_device_state_changed_cb()
- * @see bt_hf_unset_remote_device_state_changed_cb()
- */
-typedef void (*bt_hf_remote_device_state_changed_cb) (bt_hf_remote_device_state_e state, int value, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE
- * @brief  Called when a vendor command event happened from Hands-Free.
- * @since_tizen 2.3.2
- * @remarks The @a meesage of cmd must be released with free() by you.
- *
- * @param[in] cmd  The information of vendor command
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_hf_set_vendor_dep_cmd_event_cb()
- * @see bt_hf_unset_vendor_dep_cmd_event_cb()
- */
-typedef void (*bt_hf_vendor_dep_cmd_event_cb) (bt_hf_vendor_dep_at_cmd_s cmd, void *user_data);
-
-/**
- * @internal
- * @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);
-
-/**
- * @internal
- * @brief Since the Telephony call back and event proxy call backs have different prototype it is wrapper function.
- */
-void _bt_telephony_event_proxy(int event, telephony_event_param_t *param, void *user_data);
-
-/**
- * @internal
- * @brief Since the AVRCP call back and event proxy call backs have different prototype it is wrapper function.
- */
-void _bt_avrcp_event_proxy(int event, media_event_param_t *param, void *user_data);
-
-/**
- * @internal
- * @brief Since the HID call back and event proxy call backs have different prototype it is wrapper function.
- */
-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);
 
 bool _bt_gatt_is_legacy_client_mode(void);
@@ -782,12 +611,8 @@ bt_gatt_client_h _bt_gatt_get_client(const char *remote_addr);
 
 const GSList* _bt_gatt_get_server_list(void);
 
-#ifdef TIZEN_GATT_CLIENT
 bt_gatt_h _bt_gatt_client_add_service(bt_gatt_client_h client,
                                const char *uuid, int instance_id);
-#else
-bt_gatt_h _bt_gatt_client_add_service(bt_gatt_client_h client, const char *path);
-#endif
 
 int _bt_gatt_client_update_services(bt_gatt_client_h client);
 
@@ -797,192 +622,6 @@ int _bt_gatt_client_update_characteristics(bt_gatt_h service);
 
 int _bt_gatt_client_update_descriptors(bt_gatt_h characteristic);
 
-#ifdef TIZEN_FEATURE_GATT_RELAY
-/**
- * @internal
- * @brief Since the GATT Server call back and event proxy call backs have different prototype it is wrapper function.
- */
-void _bt_gatt_server_event_proxy(int event, gatt_server_event_param_t *param, void *user_data);
-#endif
-
-
-#ifdef TIZEN_GATT_CLIENT
-void _bt_gatt_client_event_proxy(int event,
-               gatt_client_event_param_t *param, void *user_data);
-#endif
-
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_LE_MODULE
- * @brief Reads the maximum data length of LE packets supported by the controller.
- * @since_tizen 3.0
- *
- * @retval #BT_ERROR_NONE  Successful
- * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
- * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
- *
- * @see bt_initialize
- */
-int bt_adapter_le_read_maximum_data_length(
-               int *max_tx_octets, int *max_tx_time,
-               int *max_rx_octets, int *max_rx_time);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_LE_MODULE
- * @brief Writes the Host suggested default data length of LE packets to the controller.
- * @since_tizen 3.0
- *
- * @retval #BT_ERROR_NONE  Successful
- * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
- * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
- *
- * @see bt_initialize
- */
-int bt_adapter_le_write_host_suggested_default_data_length(
-       const unsigned int def_tx_Octets,  const unsigned int def_tx_Time);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_LE_MODULE
- * @brief Reads the Host suggested data length values of LE packets from the controller.
- * @since_tizen 3.0
- *
- * @retval #BT_ERROR_NONE  Successful
- * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
- * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
- *
- * @see bt_initialize
- */
-int bt_adapter_le_read_suggested_default_data_length(
-       unsigned int *def_tx_Octets,  unsigned int *def_tx_Time);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_LE_MODULE
- * @brief Allows the host to suggest to controller, the data length parameters to be used
- * for a given LE Connection.
- * @since_tizen 3.0
- *
- * @retval #BT_ERROR_NONE  Successful
- * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
- * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
- *
- * @see bt_initialize
- */
-int bt_device_le_set_data_length(const char *remote_address,
-       unsigned int max_tx_Octets,  unsigned int max_tx_Time);
-
-/**
- * @internal
- * @brief LE data length changed callback
- */
-typedef void (*_bt_le_set_data_length_changed_cb)
-               (int result, const char *remote_address, int max_tx_octets,
-               int max_tx_time, int max_rx_octets, int max_rx_time, void *user_data);
-
-int bt_device_le_set_data_length_change_cb(
-       _bt_le_set_data_length_changed_cb callback, void *user_data);
-
-/**
- * @internal
- * @brief Reads if the Proximity profile is registered or not.
- */
-int _bt_check_proximity_is_initialized(bool *is_initialized);
-
-/**
- * @internal
- * @brief Calls the connection state changed callback for proximity profile.
- */
-int _bt_proximity_connection_set_state_changed(int result, const char *remote_address, bool connected);
-
-/**
- * @internal
- * @brief Send GATT connection state changed status with remote TDS provider.
- */
-void _bt_tds_update_seeker_connection_state_changed(int result, const char *remote_address, bool connected);
-
-/**
- * @internal
- * @brief Send GATT connection state changed status with remote HRP collector.
- */
-void __bt_hrp_le_connection_state_changed_cb(int result, const char *remote_address, bool connected);
-
-/**
- * @internal
- * @brief  Parses TDS AD Type data recived in scan, to extract meaningful transport specific data.
- */
-int _bt_tds_parse_transport_blocks(bt_tds_transport_block_list_s **info, char *data, int data_len);
-
-/**
- * @internal
- * @brief  Handles complete TDS specific data to be sent to application.
- */
-void _bt_tds_send_complete_transport_data(int result, const char *address, char *data, int data_len);
-
-/**
- * @internal
- * @brief Send Result of TDS specific CCCD enabled event of Remote TDS provider.
- */
-void _bt_tds_control_point_enabled_update(int result, const char *remote_address);
-
-/**
- * @internal
- * @brief Send Result of TDS control point activate ACK event.
- */
-void _bt_tds_control_point_activation_result_update(int result, const char *remote_address);
-
-/**
- * @internal
- * @brief Send TDS Indication response from remote TDS provider.
- */
-void _bt_tds_control_point_indication_response_update(const char *address, bluetooth_tds_indication_res_t *info);
-
-/**
- * @internal
- * @brief Sends GATT primary service status changed of Remote Provider.
- */
-void _bt_tds_check_service_changed(char *address, bt_gatt_service_change_t *service_change);
-
-/**
- * @internal
- * @brief Send GATT connection state changed status with remote OTP Server.
- */
-void _bt_otp_client_connection_state_changed(int result, const char *remote_address, bool connected);
-
-/**
- * @internal
- * @brief Send GATT Read Response status got from remote OTP Server.
- */
-void _bt_otp_client_read_value_response(int result, char *char_path,
-                                                                       char *char_value, int val_len);
-
-/**
- * @internal
- * @brief Send GATT Write Response status got from remote OTP Server.
- */
-void _bt_otp_client_write_value_response(int result, char *handle);
-
-/**
- * @internal
- * @brief Send GATT Notification Enabled Response status got from remote OTP Server.
- */
-void _bt_otp_client_notification_enabled(int result, char *handle);
-
-/**
- * @internal
- * @brief Send GATT Indicate Response status got from remote OTP Server.
- */
-void _bt_otp_client_indication(int result, bluetooth_otp_resp_info_t *info);
-
-/**
- * @internal
- * @brief Send OTC connection status to application.
- */
-void _bt_otc_connection_state_changed(int result, bluetooth_otc_info_t *otc_info);
-
-/**
- * @internal
- * @brief Sends GATT primary service status changed of Remote Server.
- */
-void _bt_otp_check_service_changed(char *address, bt_gatt_service_change_t *service_change);
 
 #ifdef __cplusplus
 }
index a41436bd6cf137c8837df6bfb80aa002723b016b..d2453654b6565580b18a29324d5c728e87f79e58 100644 (file)
@@ -11,7 +11,6 @@ Source1002:   %{name}-devel.manifest
 #Requires(postun): /sbin/ldconfig
 
 BuildRequires:  pkgconfig(glib-2.0)
-BuildRequires:  pkgconfig(bluetooth-api)
 BuildRequires:  cmake
 
 %description
index be1743c172acbc9b3f8c5c734b79fb6385e667fc..225eb6f6dbcb546adc9b67d54a6d70b8335a50c9 100644 (file)
@@ -258,16 +258,6 @@ int bt_hf_notify_voice_recognition_state(bool state)
        return BT_ERROR_NOT_SUPPORTED;
 }
 
-int bt_hf_set_vendor_dep_cmd_event_cb(bt_hf_vendor_dep_cmd_event_cb callback, void *user_data)
-{
-       return BT_ERROR_NOT_SUPPORTED;
-}
-
-int bt_hf_unset_vendor_dep_cmd_event_cb(void)
-{
-       return BT_ERROR_NOT_SUPPORTED;
-}
-
 int bt_hf_notify_vendor_cmd(int appid, char *msg)
 {
        return BT_ERROR_NOT_SUPPORTED;
@@ -374,15 +364,4 @@ int bt_hf_unset_remote_call_event_cb(void)
        return BT_ERROR_NOT_SUPPORTED;
 }
 
-int bt_hf_set_remote_device_state_changed_cb(
-                               bt_hf_remote_device_state_changed_cb callback,
-                               void *user_data)
-{
-       return BT_ERROR_NOT_SUPPORTED;
-}
-
-int bt_hf_unset_remote_device_state_changed_cb(void)
-{
-       return BT_ERROR_NOT_SUPPORTED;
-}
 /* LCOV_EXCL_STOP */
index b3986a1277b4c1f8a3e361c1bf36887792eeab99..71db2b8d02b0ec877376245db090b43ad355573f 100644 (file)
@@ -132,28 +132,28 @@ bool _bt_check_cb(int events)
        return (bt_event_slot_container[events].callback != NULL) ? true : false;
 }
 
-void _bt_convert_address_to_hex(bluetooth_device_address_t *addr_hex, const char *addr_str)
+void _bt_convert_address_to_hex(unsigned char **addr_hex, const char *addr_str)
 {
        char *ptr1, *ptr2, *ptr3, *ptr4, *ptr5;
 
        if (addr_str == NULL || addr_str[0] == '\0')
                return;
 
-       addr_hex->addr[0] = strtol(addr_str, &ptr5, 16);
-       addr_hex->addr[1] = strtol(ptr5 + 1, &ptr4, 16);
-       addr_hex->addr[2] = strtol(ptr4 + 1, &ptr3, 16);
-       addr_hex->addr[3] = strtol(ptr3 + 1, &ptr2, 16);
-       addr_hex->addr[4] = strtol(ptr2 + 1, &ptr1, 16);
-       addr_hex->addr[5] = strtol(ptr1 + 1, NULL, 16);
+       *addr_hex[0] = strtol(addr_str, &ptr5, 16);
+       *addr_hex[1] = strtol(ptr5 + 1, &ptr4, 16);
+       *addr_hex[2] = strtol(ptr4 + 1, &ptr3, 16);
+       *addr_hex[3] = strtol(ptr3 + 1, &ptr2, 16);
+       *addr_hex[4] = strtol(ptr2 + 1, &ptr1, 16);
+       *addr_hex[5] = strtol(ptr1 + 1, NULL, 16);
 }
 
-int _bt_convert_address_to_string(char **addr_str, bluetooth_device_address_t *addr_hex)
+int _bt_convert_address_to_string(char **addr_str, unsigned char *addr_hex)
 {
        char address[18] = { 0, };
 
        BT_CHECK_INPUT_PARAMETER(addr_hex);
 
-       snprintf(address, 18, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", addr_hex->addr[0], addr_hex->addr[1], addr_hex->addr[2], addr_hex->addr[3], addr_hex->addr[4], addr_hex->addr[5]);
+       snprintf(address, 18, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", addr_hex[0], addr_hex[1], addr_hex[2], addr_hex[3], addr_hex[4], addr_hex[5]);
        *addr_str = strdup(address);
 
        if (*addr_str != NULL)
@@ -194,83 +194,6 @@ char *_bt_convert_uuid_to_uuid128(const char *uuid)
        return uuid128;
 }
 
-bt_adapter_visibility_mode_e _bt_get_bt_visibility_mode_e(bluetooth_discoverable_mode_t mode)
-{
-       switch (mode) {
-       case BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE:
-               return BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE;
-       case BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE:
-               return BT_ADAPTER_VISIBILITY_MODE_GENERAL_DISCOVERABLE; /* LCOV_EXCL_LINE */
-       default:
-               return BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE;
-       }
-}
-
-static void __bt_convert_lower_to_upper(char *origin)
-{
-       int length = strlen(origin);
-       int i = 0;
-
-       for (i = 0; i < length; i++) {
-               if (islower(origin[i]))
-                       origin[i] = toupper(origin[i]);
-       }
-}
-
-int _bt_get_bt_device_info_s(bt_device_info_s **dest_dev, bluetooth_device_info_t *source_dev)
-{
-       int i = 0;
-
-       BT_CHECK_INPUT_PARAMETER(source_dev);
-
-       *dest_dev = (bt_device_info_s *)malloc(sizeof(bt_device_info_s));
-       if (*dest_dev == NULL)
-               return BT_ERROR_OUT_OF_MEMORY;
-
-       if (strlen(source_dev->device_name.name) > 0)
-               (*dest_dev)->remote_name = strdup(source_dev->device_name.name);
-       else
-               (*dest_dev)->remote_name = NULL;
-
-       _bt_convert_address_to_string(&((*dest_dev)->remote_address), &(source_dev->device_address));
-
-       (*dest_dev)->bt_class.major_device_class = source_dev->device_class.major_class;
-       (*dest_dev)->bt_class.minor_device_class = source_dev->device_class.minor_class;
-       (*dest_dev)->bt_class.major_service_class_mask = source_dev->device_class.service_class;
-       if (source_dev->service_index > 0) {
-               (*dest_dev)->service_uuid = (char **)malloc(sizeof(char *) *source_dev->service_index);
-               if ((*dest_dev)->service_uuid != NULL) {
-                       for (i = 0; i < source_dev->service_index; i++) {
-                               (*dest_dev)->service_uuid[i] = g_strndup(source_dev->uuids[i], BLUETOOTH_UUID_STRING_MAX - 1);
-                               if ((*dest_dev)->service_uuid[i] != NULL)
-                                       __bt_convert_lower_to_upper((*dest_dev)->service_uuid[i]);
-                       }
-               }
-       } else {
-               (*dest_dev)->service_uuid = NULL;
-       }
-       (*dest_dev)->service_count = source_dev->service_index;
-       (*dest_dev)->is_bonded = (bool)source_dev->paired;
-       (*dest_dev)->is_connected = source_dev->connected != BLUETOOTH_CONNECTED_LINK_NONE ? TRUE : FALSE;
-       (*dest_dev)->is_authorized = (bool)source_dev->trust;
-       (*dest_dev)->manufacturer_data_len = source_dev->manufacturer_data.data_len;
-       if (source_dev->manufacturer_data.data_len > 0) {
-               (*dest_dev)->manufacturer_data = (char *)malloc(source_dev->manufacturer_data.data_len);
-               if ((*dest_dev)->manufacturer_data)
-                       memcpy((*dest_dev)->manufacturer_data, source_dev->manufacturer_data.data, source_dev->manufacturer_data.data_len);
-               else
-                       return BT_ERROR_OUT_OF_MEMORY;
-       } else {
-               (*dest_dev)->manufacturer_data = (char *)malloc(1);
-               if ((*dest_dev)->manufacturer_data)
-                       (*dest_dev)->manufacturer_data[0] = 0;
-               else
-                       return BT_ERROR_OUT_OF_MEMORY;
-       }
-
-       return BT_ERROR_NONE;
-}
-
 void _bt_free_bt_device_info_s(bt_device_info_s *device_info)
 {
        int i = 0;
index 8abef78d5b1822ad064cfd16e4be236ce1e811e3..f2caacee871f34db326dab0a44adecf080f9942b 100644 (file)
@@ -229,32 +229,6 @@ int bt_device_unset_att_mtu_changed_cb(void)
        return BT_ERROR_NOT_SUPPORTED;
 }
 
-int bt_device_enable_rssi_monitor(const char *remote_address,
-                               bt_device_connection_link_type_e link_type,
-                               int low_threshold, int in_range_threshold,
-                               bt_rssi_monitor_enabled_cb cb_enable,
-                               void *user_data_enable,
-                               bt_rssi_alert_cb cb_alert,
-                               void *user_data_alert)
-{
-       return BT_ERROR_NOT_SUPPORTED;
-}
-
-int bt_device_disable_rssi_monitor(const char *remote_address,
-                               bt_device_connection_link_type_e link_type,
-                               bt_rssi_monitor_enabled_cb cb_disable,
-                               void *user_data_disable)
-{
-       return BT_ERROR_NOT_SUPPORTED;
-}
-
-int bt_device_get_rssi_strength(const char *remote_address,
-                               bt_device_connection_link_type_e link_type,
-                               bt_rssi_strength_cb callback, void *user_data)
-{
-       return BT_ERROR_NOT_SUPPORTED;
-}
-
 int bt_device_le_conn_update(const char *device_address,
        const bt_le_conn_update_s *parameters)
 {
@@ -367,15 +341,4 @@ int bt_adapter_get_bonded_device_is_alias_set(const char *remote_address, gboole
        return BT_ERROR_NOT_SUPPORTED;
 }
 
-int bt_device_le_set_data_length(const char *remote_address,
-               unsigned int max_tx_Octets,  unsigned int max_tx_Time)
-{
-       return BT_ERROR_NOT_SUPPORTED;
-}
-
-int bt_device_le_set_data_length_change_cb(
-       _bt_le_set_data_length_changed_cb callback, void *user_data)
-{
-       return BT_ERROR_NOT_SUPPORTED;
-}
 /* LCOV_EXCL_STOP */
index 96ef29043b4e65b4aa28e06c5bb315be4273be8d..0967828fb8ba0332c774416918b3ee777eba33eb 100644 (file)
  */
 
 #include <stdbool.h>
+#include <string.h>
 #include <math.h>
-#include <bluetooth-api.h>
+
+#include "bt-adaptation-gatt.h"
 
 #include "bluetooth.h"
 #include "bluetooth_private.h"
 #include "bluetooth_internal.h"
 #include "bluetooth_type_internal.h"
 
-#ifdef TIZEN_FEATURE_GATT_RELAY
-#include "bluetooth-gatt-server-api.h"
-/* TODO_40 : 4.0 merge - Need to check if it is ok to use the grobal variable or not. */
-int instance_id;
-#endif
-
-#ifdef TIZEN_GATT_CLIENT
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
 #include <arpa/inet.h>
-#include "bluetooth-gatt-client-api.h"
-#endif
 
 #define BT_ADDR_STR_LEN                17
 
 static GSList *gatt_client_list = NULL;
-
 static GSList *gatt_handle_list = NULL;
-
 static GSList *gatt_server_list = NULL;
+
+int instance_id;
 static bool is_gatt_server_initialized = false;
 static bool is_gatt_server_started = false;
 
@@ -73,8 +66,7 @@ static void __bt_gatt_free_service(bt_gatt_h gatt_handle);
 
 #define BT_CHECK_GATT_SERVER_INIT_STATUS() { \
        if (__bt_check_gatt_server_init_status() == BT_ERROR_NOT_INITIALIZED) { \
-               LOGE("[%s] NOT_INITIALIZED(0x%08x)", __FUNCTION__, \
-                                       BT_ERROR_NOT_INITIALIZED); \
+               BT_PRT("NOT_INITIALIZED(0x%08x)", BT_ERROR_NOT_INITIALIZED); \
                return BT_ERROR_NOT_INITIALIZED; \
        } \
 }
@@ -96,7 +88,6 @@ static void __bt_gatt_free_service(bt_gatt_h gatt_handle);
        } \
 } \
 
-#ifdef TIZEN_GATT_CLIENT
 static void __bt_gatt_free_service(bt_gatt_h gatt_handle);
 
 /* LCOV_EXCL_START */
@@ -123,7 +114,6 @@ void __bt_string_to_uuid_hex(const char *str, unsigned char *uuid)
        memcpy(&(uuid[14]), &uuid5, 2);
        return;
 }
-#endif
 
 static int __bt_check_gatt_server_init_status(void)
 {
@@ -218,33 +208,32 @@ static void __bt_gatt_client_handle_destroy(bt_gatt_h gatt_handle)
                bt_gatt_descriptor_destroy(gatt_handle);
 }
 
-#ifdef TIZEN_GATT_CLIENT
 bt_gatt_h _bt_gatt_client_add_service(bt_gatt_client_h client,
                const char *uuid, int instance_id)
 {
        int ret;
        bt_gatt_client_s *client_s = (bt_gatt_client_s*)client;
        bt_gatt_service_s *svc = NULL;
-       bt_gatt_service_property_t property;
-       bt_gatt_handle_property_t service;
+       bt_gatt_svc_prop_t property;
+       bt_gatt_handle_prop_t service;
 
        if (client == NULL || uuid == NULL) {
                BT_ERR("Invalid parameter");
                return NULL;
        }
 
-       memset(&property, 0x00, sizeof(bt_gatt_service_property_t));
-       memset(&service, 0x00, sizeof(bt_gatt_handle_property_t));
+       memset(&property, 0x00, sizeof(bt_gatt_svc_prop_t));
+       memset(&service, 0x00, sizeof(bt_gatt_handle_prop_t));
 
        __bt_string_to_uuid_hex(uuid, service.uuid);
        service.instance_id = instance_id;
 
        BT_INFO("GATT client add service: get all properties of this service");
-       ret = bluetooth_gatt_client_get_service_property(client_s->remote_address,
+       ret = bt_adapt_gatt_client_get_svc_property(client_s->remote_address,
                        &service, &property);
-       ret = _bt_get_error_code(ret);
+
        if (ret != BT_ERROR_NONE) {
-               BT_ERR("bluetooth_gatt_get_service_property is failed");
+               BT_ERR("bt_adapt_gatt_client_get_svc_property is failed");
                return NULL;
        }
 
@@ -266,7 +255,7 @@ bt_gatt_h _bt_gatt_client_add_service(bt_gatt_client_h client,
        memcpy(&svc->charc_handles, &property.char_handle, sizeof(bt_gatt_handle_info_t));
        BT_INFO("Total number of Characteristic handles [%d]", svc->charc_handles.count);
 
-       bluetooth_gatt_free_service_property(&property);
+       bt_adapt_gatt_free_svc_property(&property);
 
        client_s->services = g_slist_append(client_s->services, svc);
        BT_INFO("GATT service added , current count of Client services [%d]",
@@ -274,58 +263,11 @@ bt_gatt_h _bt_gatt_client_add_service(bt_gatt_client_h client,
 
        return svc;
 }
-#else
-bt_gatt_h _bt_gatt_client_add_service(bt_gatt_client_h client, const char *path)
-{
-       int ret;
-       bt_gatt_client_s *client_s = client;
-       bt_gatt_service_s *svc = NULL;
-       bt_gatt_service_property_t property;
-
-       if (client == NULL || path == NULL) {
-               BT_ERR("Invalid parameter");
-               return NULL;
-       }
-
-       memset(&property, 0x00, sizeof(property));
-
-       ret = bluetooth_gatt_get_service_property(path, &property);
-       ret = _bt_get_error_code(ret);
-       if (ret != BT_ERROR_NONE) {
-               BT_ERR("bluetooth_gatt_get_service_property is failed");
-               return NULL;
-       }
-
-       svc = __bt_gatt_service_create(property.uuid,
-                               BT_GATT_SERVICE_TYPE_PRIMARY);
-       if (svc == NULL) {
-               BT_ERR("svc is NULL");
-               return NULL;
-       }
-       svc->role = BT_GATT_ROLE_CLIENT;
-       svc->parent = (void *)client_s;
-       svc->is_included_service = false;
-       svc->path = g_strdup(path);
-
-       svc->include_handles = property.include_handles.handle;
-       property.include_handles.handle = NULL;
-
-       svc->char_handles = property.char_handle.handle;
-       property.char_handle.handle = NULL;
-
-       bluetooth_gatt_free_service_property(&property);
 
-       client_s->services = g_slist_append(client_s->services, svc);
-
-       return svc;
-}
-#endif
 
-#ifdef TIZEN_GATT_CLIENT
 int _bt_gatt_client_update_services(bt_gatt_client_h client)
 {
        bt_gatt_client_s *client_s = client;
-       bluetooth_device_address_t addr_hex = { {0, } };
        bt_gatt_handle_info_t prim_svc;
        int ret;
        int i;
@@ -342,12 +284,11 @@ int _bt_gatt_client_update_services(bt_gatt_client_h client)
 
        BT_INFO("Update services for remote GATT server [%s]",
                        client_s->remote_address);
-       _bt_convert_address_to_hex(&addr_hex, client_s->remote_address);
 
-       ret = bluetooth_gatt_client_get_primary_services(&addr_hex, &prim_svc);
-       ret = _bt_get_error_code(ret);
+       ret = bt_adapt_gatt_client_get_primary_services(client_s->remote_address, &prim_svc);
+
        if (ret != BT_ERROR_NONE) {
-               BT_ERR("bluetooth_gatt_client_get_primary_services is failed");
+               BT_ERR("bt_adapt_gatt_client_get_primary_services is failed");
                return ret;
        }
 
@@ -373,61 +314,11 @@ int _bt_gatt_client_update_services(bt_gatt_client_h client)
        }
        return BT_ERROR_NONE;
 }
-#else
-int _bt_gatt_client_update_services(bt_gatt_client_h client)
-{
-       bt_gatt_client_s *client_s = client;
-       bluetooth_device_address_t addr_hex = { {0, } };
-       bt_gatt_handle_info_t prim_svc;
-       int ret;
-       int i;
-
-       if (!client_s->connected) {
-               BT_INFO("Not connected");
-               return BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED;
-       }
-
-       if (client_s->services_discovered) {
-               BT_INFO("Already discovered");
-               return BT_ERROR_ALREADY_DONE;
-       }
-
-       _bt_convert_address_to_hex(&addr_hex, client_s->remote_address);
-
-       ret = bluetooth_gatt_get_primary_services(&addr_hex, &prim_svc);
-       ret = _bt_get_error_code(ret);
-       if (ret != BT_ERROR_NONE) {
-               BT_ERR("bluetooth_gatt_get_primary_services is failed");
-               return ret;
-       }
-
-       if (client_s->services)
-               g_slist_free_full(client_s->services, __bt_gatt_free_service);
-
-       client_s->services = NULL;
-
-       if (prim_svc.count == 0) {
-               BT_INFO("There is no service");
-               return BT_ERROR_NONE;
-       }
-
-       client_s->services_discovered = true;
-       for (i = 0; i < prim_svc.count; i++) {
-               if (!_bt_gatt_client_add_service(client, prim_svc.handle[i])) {
-                       BT_ERR("_bt_gatt_client_add_service is failed [%s]",
-                                       prim_svc.handle[i]);
-                       client_s->services_discovered = false;
-               }
-       }
-       g_strfreev(prim_svc.handle);
-
-       return BT_ERROR_NONE;
-}
-#endif
 
 int _bt_gatt_client_update_include_services(bt_gatt_h service)
 {
        bt_gatt_service_s *svc = service;
+       bt_gatt_client_s *client_s;
        GSList *include_list = NULL;
        int i;
 
@@ -437,18 +328,22 @@ int _bt_gatt_client_update_include_services(bt_gatt_h service)
        if (svc->include_handles == NULL)
                return BT_ERROR_NONE;
 
+       client_s = (bt_gatt_client_s*)svc->parent;
+
        for (i = 0; svc->include_handles[i]; i++) {
                bt_gatt_service_s *sec_svc = NULL;
-               bt_gatt_service_property_t sec_property;
+               bt_gatt_handle_prop_t service;
+               bt_gatt_svc_prop_t sec_property;
                int ret;
 
+               memset(&service, 0x00, sizeof(bt_gatt_handle_prop_t));
                memset(&sec_property, 0x00, sizeof(sec_property));
 
-               ret = bluetooth_gatt_get_service_property(
-                               svc->include_handles[i], &sec_property);
-               ret = _bt_get_error_code(ret);
+               ret = bt_adapt_gatt_client_get_svc_property(client_s->remote_address,
+                               &service, &sec_property);
+
                if (ret != BT_ERROR_NONE) {
-                       BT_ERR("bluetooth_gatt_get_service_property is failed");
+                       BT_ERR("bt_adapt_gatt_client_get_svc_property is failed");
                        continue;
                }
 
@@ -468,7 +363,7 @@ int _bt_gatt_client_update_include_services(bt_gatt_h service)
 
                include_list = g_slist_append(include_list, sec_svc);
 next:
-               bluetooth_gatt_free_service_property(&sec_property);
+               bt_adapt_gatt_free_svc_property(&sec_property);
        }
 
        g_strfreev(svc->include_handles);
@@ -481,13 +376,12 @@ next:
        return BT_ERROR_NONE;
 }
 
-#ifdef TIZEN_GATT_CLIENT
 int _bt_gatt_client_update_characteristics(bt_gatt_h service)
 {
        bt_gatt_service_s *svc = service;
        bt_gatt_client_s *client_s;
-       bt_gatt_handle_property_t svc_handle;
-       bt_gatt_handle_property_t char_handle;
+       bt_gatt_handle_prop_t svc_handle;
+       bt_gatt_handle_prop_t char_handle;
        GSList *chr_list = NULL;
        int i;
 
@@ -498,8 +392,8 @@ int _bt_gatt_client_update_characteristics(bt_gatt_h service)
        if (svc->charc_handles.count == 0)
                return BT_ERROR_NONE;
 
-       memset(&svc_handle, 0x00, sizeof(bt_gatt_handle_property_t));
-       memset(&char_handle, 0x00, sizeof(bt_gatt_handle_property_t));
+       memset(&svc_handle, 0x00, sizeof(bt_gatt_handle_prop_t));
+       memset(&char_handle, 0x00, sizeof(bt_gatt_handle_prop_t));
 
        client_s = (bt_gatt_client_s*)svc->parent;
 
@@ -510,7 +404,7 @@ int _bt_gatt_client_update_characteristics(bt_gatt_h service)
 
        for (i = 0; i < svc->charc_handles.count; i++) {
                bt_gatt_characteristic_s *chr = NULL;
-               bt_gatt_char_property_t char_property;
+               bt_gatt_char_prop_t char_property;
                int ret;
 
                memset(&char_property, 0x00, sizeof(char_property));
@@ -519,19 +413,19 @@ int _bt_gatt_client_update_characteristics(bt_gatt_h service)
                char_handle.instance_id = svc->charc_handles.inst_id[i];
 
                BT_INFO("Retrieve Characteristics properties");
-               ret = bluetooth_gatt_client_get_characteristics_property(
+               ret = bt_adapt_gatt_client_get_char_property(
                                client_s->remote_address,
                                &svc_handle,
                                &char_handle,
                                &char_property);
-               ret = _bt_get_error_code(ret);
+
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("bluetooth_gatt_get_characteristics_property is failed");
                        continue;
                }
 
                BT_INFO("Characteristics properties are retreived, not create charc object");
-               ret = bt_gatt_characteristic_create(char_property.uuid, 0,
+               ret = bt_gatt_characteristic_create((const char *)char_property.uuid, 0,
                                char_property.permission,
                                (char *)char_property.val,
                                (int)char_property.val_len, (bt_gatt_h *)&chr);
@@ -570,7 +464,7 @@ int _bt_gatt_client_update_characteristics(bt_gatt_h service)
 
                chr_list = g_slist_append(chr_list, chr);
 next:
-               bluetooth_gatt_free_char_property(&char_property);
+               bt_adapt_gatt_free_char_property(&char_property);
        }
 
        memset(&svc->charc_handles, 0x00, sizeof(bt_gatt_handle_info_t));
@@ -583,72 +477,7 @@ next:
 
        return BT_ERROR_NONE;
 }
-#else
-int _bt_gatt_client_update_characteristics(bt_gatt_h service)
-{
-       bt_gatt_service_s *svc = service;
-       GSList *chr_list = NULL;
-       int i;
-
-       if (svc == NULL)
-               return BT_ERROR_INVALID_PARAMETER;
-
-       if (svc->char_handles == NULL)
-               return BT_ERROR_NONE;
-
-       for (i = 0; svc->char_handles[i]; i++) {
-               bt_gatt_characteristic_s *chr = NULL;
-               bt_gatt_char_property_t char_property;
-               int ret;
-
-               memset(&char_property, 0x00, sizeof(char_property));
-
-               ret = bluetooth_gatt_get_characteristics_property(
-                               svc->char_handles[i], &char_property);
-               ret = _bt_get_error_code(ret);
-               if (ret != BT_ERROR_NONE) {
-                       BT_ERR("bluetooth_gatt_get_characteristics_property is failed");
-                       continue;
-               }
-
-               ret = bt_gatt_characteristic_create(char_property.uuid, 0,
-                               char_property.permission,
-                               (char *)char_property.val,
-                               (int)char_property.val_len, (bt_gatt_h *)&chr);
-               if (ret != BT_ERROR_NONE) {
-                       BT_ERR("bt_gatt_characteristic_create is failed");
-                       goto next;
-               }
-
-               if (char_property.permission & BT_GATT_PROPERTY_WRITE_WITHOUT_RESPONSE)
-                       chr->write_type = BT_GATT_WRITE_TYPE_WRITE_NO_RESPONSE;
-               else if (char_property.permission & BT_GATT_PROPERTY_WRITE)
-                       chr->write_type = BT_GATT_WRITE_TYPE_WRITE;
-
-               chr->path = g_strdup(svc->char_handles[i]);
-               chr->parent = (void *)svc;
-               chr->role = BT_GATT_ROLE_CLIENT;
-               chr->desc_handles = char_property.char_desc_handle.handle;
-               char_property.char_desc_handle.handle = NULL;
-
-               chr_list = g_slist_append(chr_list, chr);
-next:
-               bluetooth_gatt_free_char_property(&char_property);
-       }
-
-       g_strfreev(svc->char_handles);
-       svc->char_handles = NULL;
-
-       g_slist_free_full(svc->characteristics, __bt_gatt_free_characteristic);
-
-       svc->characteristics = chr_list;
-
-       return BT_ERROR_NONE;
-}
-#endif
-
 
-#ifdef TIZEN_GATT_CLIENT
 int _bt_gatt_client_update_descriptors(bt_gatt_h characteristic)
 {
        bt_gatt_characteristic_s *chr = characteristic;
@@ -657,9 +486,9 @@ int _bt_gatt_client_update_descriptors(bt_gatt_h characteristic)
 
        bt_gatt_service_s *svc;
        bt_gatt_client_s *client_s;
-       bt_gatt_handle_property_t svc_handle;
-       bt_gatt_handle_property_t char_handle;
-       bt_gatt_handle_property_t desc_handle;
+       bt_gatt_handle_prop_t svc_handle;
+       bt_gatt_handle_prop_t char_handle;
+       bt_gatt_handle_prop_t desc_handle;
 
        BT_INFO("+");
        if (chr == NULL)
@@ -668,9 +497,9 @@ int _bt_gatt_client_update_descriptors(bt_gatt_h characteristic)
                return BT_ERROR_NONE;
 
        svc = (bt_gatt_service_s*)chr->parent;
-       memset(&svc_handle, 0x00, sizeof(bt_gatt_handle_property_t));
-       memset(&char_handle, 0x00, sizeof(bt_gatt_handle_property_t));
-       memset(&desc_handle, 0x00, sizeof(bt_gatt_handle_property_t));
+       memset(&svc_handle, 0x00, sizeof(bt_gatt_handle_prop_t));
+       memset(&char_handle, 0x00, sizeof(bt_gatt_handle_prop_t));
+       memset(&desc_handle, 0x00, sizeof(bt_gatt_handle_prop_t));
 
        client_s = (bt_gatt_client_s*)svc->parent;
 
@@ -682,7 +511,7 @@ int _bt_gatt_client_update_descriptors(bt_gatt_h characteristic)
 
        for (i = 0; i < chr->descriptor_handles.count; i++) {
                bt_gatt_descriptor_s *desc = NULL;
-               bt_gatt_char_descriptor_property_t desc_property;
+               bt_gatt_char_desc_prop_t desc_property;
                int ret;
 
                memset(&desc_property, 0x00, sizeof(desc_property));
@@ -693,13 +522,13 @@ int _bt_gatt_client_update_descriptors(bt_gatt_h characteristic)
 
                BT_INFO("Retreieve Desceriptor Properties from remote [%s]",
                                client_s->remote_address);
-               ret = bluetooth_gatt_client_get_char_descriptor_property(
+               ret = bt_adapt_gatt_client_get_char_desc_property(
                                client_s->remote_address,
                                &svc_handle,
                                &char_handle,
                                &desc_handle,
                                &desc_property);
-               ret = _bt_get_error_code(ret);
+
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("bluetooth_gatt_get_char_descriptor_property is failed");
                        continue;
@@ -721,7 +550,7 @@ int _bt_gatt_client_update_descriptors(bt_gatt_h characteristic)
                desc->role = BT_GATT_ROLE_CLIENT;
                desc_list = g_slist_append(desc_list, desc);
 next:
-               bluetooth_gatt_free_desc_property(&desc_property);
+               bt_adapt_gatt_free_desc_property(&desc_property);
        }
 
 
@@ -734,69 +563,11 @@ next:
 
        return BT_ERROR_NONE;
 }
-#else
-int _bt_gatt_client_update_descriptors(bt_gatt_h characteristic)
-{
-       bt_gatt_characteristic_s *chr = characteristic;
-       GSList *desc_list = NULL;
-       int i;
-
-       if (chr == NULL)
-               return BT_ERROR_INVALID_PARAMETER;
-
-       if (chr->desc_handles == NULL)
-               return BT_ERROR_NONE;
-
-       for (i = 0; chr->desc_handles[i]; i++) {
-               bt_gatt_descriptor_s *desc = NULL;
-               bt_gatt_char_descriptor_property_t desc_property;
-               int ret;
-
-               memset(&desc_property, 0x00, sizeof(desc_property));
-
-               ret = bluetooth_gatt_get_char_descriptor_property(
-                               chr->desc_handles[i], &desc_property);
-               ret = _bt_get_error_code(ret);
-               if (ret != BT_ERROR_NONE) {
-                       BT_ERR("bluetooth_gatt_get_char_descriptor_property is failed");
-                       continue;
-               }
-
-               ret = bt_gatt_descriptor_create(desc_property.uuid, 0,
-                                       (char*)desc_property.val,
-                                       (int)desc_property.val_len,
-                                       (bt_gatt_h *)&desc);
-               if (ret != BT_ERROR_NONE) {
-                       BT_ERR("bt_gatt_characteristic_create is failed");
-                       goto next;
-               }
-
-               desc->path = g_strdup(chr->desc_handles[i]);
-               desc->parent = (void *)characteristic;
-               desc->role = BT_GATT_ROLE_CLIENT;
-
-               desc_list = g_slist_append(desc_list, desc);
-next:
-               bluetooth_gatt_free_desc_property(&desc_property);
-       }
-
-       g_strfreev(chr->desc_handles);
-       chr->desc_handles = NULL;
-
-       g_slist_free_full(chr->descriptors, __bt_gatt_free_descriptor);
-
-       chr->descriptors = desc_list;
-
-       return BT_ERROR_NONE;
-}
-#endif
 
-#ifdef TIZEN_GATT_CLIENT
 /* LCOV_EXCL_STOP */
 int bt_gatt_connect(const char *address, bool auto_connect)
 {
        int ret;
-       bluetooth_device_address_t bd_addr = { {0,} };
 
        bt_gatt_client_s *client_s;
 
@@ -806,22 +577,18 @@ int bt_gatt_connect(const char *address, bool auto_connect)
        BT_CHECK_GATT_CLIENT_SUPPORT();
        BT_CHECK_INIT_STATUS();
        BT_CHECK_INPUT_PARAMETER(address);
-       _bt_convert_address_to_hex(&bd_addr, address);
 
        /* Find any client attached with remote address or not */
        client_s = _bt_gatt_get_client(address);
        if (client_s) {
                BT_INFO("GATT client instance is already present for the rmeote addr [%s] client_id[%d]",
                                address, client_s->client_id);
-               ret = _bt_get_error_code(bluetooth_connect_le(&bd_addr,
-                                       auto_connect, client_s->client_id));
+               ret = bt_adapt_gatt_connect(address, auto_connect, client_s->client_id);
        } else {
                BT_INFO("GATT client instance is NOT present for the remote addr [%s]",
                                address);
 
-               ret = _bt_get_error_code(bluetooth_connect_le(&bd_addr,
-                                       auto_connect, 0/* Default Client ID */));
-
+               ret = bt_adapt_gatt_connect(address,    auto_connect, 0);
        }
 
        if (ret != BT_ERROR_NONE)
@@ -829,55 +596,27 @@ int bt_gatt_connect(const char *address, bool auto_connect)
 
        return ret;
 }
-#else
-int bt_gatt_connect(const char *address, bool auto_connect)
-{
-       int ret;
-       bluetooth_device_address_t bd_addr = { {0,} };
-
-       BT_CHECK_GATT_CLIENT_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       BT_CHECK_INPUT_PARAMETER(address);
-       _bt_convert_address_to_hex(&bd_addr, address);
-
-       ret = _bt_get_error_code(bluetooth_connect_le(&bd_addr,
-                               auto_connect ? TRUE : FALSE));
-
-       if (ret != BT_ERROR_NONE)
-               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-
-       return ret;
-}
-#endif
 
 int bt_gatt_disconnect(const char *address)
 {
        int ret;
-       bluetooth_device_address_t bd_addr = { {0,} };
-#ifdef TIZEN_GATT_CLIENT
        bt_gatt_client_s *client_s;
-#endif
 
        BT_CHECK_GATT_CLIENT_SUPPORT();
        BT_CHECK_INIT_STATUS();
        BT_CHECK_INPUT_PARAMETER(address);
-       _bt_convert_address_to_hex(&bd_addr, address);
 
-#ifdef TIZEN_GATT_CLIENT
        /* Find any client attached with remote address or not */
        client_s = _bt_gatt_get_client(address);
        if (client_s) {
                BT_INFO("GATT client instance is already present for the remote addr [%s] client interface [%d]",
                                address, client_s->client_id);
-               ret = _bt_get_error_code(bluetooth_disconnect_le(&bd_addr, client_s->client_id));
+               ret = bt_adapt_gatt_disconnect(address, client_s->client_id);
        } else {
                BT_INFO("GATT client instance is NOT present for the remote addr [%s]",
                                address);
-               ret = _bt_get_error_code(bluetooth_disconnect_le(&bd_addr, 0 /* Default CLient ID */));
+               ret = bt_adapt_gatt_disconnect(address, 0);
        }
-#else
-       ret = _bt_get_error_code(bluetooth_disconnect_le(&bd_addr));
-#endif
 
        if (ret != BT_ERROR_NONE)
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
@@ -925,12 +664,10 @@ static void __bt_gatt_free_descriptor(bt_gatt_h gatt_handle)
 static void __bt_gatt_free_characteristic(bt_gatt_h gatt_handle)
 {
        int ret;
-#ifdef TIZEN_GATT_CLIENT
-       bt_gatt_handle_property_t svc_handle;
-       bt_gatt_handle_property_t chr_handle;
+       bt_gatt_handle_prop_t svc_handle;
+       bt_gatt_handle_prop_t chr_handle;
        bt_gatt_service_s *service_s;
        bt_gatt_client_s  *client_s;
-#endif
 
        bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s*)gatt_handle;
 
@@ -940,7 +677,6 @@ static void __bt_gatt_free_characteristic(bt_gatt_h gatt_handle)
        if (gatt_handle_list)
                gatt_handle_list = g_slist_remove(gatt_handle_list, gatt_handle);
 
-#ifdef TIZEN_GATT_CLIENT
        service_s = (bt_gatt_service_s*)chr->parent;
        if (!service_s) {
                BT_ERR("service_s is null");
@@ -965,13 +701,12 @@ static void __bt_gatt_free_characteristic(bt_gatt_h gatt_handle)
 
        __bt_string_to_uuid_hex(chr->uuid, chr_handle.uuid);
        chr_handle.instance_id = chr->instance_id;
-#endif
+
        if (chr->role == BT_GATT_ROLE_CLIENT && chr->value_changed_cb &&
                chr->properties &
                (BT_GATT_PROPERTY_NOTIFY | BT_GATT_PROPERTY_INDICATE)) {
                BT_DBG("Unwatch characteristic");
-               ret = _bt_get_error_code(bluetooth_gatt_unwatch_characteristics(
-                                       chr->path));
+               ret = bt_adapt_gatt_client_unwatch_char(client_s->remote_address, &svc_handle, &chr_handle, chr->instance_id);
                if (ret != BT_ERROR_NONE)
                        BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
        }
@@ -979,10 +714,6 @@ static void __bt_gatt_free_characteristic(bt_gatt_h gatt_handle)
 fail:
        g_slist_free_full(chr->descriptors, __bt_gatt_free_descriptor);
 
-#ifndef TIZEN_GATT_CLIENT
-       g_strfreev(chr->desc_handles);
-#endif
-
        g_free(chr->path);
        g_free(chr->uuid);
        g_free(chr->value);
@@ -1006,21 +737,14 @@ static void __bt_gatt_free_service(bt_gatt_h gatt_handle)
                gatt_handle_list = g_slist_remove(gatt_handle_list, gatt_handle);
 
        if (svc->role == BT_GATT_ROLE_SERVER) {
-#ifdef TIZEN_FEATURE_GATT_RELAY
                if (is_gatt_server_initialized) {
                        BT_INFO("GATT Server Delete Service: service handle [%d] Inst ID [%d]", svc->handle, instance_id);
-                       ret = _bt_get_error_code(bluetooth_gatt_server_delete_service(svc->handle, instance_id));
+                       ret = bt_adapt_gatt_server_delete_service(svc->handle, instance_id);
                        if (ret != BT_ERROR_NONE) {
                                BT_ERR("%s(0x%08x)",
                                                _bt_convert_error_to_string(ret), ret);
                        }
                }
-#else
-               ret = _bt_get_error_code(bluetooth_gatt_unregister_service(svc->path));
-               if (ret != BT_ERROR_NONE)
-                       BT_ERR("%s(0x%08x) : Failed to unregister service",
-                                       _bt_convert_error_to_string(ret), ret);
-#endif
        }
 
        g_strfreev(svc->include_handles);
@@ -1438,17 +1162,13 @@ int bt_gatt_set_value(bt_gatt_h gatt_handle, const char *value,
                                                int value_length)
 {
        int ret;
+       int k;
        char **val = NULL;
        int *val_len = NULL;
        bt_gatt_common_s *handle = (bt_gatt_common_s *)gatt_handle;
        bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s *)gatt_handle;
        bt_gatt_descriptor_s *desc = (bt_gatt_descriptor_s *)gatt_handle;
 
-#ifdef TIZEN_FEATURE_GATT_RELAY
-       int k;
-       bluetooth_gatt_server_update_value_t param;
-#endif
-
        BT_INFO("+");
        BT_CHECK_GATT_SUPPORT();
        BT_CHECK_INIT_STATUS();
@@ -1471,36 +1191,18 @@ int bt_gatt_set_value(bt_gatt_h gatt_handle, const char *value,
                return BT_ERROR_INVALID_PARAMETER;
        }
 
-#ifdef TIZEN_FEATURE_GATT_RELAY
        if (handle->role == BT_GATT_ROLE_SERVER && handle->handle) {
-
-               memset(&param, 0x00, sizeof(bluetooth_gatt_server_update_value_t));
-
                /* DEBUG */
                for (k = 0; k < value_length; k++)
                        BT_DBG("New Value[%d] = [0x%x]", k, value[k]);
 
-               param.length = value_length;
-               memcpy(&param.data.data[0], value, value_length);
-
-               param.attribute_handle = handle->handle;
-               ret = _bt_get_error_code(bluetooth_gatt_server_update_characteristic(instance_id,
-                                       &param));
-               if (ret != BT_ERROR_NONE) {
-                       BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-                       return ret;
-               }
-       }
-#else
-       if (handle->role == BT_GATT_ROLE_SERVER && handle->path) {
-               ret = _bt_get_error_code(bluetooth_gatt_update_characteristic(handle->path,
-                                                       value, value_length));
+               ret = bt_adapt_gatt_server_update_char(instance_id, handle->handle, value, value_length);
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
                        return ret;
                }
        }
-#endif
+
        g_free(*val);
        *val = NULL;
        if (value_length > 0)
@@ -1524,10 +1226,6 @@ int bt_gatt_set_int_value(bt_gatt_h gatt_handle, bt_data_type_int_e type,
        bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s *)gatt_handle;
        bt_gatt_descriptor_s *desc = (bt_gatt_descriptor_s *)gatt_handle;
 
-#ifdef TIZEN_FEATURE_GATT_RELAY
-       bluetooth_gatt_server_update_value_t param;
-#endif
-
        BT_CHECK_GATT_SUPPORT();
        BT_CHECK_INIT_STATUS();
 
@@ -1617,18 +1315,8 @@ int bt_gatt_set_int_value(bt_gatt_h gatt_handle, bt_data_type_int_e type,
        }
 
        if (handle->role == BT_GATT_ROLE_SERVER && handle->path) {
-#ifdef TIZEN_FEATURE_GATT_RELAY
-               memset(&param, 0x00, sizeof(bluetooth_gatt_server_update_value_t));
-               memcpy(&param.data.data[0], *val, *val_len);
-
-               param.length = *val_len;
-               param.attribute_handle = handle->handle;
-               ret = _bt_get_error_code(bluetooth_gatt_server_update_characteristic(instance_id,
-                                                       &param));
-#else
-               ret = _bt_get_error_code(bluetooth_gatt_update_characteristic(handle->path,
-                                                       *val, *val_len));
-#endif
+               ret = bt_adapt_gatt_server_update_char(instance_id, handle->handle, (const char *)*val, *val_len);
+
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
                        return ret;
@@ -1653,10 +1341,6 @@ int bt_gatt_set_float_value(bt_gatt_h gatt_handle, bt_data_type_float_e type,
        bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s *)gatt_handle;
        bt_gatt_descriptor_s *desc = (bt_gatt_descriptor_s *)gatt_handle;
 
-#ifdef TIZEN_FEATURE_GATT_RELAY
-       bluetooth_gatt_server_update_value_t param;
-#endif
-
        BT_CHECK_GATT_SUPPORT();
        BT_CHECK_INIT_STATUS();
 
@@ -1737,19 +1421,8 @@ int bt_gatt_set_float_value(bt_gatt_h gatt_handle, bt_data_type_float_e type,
        }
 
        if (handle->role == BT_GATT_ROLE_SERVER && handle->path) {
-#ifdef TIZEN_FEATURE_GATT_RELAY
-               memset(&param, 0x00, sizeof(bluetooth_gatt_server_update_value_t));
-               memcpy(&param.data.data[0], *val, *val_len);
-
-               param.length = *val_len;
-               param.attribute_handle = handle->handle;
-
-               ret = _bt_get_error_code(bluetooth_gatt_server_update_characteristic(instance_id,
-                                                       &param));
-#else
-               ret = _bt_get_error_code(bluetooth_gatt_update_characteristic(handle->path,
-                                                       *val, *val_len));
-#endif
+               ret = bt_adapt_gatt_server_update_char(instance_id, handle->handle, (const char *)val, *val_len);
+
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
                        return ret;
@@ -1875,14 +1548,8 @@ static bt_gatt_service_s* __bt_gatt_service_create(const char *uuid,
                return NULL;
 
        svc->type = BT_GATT_TYPE_SERVICE;
-#ifdef TIZEN_FEATURE_GATT_RELAY
        svc->uuid = _bt_convert_uuid_to_uuid128(uuid);
-#else
-       if (strlen(uuid) == 8)
-               svc->uuid = _bt_convert_uuid_to_uuid128(uuid);
-       else
-               svc->uuid = strdup(uuid);
-#endif
+
        if (svc->uuid == NULL) {
                g_free(svc);
                return NULL;
@@ -1914,10 +1581,10 @@ int bt_gatt_service_create(const char *uuid, bt_gatt_service_type_e type,
                return BT_ERROR_OUT_OF_MEMORY;
        svc->role = BT_GATT_ROLE_SERVER;
        svc->is_included_service = false;
-#ifdef TIZEN_FEATURE_GATT_RELAY
+
        BT_INFO("Current handle count of service [%d]", svc->numhandles);
        svc->numhandles = 1; /* Initalize numhandles to 1 */
-#endif
+
        *service = (bt_gatt_h)svc;
 
        /* Add service to list of GATT handles */
@@ -1974,12 +1641,11 @@ int bt_gatt_service_add_included_service(bt_gatt_h service,
        svc->included_services = g_slist_append(svc->included_services,
                                                        included_svc);
        included_svc->parent = (void *)service;
-#ifdef TIZEN_FEATURE_GATT_RELAY
+
        if (svc) {
                BT_INFO("Current handle count of service [%d]", svc->numhandles);
                svc->numhandles = 1; /* Initalize numhandles to 1 */
        }
-#endif
 
        return BT_ERROR_NONE;
 }
@@ -2050,11 +1716,8 @@ int bt_gatt_service_get_characteristic(bt_gatt_h service, const char *uuid,
 
        BT_INFO("Get Characteristic rom service, charc uuid [%s], total charcs of this service [%d]",
                                uuid, svc->charc_handles.count);
-#ifdef TIZEN_GATT_CLIENT
+
        if (svc->charc_handles.count > 0) {
-#else
-       if (svc->char_handles) {
-#endif
                ret = _bt_gatt_client_update_characteristics(svc);
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("_bt_gatt_client_update_characteristics failed");
@@ -2088,12 +1751,8 @@ int bt_gatt_service_foreach_characteristics(bt_gatt_h service,
        BT_CHECK_INPUT_PARAMETER(service);
        BT_CHECK_INPUT_PARAMETER(callback); /* LCOV_EXCL_START */
 
-#ifdef TIZEN_GATT_CLIENT
        BT_INFO("Total num of characteristics [%d]", svc->charc_handles.count);
        if (svc->charc_handles.count > 0) {
-#else
-       if (svc->char_handles) {
-#endif
                int ret;
 
                ret = _bt_gatt_client_update_characteristics(svc);
@@ -2211,14 +1870,7 @@ int bt_gatt_characteristic_create(const char *uuid, int permissions,
        BT_INFO("Characteristic UUID : [%s] len [%zd] permissions [%d] properties [%d]",
                        uuid, strlen(uuid), permissions, properties);
 
-#ifdef TIZEN_FEATURE_GATT_RELAY
        chr->uuid = _bt_convert_uuid_to_uuid128(uuid);
-#else
-       if (strlen(uuid) == 8)
-               chr->uuid = _bt_convert_uuid_to_uuid128(uuid);
-       else
-               chr->uuid = g_strdup(uuid);
-#endif
 
        if (chr->uuid == NULL) {
                ret = BT_ERROR_OUT_OF_MEMORY;
@@ -2410,11 +2062,7 @@ int bt_gatt_characteristic_get_descriptor(bt_gatt_h characteristic,
                BT_ERR("Wrong type of GATT handle : %d", chr->type);
                return BT_ERROR_INVALID_PARAMETER;
        }
-#ifdef TIZEN_GATT_CLIENT
        if (chr->descriptor_handles.count > 0) {
-#else
-       if (chr->desc_handles) {
-#endif
                ret = _bt_gatt_client_update_descriptors(chr);
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("_bt_gatt_client_update_descriptors is failed");
@@ -2452,12 +2100,8 @@ int bt_gatt_characteristic_foreach_descriptors(bt_gatt_h characteristic,
                return BT_ERROR_INVALID_PARAMETER;
        }
 
-#ifdef TIZEN_GATT_CLIENT
        BT_INFO("Total Descriptors for the current characteristic [%d]", chr->descriptor_handles.count);
        if (chr->descriptor_handles.count > 0) {
-#else
-       if (chr->desc_handles) {
-#endif
                int ret;
 
                ret = _bt_gatt_client_update_descriptors(chr);
@@ -2502,14 +2146,8 @@ int bt_gatt_descriptor_create(const char *uuid, int permissions,
        desc->role = BT_GATT_ROLE_SERVER;
 
        BT_INFO("Descriptor UUID : [%s] len [%zd] permissions [%d]", uuid, strlen(uuid), permissions);
-#ifdef TIZEN_FEATURE_GATT_RELAY
+
        desc->uuid = _bt_convert_uuid_to_uuid128(uuid);
-#else
-       if (strlen(uuid) == 8)
-               desc->uuid = _bt_convert_uuid_to_uuid128(uuid);
-       else
-               desc->uuid = g_strdup(uuid);
-#endif
 
        if (desc->uuid == NULL) {
                ret = BT_ERROR_OUT_OF_MEMORY;
@@ -2574,11 +2212,7 @@ int bt_gatt_server_initialize(void)
        }
 
        if (!is_gatt_server_initialized) {
-#ifdef TIZEN_FEATURE_GATT_RELAY
-//             ret = _bt_get_error_code(bluetooth_gatt_server_init(&instance_id, _bt_gatt_server_event_proxy, NULL));
-#else
-               ret = _bt_get_error_code(bluetooth_gatt_init());
-#endif
+//             ret = bt_adapt_gatt_server_init(&instance_id, _bt_gatt_server_event_proxy, NULL);
 
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("%s(0x%08x)",
@@ -2614,27 +2248,19 @@ int bt_gatt_server_deinitialize(void)
                g_slist_free(gatt_server_list);
                gatt_server_list = NULL;
 
-#ifdef TIZEN_FEATURE_GATT_RELAY
-               ret = _bt_get_error_code(bluetooth_gatt_server_deinit());
+               ret = bt_adapt_gatt_server_deinit();
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("%s(0x%08x)",
                                _bt_convert_error_to_string(ret), ret);
                }
 
-               ret = _bt_get_error_code(bluetooth_gatt_server_unregister(instance_id));
+               ret = bt_adapt_gatt_server_unregister(instance_id);
 
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("%s(0x%08x)",
                                _bt_convert_error_to_string(ret), ret);
                }
-#else
-               ret = _bt_get_error_code(bluetooth_gatt_deinit());
 
-               if (ret != BT_ERROR_NONE) {
-                       BT_ERR("%s(0x%08x)",
-                               _bt_convert_error_to_string(ret), ret);
-               }
-#endif
                is_gatt_server_initialized = false;
                is_gatt_server_started = false;
                instance_id = -1;
@@ -2749,7 +2375,6 @@ int bt_gatt_server_set_characteristic_notification_state_change_cb(bt_gatt_h gat
        return BT_ERROR_NONE;
 }
 
-#ifdef TIZEN_FEATURE_GATT_RELAY
 static int __gatt_service_add_num_handle(bt_gatt_service_s *service)
 {
        int handles_count = 0;
@@ -2783,7 +2408,6 @@ static int __gatt_service_add_num_handle(bt_gatt_service_s *service)
 int bt_gatt_server_register_service(bt_gatt_server_h server, bt_gatt_h service)
 {
        int ret = BT_ERROR_NONE;
-       bluetooth_gatt_server_attribute_params_t param;
        bt_gatt_server_s *serv = (bt_gatt_server_s *)server;
        bt_gatt_service_s *svc = (bt_gatt_service_s *)service;
        GSList *char_l;
@@ -2808,8 +2432,8 @@ int bt_gatt_server_register_service(bt_gatt_server_h server, bt_gatt_h service)
        __gatt_service_add_num_handle(svc);
        BT_INFO("Service number of total handles [%d]", svc->numhandles);
 
-       ret = _bt_get_error_code(bluetooth_gatt_server_add_service(svc->uuid, svc->type,
-                               svc->numhandles, instance_id, &svc->handle));
+       ret = bt_adapt_gatt_server_add_service(svc->uuid, svc->type,
+                               svc->numhandles, instance_id, &svc->handle);
 
        BT_INFO("Service added handle [%d]", svc->handle);
 
@@ -2823,16 +2447,11 @@ int bt_gatt_server_register_service(bt_gatt_server_h server, bt_gatt_h service)
                bt_gatt_characteristic_s *chr = char_l->data;
 
                /* Add Characteristic to GATT database */
-               memset(&param, 0x00, sizeof(param));
-               param.permissions = chr->permissions;
-               param.properties = chr->properties;
-               param.service_handle = svc->handle;
-               param.instance_id = instance_id;
 
                BT_INFO("GATT Server Add Char: UUID [%s] permission [%d] properties [%d] service handle [%d] Inst ID [%d]",
                                chr->uuid, chr->permissions, chr->properties, svc->handle, instance_id);
 
-               ret = _bt_get_error_code(bluetooth_gatt_server_add_new_characteristic(chr->uuid, &param, &chr->handle));
+               ret = bt_adapt_gatt_server_add_new_char(chr->uuid, chr->permissions, chr->properties, svc->handle, instance_id, &chr->handle);
 
                BT_INFO("Char added handle [%d]", chr->handle);
 
@@ -2849,8 +2468,8 @@ int bt_gatt_server_register_service(bt_gatt_server_h server, bt_gatt_h service)
                        BT_INFO("GATT Server Add Descriptor: UUID [%s] permission [%d] service handle [%d] Inst ID [%d]",
                                        desc->uuid, desc->permissions, svc->handle, instance_id);
 
-                       ret = _bt_get_error_code(bluetooth_gatt_server_add_descriptor(desc->uuid, (bt_gatt_permission_t)desc->permissions,
-                                               svc->handle, instance_id, &desc->handle));
+                       ret = bt_adapt_gatt_server_add_desc(desc->uuid, (bt_gatt_permission_e)desc->permissions,
+                                               svc->handle, instance_id, &desc->handle);
 
                        BT_INFO("Descriptor added handle [%d]", desc->handle);
 
@@ -2869,110 +2488,10 @@ int bt_gatt_server_register_service(bt_gatt_server_h server, bt_gatt_h service)
        return ret;
 
 fail:
-       bluetooth_gatt_unregister_service(svc->path);
+//     bluetooth_gatt_unregister_service(svc->path);
 
        return ret;
 }
-#else
-int bt_gatt_server_register_service(bt_gatt_server_h server, bt_gatt_h service)
-{
-       int ret = BT_ERROR_NONE;
-
-       bt_gatt_server_s *serv = (bt_gatt_server_s *)server;
-       bt_gatt_service_s *svc = (bt_gatt_service_s *)service;
-       GSList *char_l;
-
-       BT_CHECK_GATT_SERVER_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       BT_CHECK_GATT_SERVER_INIT_STATUS();
-       BT_CHECK_INPUT_PARAMETER(server);
-       BT_CHECK_INPUT_PARAMETER(service);
-
-       if (g_slist_find(serv->services, svc)) {
-               BT_ERR("Already added service.");
-               return BT_ERROR_ALREADY_DONE;
-       }
-
-       if (is_gatt_server_started) {
-               BT_ERR("Already Server started");
-               return BT_ERROR_OPERATION_FAILED;
-       }
-
-       ret = _bt_get_error_code(bluetooth_gatt_add_service(svc->uuid,
-                                                       &svc->path));
-       if (ret != BT_ERROR_NONE) {
-               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-               return ret;
-       }
-
-       for (char_l = svc->characteristics; char_l; char_l = g_slist_next(char_l)) {
-               GSList *desc_l;
-               bt_gatt_characteristic_s *chr = char_l->data;
-
-               ret = _bt_get_error_code(bluetooth_gatt_add_new_characteristic(
-                                       svc->path, chr->uuid,
-                                       (bt_gatt_permission_t)chr->permissions,
-                                       (bt_gatt_characteristic_property_t)chr->properties,
-                                       &chr->path));
-               if (ret != BT_ERROR_NONE) {
-                       BT_ERR("%s(0x%08x)",
-                               _bt_convert_error_to_string(ret), ret);
-                       goto fail;
-               }
-
-               ret = _bt_get_error_code(bluetooth_gatt_set_characteristic_value(chr->path,
-                                       chr->value, chr->value_length));
-
-               if (ret != BT_ERROR_NONE) {
-                       BT_ERR("%s(0x%08x)",
-                               _bt_convert_error_to_string(ret), ret);
-                       goto fail;
-               }
-
-               for (desc_l = chr->descriptors; desc_l; desc_l = g_slist_next(desc_l)) {
-                       bt_gatt_descriptor_s *desc = desc_l->data;
-
-                       ret = _bt_get_error_code(bluetooth_gatt_add_descriptor(
-                                                       chr->path, desc->uuid,
-                                                       (bt_gatt_permission_t)desc->permissions,
-                                                       &desc->path));
-
-                       if (ret != BT_ERROR_NONE) {
-                               BT_ERR("%s(0x%08x)",
-                                       _bt_convert_error_to_string(ret), ret);
-                               goto fail;
-                       }
-
-                       ret = _bt_get_error_code(bluetooth_gatt_set_descriptor_value(desc->path,
-                                       desc->value, desc->value_length));
-
-                       if (ret != BT_ERROR_NONE) {
-                               BT_ERR("%s(0x%08x)",
-                                       _bt_convert_error_to_string(ret), ret);
-                               goto fail;
-                       }
-               }
-       }
-
-       ret = _bt_get_error_code(bluetooth_gatt_register_service(svc->path));
-
-       if (ret != BT_ERROR_NONE) {
-               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-               goto fail;
-       }
-
-       serv->services = g_slist_append(serv->services, svc);
-       svc->parent = (void *)server;
-
-       return ret;
-
-fail:
-       BT_ERR("Registering Service failed!!!!!");
-       bluetooth_gatt_unregister_service(svc->path);
-
-       return ret;
-}
-#endif
 
 int bt_gatt_server_unregister_service(bt_gatt_server_h server,
                                        bt_gatt_h service)
@@ -3013,9 +2532,6 @@ int bt_gatt_server_unregister_all_services(bt_gatt_server_h server)
        g_slist_free_full(serv->services, __bt_gatt_free_service);
        serv->services = NULL;
 
-#ifndef TIZEN_FEATURE_GATT_RELAY
-       ret = bluetooth_gatt_unregister_application();
-#endif
        is_gatt_server_started = false;
 
        return ret;
@@ -3030,8 +2546,6 @@ int bt_gatt_server_start(void)
        BT_CHECK_GATT_SERVER_INIT_STATUS();
 
        if (!is_gatt_server_started) {
-#ifdef TIZEN_FEATURE_GATT_RELAY
-{
                GSList *l;
                GSList *l1;
 
@@ -3046,16 +2560,13 @@ int bt_gatt_server_start(void)
                                bt_gatt_service_s *service = (bt_gatt_service_s *)l1->data;
                                BT_DBG("Service handle [%d] Service UUID [%s]", service->handle, service->uuid);
                                /* Mark the service Registered */
-                               ret = _bt_get_error_code(bluetooth_gatt_server_start_service(service->handle, instance_id));
+                               ret = bt_adapt_gatt_server_start_service(service->handle, instance_id);
 
                                if (ret != BT_ERROR_NONE)
                                        BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
                        }
                }
-}
-#else
-               ret = bluetooth_gatt_register_application();
-#endif
+
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
                        return ret;
@@ -3074,6 +2585,8 @@ int bt_gatt_server_send_response(int request_id, bt_gatt_att_request_type_e requ
                int offset, int resp_status, char *value, int value_length)
 {
        int ret = BT_ERROR_NONE;
+       bt_gatt_att_data_t resp;
+
        BT_CHECK_GATT_SERVER_SUPPORT();
        BT_CHECK_INIT_STATUS();
 
@@ -3085,34 +2598,19 @@ int bt_gatt_server_send_response(int request_id, bt_gatt_att_request_type_e requ
                        return BT_ERROR_INVALID_PARAMETER;
        }
 
-#ifdef TIZEN_FEATURE_GATT_RELAY
-       bluetooth_gatt_att_data_t resp;
-       bluetooth_gatt_server_response_params_t param;
-
        memset(&resp,  0x00, sizeof(resp));
-       memset(&param, 0x00, sizeof(param));
 
        /* Copy response data */
        resp.length = value_length;
        resp.offset = offset;
        memcpy(&resp.data[0], value, value_length);
 
-       /* Copy Response parameters */
-       param.req_type = request_type;
-       param.request_id = request_id;
-       param.response_status = resp_status;
-       param.auth_req = 0;   /* Default value set to 0 as Platform API does not provide this option */
-
        BT_INFO("GATT Server Send Response: Response type [%d]", request_type);
        BT_INFO("Req ID [%d] data_len [%d] offset [%d] Resp Status [%d]",
                                request_id, value_length, offset, resp_status);
 
-       ret = _bt_get_error_code(bluetooth_gatt_server_send_response(&param, &resp));
-#else
-       ret = _bt_get_error_code(bluetooth_gatt_send_response(request_id,
-                                       request_type, resp_status,
-                                       offset, value, value_length));
-#endif
+       ret = bt_adapt_gatt_server_send_response(request_type, request_id, resp_status, 0, &resp);
+
        if (ret != BT_ERROR_NONE)
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
 
@@ -3125,7 +2623,10 @@ int bt_gatt_server_notify_characteristic_changed_value(bt_gatt_h characteristic,
 {
        bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s *)characteristic;
        bt_gatt_common_s *handle = (bt_gatt_common_s *)characteristic;
-       bluetooth_device_address_t addr_hex = { {0,} };
+       int attribute_handle;
+       bool need_confirmation;
+       bt_gatt_att_data_t indication;
+       int k;
        int ret = BT_ERROR_NONE;
 
        BT_CHECK_GATT_SERVER_SUPPORT();
@@ -3136,15 +2637,6 @@ int bt_gatt_server_notify_characteristic_changed_value(bt_gatt_h characteristic,
 
        BT_VALIDATE_GATT_HANDLE(characteristic);
 
-       _bt_convert_address_to_hex(&addr_hex, device_address);
-
-#ifdef TIZEN_FEATURE_GATT_RELAY
-{
-       int attribute_handle;
-       bluetooth_gatt_att_data_t indication;
-       bluetooth_gatt_server_indication_params_t param;
-       int k;
-
        if (handle->type == BT_GATT_TYPE_CHARACTERISTIC) {
                attribute_handle = chr->handle;
        } else {
@@ -3176,18 +2668,15 @@ int bt_gatt_server_notify_characteristic_changed_value(bt_gatt_h characteristic,
                        indication.offset = 0; /* Default value */
                        memcpy(&indication.data[0], chr->value, chr->value_length);
 
-                       /* Copy Indication parameters */
-                       param.atrribute_handle = attribute_handle;
-
                        if (chr->properties & BT_GATT_PROPERTY_INDICATE) {
                                BT_DBG("Characteritsic [%d]has Indicate Property", attribute_handle);
-                               param.need_confirmation = TRUE;
+                               need_confirmation = TRUE;
                        } else {
-                               param.need_confirmation = FALSE;
+                               need_confirmation = FALSE;
                                BT_DBG("Enable Notifcation for the characteristic [%d]", attribute_handle);
                        }
-                       param.instance_id = instance_id;
-                       ret = _bt_get_error_code(bluetooth_gatt_server_send_indication(&addr_hex, &param, &indication));
+
+                       ret = bt_adapt_gatt_server_send_indication(device_address, chr->handle, need_confirmation, instance_id, &indication);
                        BT_INFO("Sent Indication to Remote GATT client: result [%d]", ret);
 
                        if (ret != BT_ERROR_NONE) {
@@ -3199,30 +2688,8 @@ int bt_gatt_server_notify_characteristic_changed_value(bt_gatt_h characteristic,
        } /* LCOV_EXCL_STOP */
 
        /* Save the Remote GATT client address to be used for notification later on */
-       memcpy(&chr->address.addr, &addr_hex.addr, BLUETOOTH_ADDRESS_LENGTH);
-}
-#else
-       if (chr->value_length > 0 && chr->value) {
-               if (handle->role == BT_GATT_ROLE_SERVER && handle->path) {
-                       ret = bluetooth_gatt_server_set_notification(handle->path,
-                                                               &addr_hex);
-                       if (ret != BT_ERROR_NONE) {
-                               BT_ERR("%s(0x%08x)",
-                                       _bt_convert_error_to_string(ret), ret);
-                               return ret;
-                       }
-                       ret = _bt_get_error_code(bluetooth_gatt_update_characteristic(
-                                                       handle->path,
-                                                       chr->value,
-                                                       chr->value_length));
-                       if (ret != BT_ERROR_NONE) {
-                               BT_ERR("%s(0x%08x)",
-                                       _bt_convert_error_to_string(ret), ret);
-                               return ret;
-                       }
-               }
-       }
-#endif
+       _bt_convert_address_to_hex((unsigned char **)&chr->addr, device_address);
+
        chr->notified_cb = callback;
        chr->notified_user_data = user_data;
 
@@ -3310,14 +2777,12 @@ int bt_gatt_server_foreach_services(bt_gatt_server_h server,
        return BT_ERROR_NONE;
 }
 
-#ifdef TIZEN_GATT_CLIENT
 int bt_gatt_client_create(const char *remote_address, bt_gatt_client_h *client)
 {
        int ret = BT_ERROR_NONE;
        bt_gatt_client_s *client_s;
        bool connected = false;
        GSList *l;
-       bluetooth_device_address_t bd_addr = { {0,} };
 
        BT_CHECK_GATT_CLIENT_SUPPORT();
        BT_CHECK_INIT_STATUS();
@@ -3356,14 +2821,10 @@ int bt_gatt_client_create(const char *remote_address, bt_gatt_client_h *client)
        }
 
        /* Attempt to Register GATT Client instance */
-       _bt_convert_address_to_hex(&bd_addr, client_s->remote_address);
 
-#if 0
-       ret = bluetooth_gatt_client_init(&client_s->client_id, &bd_addr,
-                               _bt_gatt_client_event_proxy);
-#endif
+       ret = bt_adapt_gatt_client_init(remote_address, &client_s->client_id);
 
-       if (BLUETOOTH_ERROR_NONE != ret) {
+       if (BT_ERROR_NONE != ret) {
                free(client_s->remote_address);
                free(client_s);
                return ret;
@@ -3389,67 +2850,6 @@ int bt_gatt_client_create(const char *remote_address, bt_gatt_client_h *client)
 
        return ret; /* LCOV_EXCL_STOP */
 }
-#else
-int bt_gatt_client_create(const char *remote_address, bt_gatt_client_h *client)
-{
-       int ret = BT_ERROR_NONE;
-       bt_gatt_client_s *client_s;
-       bool connected = false;
-       GSList *l;
-
-       BT_CHECK_GATT_CLIENT_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       BT_CHECK_INPUT_PARAMETER(remote_address); /* LCOV_EXCL_START */
-
-       for (l = gatt_client_list; l; l = g_slist_next(l)) {
-               bt_gatt_client_s *c = (bt_gatt_client_s *)l->data;
-
-               if ((c == NULL) || (c->remote_address == NULL)) {
-                       BT_ERR("bt_gatt_client_create Error Parameter are NULL..\n");
-                       continue;
-               } else if (!g_ascii_strcasecmp(c->remote_address, remote_address)) {
-                       BT_ERR("Gatt client for %s is already created",
-                                       remote_address);
-                       return BT_ERROR_ALREADY_DONE;
-               }
-       }
-
-       client_s = g_malloc0(sizeof(*client_s));
-       if (client_s == NULL) {
-               ret = BT_ERROR_OUT_OF_MEMORY;
-               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-               return ret;
-       }
-
-       client_s->remote_address = g_strdup(remote_address);
-       if (client_s->remote_address == NULL) {
-               g_free(client_s);
-               ret = BT_ERROR_OUT_OF_MEMORY;
-               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-               return ret;
-       }
-
-       if (bt_device_is_profile_connected(remote_address, BT_PROFILE_GATT,
-                               &connected) != BT_ERROR_NONE)
-               BT_ERR("bt_device_is_profile_connected is failed");
-       else
-               client_s->connected = connected;
-
-       ret = _bt_gatt_client_update_services(client_s);
-       if (ret != BT_ERROR_NONE) {
-               BT_INFO("_bt_gatt_client_update_services returns 0x%X. "
-                       "It could be updated when service is available.", ret);
-               ret = BT_ERROR_NONE;
-       }
-
-       *client = (bt_gatt_client_h)client_s;
-       gatt_client_list = g_slist_append(gatt_client_list, client_s);
-
-       BT_INFO("GATT Client Handle is created");
-
-       return ret; /* LCOV_EXCL_STOP */
-}
-#endif
 
 int bt_gatt_client_destroy(bt_gatt_client_h client)
 {
@@ -3461,25 +2861,15 @@ int bt_gatt_client_destroy(bt_gatt_client_h client)
        BT_INFO("Destroy GATT client: Client interface ID [%d] REmote address [%s]",
                        client_s->client_id, client_s->remote_address);
 
-       if (client_s->service_changed_cb) {
-               bluetooth_device_address_t bd_addr = { {0,} };
-
-               _bt_convert_address_to_hex(&bd_addr, client_s->remote_address);
-#ifdef TIZEN_GATT_CLIENT
-               bluetooth_gatt_client_set_service_change_watcher(&bd_addr, FALSE);
-#else
-               bluetooth_gatt_set_service_change_watcher(&bd_addr, FALSE);
-#endif
-       }
+       if (client_s->service_changed_cb)
+               bt_adapt_gatt_client_set_service_change_watcher(client_s->remote_address, FALSE);
 
        g_slist_free_full(client_s->services, __bt_gatt_free_service);
        gatt_client_list = g_slist_remove(gatt_client_list, client_s);
 
-#ifdef TIZEN_GATT_CLIENT
        /* Unregister GATT Client instance: Unregister should never fail  */
-       bluetooth_gatt_client_deinit(client_s->client_id);
+       bt_adapt_gatt_client_deinit(client_s->client_id);
        g_free(client_s->remote_address);
-#endif
        g_free(client_s);
 
        return BT_ERROR_NONE; /* LCOV_EXCL_STOP */
@@ -3558,7 +2948,7 @@ void _handle_gatt_client_read_completed_event(int result, bt_gatt_resp_data_t *r
                }
        }
 
-       if (result == BLUETOOTH_ATT_ERROR_NONE) {
+       if (result == BT_ERROR_NONE) {
                bt_gatt_set_value(handle,
                                (char *)resp->value, (int)resp->len);
        }
@@ -3620,7 +3010,6 @@ void _handle_gatt_client_write_completed_event(int result, bt_gatt_resp_data_t *
 }
 /* LCOV_EXCL_STOP */
 
-#ifdef TIZEN_GATT_CLIENT
 int bt_gatt_client_read_value(bt_gatt_h gatt_handle,
                bt_gatt_client_request_completed_cb callback, void *user_data)
 {
@@ -3628,9 +3017,9 @@ int bt_gatt_client_read_value(bt_gatt_h gatt_handle,
        bt_gatt_common_s *c = (bt_gatt_common_s *)gatt_handle;
 
        BT_INFO("+");
-       bt_gatt_handle_property_t svc_handle;
-       bt_gatt_handle_property_t chr_handle;
-       bt_gatt_handle_property_t desc_handle;
+       bt_gatt_handle_prop_t svc_handle;
+       bt_gatt_handle_prop_t chr_handle;
+       bt_gatt_handle_prop_t desc_handle;
        bt_gatt_service_s *service_s;
        bt_gatt_characteristic_s *charc_s;
        bt_gatt_client_s  *client_s;
@@ -3667,11 +3056,10 @@ int bt_gatt_client_read_value(bt_gatt_h gatt_handle,
                __bt_string_to_uuid_hex(chr->uuid, chr_handle.uuid);
                chr_handle.instance_id = chr->instance_id;
 
-               ret = _bt_get_error_code(
-                               bluetooth_gatt_client_read_characteristic_value(
+               ret = bt_adapt_gatt_client_read_char_value(
                                        client_s->remote_address,
                                        &svc_handle,
-                                       &chr_handle));
+                                       &chr_handle);
 
                if (ret == BT_ERROR_NONE) {
                        BT_INFO("Characteristic read scheduled successfully, set callback");
@@ -3707,12 +3095,11 @@ int bt_gatt_client_read_value(bt_gatt_h gatt_handle,
                __bt_string_to_uuid_hex(desc->uuid, desc_handle.uuid);
                desc_handle.instance_id = desc->instance_id;
 
-               ret = _bt_get_error_code(
-                               bluetooth_gatt_client_read_descriptor_value(
+               ret = bt_adapt_gatt_client_read_desc_value(
                                        client_s->remote_address,
                                        &svc_handle,
                                        &chr_handle,
-                                       &desc_handle));
+                                       &desc_handle);
 
                if (ret == BT_ERROR_NONE) {
                        BT_INFO("Descriptor read scheduled successfully, set callback");
@@ -3729,73 +3116,20 @@ int bt_gatt_client_read_value(bt_gatt_h gatt_handle,
        BT_INFO("Result [%d]", ret);
        return ret; /* LCOV_EXCL_STOP */
 }
-#else
-int bt_gatt_client_read_value(bt_gatt_h gatt_handle,
-               bt_gatt_client_request_completed_cb callback, void *user_data)
-{
-       int ret = BT_ERROR_NONE;
-       bt_gatt_common_s *c = (bt_gatt_common_s *)gatt_handle;
-
-       BT_CHECK_GATT_CLIENT_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       BT_CHECK_INPUT_PARAMETER(gatt_handle);
-       BT_CHECK_INPUT_PARAMETER(callback); /* LCOV_EXCL_START */
-
-       if (c->type == BT_GATT_TYPE_CHARACTERISTIC) {
-               bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s *)gatt_handle;
-
-               if (chr->read_cb) {
-                       BT_ERR("read request is now in progress");
-                       return BT_ERROR_NOW_IN_PROGRESS;
-               }
-
-               ret = _bt_get_error_code(
-                               bluetooth_gatt_read_characteristic_value(chr->path, gatt_handle));
-               if (ret == BT_ERROR_NONE) {
-                       chr->read_cb = callback;
-                       chr->read_user_data = user_data;
-               } else {
-                       BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-               }
-       } else if (c->type == BT_GATT_TYPE_DESCRIPTOR) {
-               bt_gatt_descriptor_s *desc = (bt_gatt_descriptor_s *)gatt_handle;
-
-               if (desc->read_cb) {
-                       BT_ERR("read request is now in progress");
-                       return BT_ERROR_NOW_IN_PROGRESS;
-               }
-
-               ret = _bt_get_error_code(
-                               bluetooth_gatt_read_descriptor_value(desc->path, gatt_handle));
-               if (ret == BT_ERROR_NONE) {
-                       desc->read_cb = callback;
-                       desc->read_user_data = user_data;
-               } else {
-                       BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-               }
-       } else {
-               ret = BT_ERROR_INVALID_PARAMETER;
-               BT_ERR("Invalid handle type for read ");
-       }
-
-       return ret; /* LCOV_EXCL_STOP */
-}
-#endif
 
-#ifdef TIZEN_GATT_CLIENT
 int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
                bt_gatt_client_request_completed_cb callback, void *user_data)
 {
        int ret = BT_ERROR_NONE;
        bt_gatt_common_s *c = (bt_gatt_common_s *)gatt_handle;
 
-       bt_gatt_handle_property_t svc_handle;
-       bt_gatt_handle_property_t chr_handle;
-       bt_gatt_handle_property_t desc_handle;
+       bt_gatt_handle_prop_t svc_handle;
+       bt_gatt_handle_prop_t chr_handle;
+       bt_gatt_handle_prop_t desc_handle;
        bt_gatt_service_s *service_s;
        bt_gatt_characteristic_s *charc_s;
        bt_gatt_client_s  *client_s;
-       bluetooth_gatt_att_data_t write_data;
+       bt_gatt_att_data_t write_data;
 
        BT_INFO("+");
        BT_CHECK_GATT_CLIENT_SUPPORT();
@@ -3812,7 +3146,7 @@ int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
                bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s *)gatt_handle;
 
                int k;
-               memset(&write_data,  0x00, sizeof(bluetooth_gatt_att_data_t));
+               memset(&write_data,  0x00, sizeof(bt_gatt_att_data_t));
                write_data.length = chr->value_length;
                BT_INFO("Char write value length [%d]", write_data.length);
                for (k = 0; k < chr->value_length; k++)
@@ -3833,22 +3167,20 @@ int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
 
                if (chr->write_type == BT_GATT_WRITE_TYPE_WRITE) {
                        BT_INFO("Write characteristic: write type [%d]", chr->write_type);
-                       ret = _bt_get_error_code(
-                                       bluetooth_gatt_client_write_characteristic_value_by_type(
+                       ret = bt_adapt_gatt_client_write_char_value_by_type(
                                                client_s->remote_address,
                                                &svc_handle,
                                                &chr_handle,
                                                &write_data,
-                                               BLUETOOTH_GATT_TYPE_WRITE));
+                                               BT_GATT_WRITE_TYPE_WRITE);
                } else if (chr->write_type == BT_GATT_WRITE_TYPE_WRITE_NO_RESPONSE) {
                        BT_INFO("Write characteristic: write type [%d]", chr->write_type);
-                       ret = _bt_get_error_code(
-                                       bluetooth_gatt_client_write_characteristic_value_by_type(
+                       ret = bt_adapt_gatt_client_write_char_value_by_type(
                                                client_s->remote_address,
                                                &svc_handle,
                                                &chr_handle,
                                                &write_data,
-                                               BLUETOOTH_GATT_TYPE_WRITE_NO_RESPONSE));
+                                               BT_GATT_WRITE_TYPE_WRITE_NO_RESPONSE);
                } else {
                        BT_ERR("Unknow write type : %d", chr->write_type);
                        ret = BT_ERROR_OPERATION_FAILED;
@@ -3869,7 +3201,7 @@ int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
                service_s = (bt_gatt_service_s*)charc_s->parent;
                client_s = (bt_gatt_client_s*)service_s->parent;
 
-               memset(&write_data,  0x00, sizeof(bluetooth_gatt_att_data_t));
+               memset(&write_data,  0x00, sizeof(bt_gatt_att_data_t));
                write_data.length = desc->value_length;
                BT_INFO("Desc write value length [%d]", write_data.length);
                memcpy(&write_data.data[0], desc->value, desc->value_length);
@@ -3886,14 +3218,13 @@ int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
                __bt_string_to_uuid_hex(desc->uuid, desc_handle.uuid);
                desc_handle.instance_id = desc->instance_id;
 
-               ret = _bt_get_error_code(
-                               bluetooth_gatt_client_write_descriptor_value(
+               ret = bt_adapt_gatt_client_write_desc_value(
                                        client_s->remote_address,
                                        &svc_handle,
                                        &chr_handle,
                                        &desc_handle,
                                        &write_data,
-                                       BLUETOOTH_GATT_TYPE_WRITE_NO_RESPONSE));
+                                       BT_GATT_WRITE_TYPE_WRITE_NO_RESPONSE);
                if (ret != BT_ERROR_NONE) {
                        BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
                } else {
@@ -3907,65 +3238,6 @@ int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
 
        return ret; /* LCOV_EXCL_STOP */
 }
-#else
-int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
-               bt_gatt_client_request_completed_cb callback, void *user_data)
-{
-       bt_gatt_common_s *c = (bt_gatt_common_s *)gatt_handle;
-       bt_gatt_property_e write_prop = BT_GATT_PROPERTY_WRITE;
-       int ret = BT_ERROR_NONE;
-
-       BT_CHECK_GATT_CLIENT_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       BT_CHECK_INPUT_PARAMETER(gatt_handle); /* LCOV_EXCL_START */
-
-       if (c->type == BT_GATT_TYPE_CHARACTERISTIC) {
-               bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s *)gatt_handle;
-
-               if (chr->write_cb) {
-                       BT_ERR("write request is now in progress");
-                       return BT_ERROR_NOW_IN_PROGRESS;
-               }
-
-               ret = __get_write_prop(chr->write_type, &write_prop);
-               if (ret != BT_ERROR_NONE)
-                       return BT_ERROR_OPERATION_FAILED;
-
-               ret = _bt_get_error_code(bluetooth_gatt_set_characteristics_value_by_type(
-                                       chr->path, (guint8 *)chr->value,
-                                       chr->value_length, write_prop,
-                                       gatt_handle));
-               if (ret == BT_ERROR_NONE) {
-                       chr->write_cb = callback;
-                       chr->write_user_data = user_data;
-               } else {
-                       BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-               }
-       } else if (c->type == BT_GATT_TYPE_DESCRIPTOR) {
-               bt_gatt_descriptor_s *desc = (bt_gatt_descriptor_s *)gatt_handle;
-
-               if (desc->write_cb) {
-                       BT_ERR("write request is now in progress");
-                       return BT_ERROR_NOW_IN_PROGRESS;
-               }
-
-               ret = _bt_get_error_code(bluetooth_gatt_write_descriptor_value(
-                                       desc->path, (guint8 *)desc->value,
-                                       desc->value_length, gatt_handle));
-               if (ret == BT_ERROR_NONE) {
-                       desc->write_cb = callback;
-                       desc->write_user_data = user_data;
-               } else {
-                       BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-               }
-       } else {
-               BT_ERR("Invalid handle type for write");
-               ret = BT_ERROR_INVALID_PARAMETER;
-       }
-
-       return ret; /* LCOV_EXCL_STOP */
-}
-#endif
 
 /* LCOV_EXCL_START */
 static bt_gatt_client_h __find_gatt_client(const char *remote_address)
@@ -3983,36 +3255,6 @@ static bt_gatt_client_h __find_gatt_client(const char *remote_address)
 }
 /* LCOV_EXCL_STOP */
 
-#ifndef TIZEN_GATT_CLIENT
-static gboolean __get_bdaddr_from_path(const char *path, char *addr)
-{
-       int i;
-       char *tmp;
-
-       /*
-        * e.g.
-        * /org/bluez/hci0/dev_E7_56_2A_AA_0C_FD/service001b
-        */
-       tmp = g_strstr_len(path, strlen(path), "dev_");
-       if (tmp == NULL)
-               return FALSE;
-       tmp += 4;
-
-       for (i = 0; *tmp != '\0' && i < BT_ADDR_STR_LEN; i++, tmp++) {
-               if (*tmp == '_')
-                       addr[i] = ':';
-               else
-                       addr[i] = *tmp;
-       }
-       addr[i] = '\0';
-
-       BT_DBG("path : %s, addr : %s", path, addr);
-
-       return TRUE;
-}
-#endif
-
-#ifdef TIZEN_GATT_CLIENT
 /* LCOV_EXCL_START */
 void __uuid_hex_to_string(unsigned char *uuid, char *str)
 {
@@ -4026,13 +3268,14 @@ void __uuid_hex_to_string(unsigned char *uuid, char *str)
        memcpy(&uuid4, &(uuid[10]), 4);
        memcpy(&uuid5, &(uuid[14]), 2);
 
-       snprintf((char *)str, BLUETOOTH_UUID_STRING_MAX, "%.8x-%.4x-%.4x-%.4x-%.8x%.4x",
+       snprintf((char *)str, BT_UUID_STR_MAX, "%.8x-%.4x-%.4x-%.4x-%.8x%.4x",
                ntohl(uuid0), ntohs(uuid1),
                ntohs(uuid2), ntohs(uuid3),
                ntohl(uuid4), ntohs(uuid5));
        return;
 }
 
+#if 0
 static bt_gatt_characteristic_s* __gatt_get_characteristic_handle(
                                unsigned char *svc_uuid,
                                int svc_inst,
@@ -4047,8 +3290,8 @@ static bt_gatt_characteristic_s* __gatt_get_characteristic_handle(
        bt_gatt_service_s *svc;
        bt_gatt_characteristic_s *chr;
 
-       char uuid_string[BLUETOOTH_UUID_STRING_MAX];
-       char svc_uuid_string[BLUETOOTH_UUID_STRING_MAX];
+       char uuid_string[BT_UUID_STR_MAX];
+       char svc_uuid_string[BT_UUID_STR_MAX];
 
        __uuid_hex_to_string(svc_uuid, svc_uuid_string);
        __uuid_hex_to_string(uuid, uuid_string) ;
@@ -4105,9 +3348,9 @@ static bt_gatt_descriptor_s* __gatt_get_descriptor_handle(
        bt_gatt_characteristic_s *chr;
        bt_gatt_descriptor_s *desc;
 
-       char uuid_string[BLUETOOTH_UUID_STRING_MAX];
-       char svc_uuid_string[BLUETOOTH_UUID_STRING_MAX];
-       char char_uuid_string[BLUETOOTH_UUID_STRING_MAX];
+       char uuid_string[BT_UUID_STR_MAX];
+       char svc_uuid_string[BT_UUID_STR_MAX];
+       char char_uuid_string[BT_UUID_STR_MAX];
 
        __uuid_hex_to_string(uuid, uuid_string);
        __uuid_hex_to_string(svc_uuid, svc_uuid_string);
@@ -4158,6 +3401,7 @@ static bt_gatt_descriptor_s* __gatt_get_descriptor_handle(
        }
        return NULL;
 }
+#endif
 
 static void __gatt_value_changed_cb(unsigned char *uuid, char *remote_address,
                char *value, int value_length, void *user_data)
@@ -4169,7 +3413,7 @@ static void __gatt_value_changed_cb(unsigned char *uuid, char *remote_address,
        bt_gatt_service_s *svc;
        bt_gatt_characteristic_s *chr;
        BT_INFO("+");
-       char uuid_string[BLUETOOTH_UUID_STRING_MAX];
+       char uuid_string[BT_UUID_STR_MAX];
        __uuid_hex_to_string(uuid, uuid_string) ;
 
        BT_INFO("Address [%s] Char UUID [%s]", remote_address, uuid_string);
@@ -4197,54 +3441,6 @@ static void __gatt_value_changed_cb(unsigned char *uuid, char *remote_address,
                }
        }
 }
-/* LCOV_EXCL_STOP */
-#else
-static void __value_changed_cb(char *char_path,
-               char *value, int value_length, void *user_data)
-{
-       GSList *l;
-       GSList *ll;
-       bt_gatt_client_h client;
-       bt_gatt_client_s *client_s;
-       bt_gatt_service_s *svc;
-       bt_gatt_characteristic_s *chr;
-       char remote_address[BT_ADDR_STR_LEN + 1] = { 0, };
-
-       BT_DBG("%s", char_path);
-
-       if (__get_bdaddr_from_path(char_path, remote_address) == FALSE) {
-               BT_ERR("Cannot get addr from path : %s", char_path);
-               return;
-       }
-
-       client = __find_gatt_client(remote_address);
-       if (client == NULL) {
-               BT_ERR("Cannot find client [%s]", remote_address);
-               return;
-       }
-
-       client_s = (bt_gatt_client_s *)client;
-       for (l = client_s->services; l; l = g_slist_next(l)) {
-               svc = (bt_gatt_service_s *)l->data;
-               for (ll = svc->characteristics; ll; ll = g_slist_next(ll)) {
-                       chr = (bt_gatt_characteristic_s *)ll->data;
-
-                       if ((chr == NULL) || (chr->path == NULL)) {
-                               BT_ERR("__value_changed_cb Error Parameter are NULL..\n");
-                               continue;
-                       } else if (g_ascii_strcasecmp(chr->path, char_path) == 0) {
-                               if (chr->value_changed_cb)
-                                       chr->value_changed_cb(chr, value,
-                                               value_length,
-                                               chr->value_changed_user_data);
-
-                               bt_gatt_set_value(chr, value, value_length);
-                               return;
-                       }
-               }
-       }
-}
-#endif
 
 int bt_gatt_client_set_characteristic_value_changed_cb(bt_gatt_h characteristic,
                bt_gatt_client_characteristic_value_changed_cb callback,
@@ -4254,15 +3450,10 @@ int bt_gatt_client_set_characteristic_value_changed_cb(bt_gatt_h characteristic,
        bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s *)characteristic;
        gboolean is_indicate = false;
 
-#ifdef TIZEN_GATT_CLIENT
-       bt_gatt_handle_property_t svc_handle;
-       bt_gatt_handle_property_t chr_handle;
+       bt_gatt_handle_prop_t svc_handle;
+       bt_gatt_handle_prop_t chr_handle;
        bt_gatt_service_s *service_s;
        bt_gatt_client_s  *client_s;
-#else
-       char *name = NULL;
-       bt_gatt_service_s *svc = (bt_gatt_service_s *)chr->parent;
-#endif
 
        BT_INFO("+");
 
@@ -4274,8 +3465,6 @@ int bt_gatt_client_set_characteristic_value_changed_cb(bt_gatt_h characteristic,
        chr->value_changed_cb = callback;
        chr->value_changed_user_data = user_data;
 
-#ifdef TIZEN_GATT_CLIENT
-
        service_s = (bt_gatt_service_s*)chr->parent;
        client_s = (bt_gatt_client_s*)service_s->parent;
 
@@ -4285,7 +3474,6 @@ int bt_gatt_client_set_characteristic_value_changed_cb(bt_gatt_h characteristic,
 
        __bt_string_to_uuid_hex(chr->uuid, chr_handle.uuid);
        chr_handle.instance_id = chr->instance_id;
-#endif
 
        BT_INFO("Characteristic properties [%d] charc UUID [%s]",
                        chr->properties, chr->uuid);
@@ -4296,32 +3484,21 @@ int bt_gatt_client_set_characteristic_value_changed_cb(bt_gatt_h characteristic,
        if (chr->properties &
                        (BT_GATT_PROPERTY_NOTIFY | BT_GATT_PROPERTY_INDICATE)) {
 
-#ifdef TIZEN_GATT_CLIENT
-               ret = _bt_get_error_code(bluetooth_gatt_client_watch_characteristics(
+               ret = bt_adapt_gatt_client_watch_char(
                                        client_s->remote_address,
                                        &svc_handle,
                                        &chr_handle,
                                        client_s->client_id,
                                        TRUE,
-                                       is_indicate));
-#else
-               bt_get_uuid_name(svc->uuid, &name);
-               ret = _bt_get_error_code(bluetooth_gatt_watch_characteristics(
-                                       chr->path, name));
-               g_free(name);
-#endif
+                                       is_indicate);
+
                if (ret != BT_ERROR_NONE)
                        BT_ERR("%s(0x%08x)",
                                        _bt_convert_error_to_string(ret), ret);
                else {
-#ifdef TIZEN_GATT_CLIENT
                        BT_INFO("Set Char val changed callback at index [%d]", BT_EVENT_GATT_CLIENT_VALUE_CHANGED);
                        _bt_set_cb(BT_EVENT_GATT_CLIENT_VALUE_CHANGED,
                                        __gatt_value_changed_cb, NULL);
-#else
-                       _bt_set_cb(BT_EVENT_GATT_CLIENT_VALUE_CHANGED,
-                                       __value_changed_cb, NULL);
-#endif
                        BT_INFO("Char value changed callback registsred successfully");
                }
        } else {
@@ -4337,12 +3514,10 @@ int bt_gatt_client_unset_characteristic_value_changed_cb(bt_gatt_h characteristi
        int ret;
        bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s *)characteristic;
        gboolean is_indicate = false;;
-#ifdef TIZEN_GATT_CLIENT
-       bt_gatt_handle_property_t svc_handle;
-       bt_gatt_handle_property_t chr_handle;
+       bt_gatt_handle_prop_t svc_handle;
+       bt_gatt_handle_prop_t chr_handle;
        bt_gatt_service_s *service_s;
        bt_gatt_client_s  *client_s;
-#endif
 
        BT_CHECK_GATT_CLIENT_SUPPORT();
        BT_CHECK_INIT_STATUS();
@@ -4350,7 +3525,6 @@ int bt_gatt_client_unset_characteristic_value_changed_cb(bt_gatt_h characteristi
 
        BT_INFO("+");
 
-#ifdef TIZEN_GATT_CLIENT
        service_s = (bt_gatt_service_s*)chr->parent;
        client_s = (bt_gatt_client_s*)service_s->parent;
 
@@ -4360,25 +3534,19 @@ int bt_gatt_client_unset_characteristic_value_changed_cb(bt_gatt_h characteristi
 
        __bt_string_to_uuid_hex(chr->uuid, chr_handle.uuid);
        chr_handle.instance_id = chr->instance_id;
-#endif
 
        if (chr->properties & BT_GATT_PROPERTY_INDICATE)
                is_indicate = true;
 
        if (chr->properties &
                        (BT_GATT_PROPERTY_NOTIFY | BT_GATT_PROPERTY_INDICATE)) {
-#ifdef TIZEN_GATT_CLIENT
-               ret = _bt_get_error_code(bluetooth_gatt_client_watch_characteristics(
+               ret = bt_adapt_gatt_client_watch_char(
                                        client_s->remote_address,
                                        &svc_handle,
                                        &chr_handle,
                                        client_s->client_id,
                                        FALSE,
-                                       is_indicate));
-#else
-               ret = _bt_get_error_code(
-                               bluetooth_gatt_unwatch_characteristics(chr->path));
-#endif
+                                       is_indicate);
                if (ret != BT_ERROR_NONE)
                        BT_ERR("%s(0x%08x)",
                                _bt_convert_error_to_string(ret), ret);
@@ -4448,7 +3616,6 @@ int bt_gatt_client_set_service_changed_cb(bt_gatt_client_h client,
                bt_gatt_client_service_changed_cb callback, void *user_data)
 {
        int ret;
-       bluetooth_device_address_t bd_addr = { {0,} };
        bt_gatt_client_s *client_s = (bt_gatt_client_s *)client;
 
        BT_CHECK_GATT_CLIENT_SUPPORT();
@@ -4463,12 +3630,7 @@ int bt_gatt_client_set_service_changed_cb(bt_gatt_client_h client,
                return BT_ERROR_NONE;
        }
 
-       _bt_convert_address_to_hex(&bd_addr, client_s->remote_address);
-#ifdef TIZEN_GATT_CLIENT
-       ret = _bt_get_error_code(bluetooth_gatt_client_set_service_change_watcher(&bd_addr, TRUE));
-#else
-       ret = _bt_get_error_code(bluetooth_gatt_set_service_change_watcher(&bd_addr, TRUE));
-#endif
+       ret = bt_adapt_gatt_client_set_service_change_watcher(client_s->remote_address, TRUE);
 
        if (ret == BT_ERROR_NONE) {
                BT_INFO("Service Changed callback registered");
@@ -4484,19 +3646,14 @@ int bt_gatt_client_set_service_changed_cb(bt_gatt_client_h client,
 int bt_gatt_client_unset_service_changed_cb(bt_gatt_client_h client)
 {
        int ret;
-       bluetooth_device_address_t bd_addr = { {0,} };
        bt_gatt_client_s *client_s = (bt_gatt_client_s *)client;
 
        BT_CHECK_GATT_CLIENT_SUPPORT();
        BT_CHECK_INIT_STATUS();
        BT_CHECK_INPUT_PARAMETER(client);
 
-       _bt_convert_address_to_hex(&bd_addr, client_s->remote_address);
-#ifdef TIZEN_GATT_CLIENT
-       ret = _bt_get_error_code(bluetooth_gatt_client_set_service_change_watcher(&bd_addr, FALSE));
-#else
-       ret = _bt_get_error_code(bluetooth_gatt_set_service_change_watcher(&bd_addr, FALSE));
-#endif
+       ret = bt_adapt_gatt_client_set_service_change_watcher(client_s->remote_address, FALSE);
+
        if (ret == BT_ERROR_NONE) {
                BT_INFO("Service Changed callback unregistered [%s]", client_s->remote_address);
                client_s->service_changed_cb = NULL;
@@ -4508,7 +3665,7 @@ int bt_gatt_client_unset_service_changed_cb(bt_gatt_client_h client)
        return BT_ERROR_NONE;
 }
 
-#ifdef TIZEN_GATT_CLIENT
+#if 0
 /* LCOV_EXCL_START */
 void _bt_handle_gatt_client_char_read_completed_event(int result,
                        void *resp)
@@ -4921,16 +4078,13 @@ void _bt_handle_gatt_client_desc_write_completed_event(int result,
 int bt_gatt_client_request_att_mtu_change(bt_gatt_client_h client, unsigned int mtu)
 {
        int ret;
-       bluetooth_device_address_t addr_hex = { {0,} };
        bt_gatt_client_s *client_s = (bt_gatt_client_s *)client;
 
        BT_CHECK_GATT_CLIENT_SUPPORT();
        BT_CHECK_INIT_STATUS();
        BT_CHECK_INPUT_PARAMETER(client);
 
-       _bt_convert_address_to_hex(&addr_hex, client_s->remote_address);
-
-       ret = _bt_get_error_code(bluetooth_request_att_mtu(&addr_hex, mtu));
+       ret = bt_adapt_request_att_mtu(client_s->remote_address, mtu);
        if (BT_ERROR_NONE != ret)
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
 
@@ -4939,7 +4093,6 @@ int bt_gatt_client_request_att_mtu_change(bt_gatt_client_h client, unsigned int
 
 int bt_gatt_client_get_att_mtu(bt_gatt_client_h client, unsigned int *mtu)
 {
-       bluetooth_device_address_t addr_hex = { {0,} };
        int ret;
        unsigned int mtu_value = 0;
        bt_gatt_client_s *client_s = (bt_gatt_client_s *)client;
@@ -4948,9 +4101,7 @@ int bt_gatt_client_get_att_mtu(bt_gatt_client_h client, unsigned int *mtu)
        BT_CHECK_INIT_STATUS();
        BT_CHECK_INPUT_PARAMETER(client);
 
-       _bt_convert_address_to_hex(&addr_hex, client_s->remote_address);
-
-       ret = _bt_get_error_code(bluetooth_get_att_mtu(&addr_hex, &mtu_value));
+       ret = bt_adapt_get_att_mtu(client_s->remote_address, &mtu_value);
 
        if (ret != BT_ERROR_NONE) {
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
index c6dee28a0e42120da74e0c45a905ab4b3725f969..436b8d61cd05d1a48ab9be2d28673887ea57e891 100644 (file)
@@ -42,7 +42,7 @@
 #include "bluetooth_internal.h"
 #include "bluetooth_extension.h"
 #include "bluetooth_private.h"
-#include "bluetooth-telephony-api.h"
+//#include "bluetooth-telephony-api.h"
 #include "bt_unit_test.h"
 
 const char *spp_uuid = "00001101-0000-1000-8000-00805F9B7777";
@@ -329,16 +329,6 @@ 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},
-       {"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"
-               , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_WRITE_HOST_SUGGESTED_DEFAULT_DATA_LENGTH},
-       {"bt_adater_le_read_host_suggested_def_data_length"
-               , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_READ_HOST_SUGGESTED_DEFAULT_DATA_LENGTH},
-       {"bt_adapter_le_is_2m_phy_supported"
-               , BT_UNIT_TEST_FUNCTION_LE_2M_PHY_SUPPORT},
-       {"bt_adapter_le_is_coded_phy_supported"
-               , BT_UNIT_TEST_FUNCTION_LE_CODED_PHY_SUPPORT},
        {"Select this menu to set parameters and then select the function again."
                , BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS},
        {NULL                                   , 0x0000},
@@ -384,10 +374,6 @@ tc_table_t tc_device[] = {
                , BT_UNIT_TEST_FUNCTION_DEVICE_UNSET_REQUEST_ATT_MTU_CHANGED_CB},
        {"bt_device_get_att_mtu"
                                , BT_UNIT_TEST_FUNCTION_DEVICE_GET_ATT_MTU},
-       {"bt_device_le_set_data_length"
-               , BT_UNIT_TEST_FUNCTION_LE_DEVICE_SET_DATA_LENGTH},
-       {"bt_device_le_data_length_changed_cb"
-               , BT_UNIT_TEST_FUNCTION_LE_DEVICE_DATA_LENGTH_CHANGED_CB},
        {"Select this menu to set parameters and then select the function again."
                , BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS},
        {NULL                                   , 0x0000},
@@ -680,59 +666,6 @@ tc_table_t tc_hps[] = {
        {NULL                                   , 0x0000},
 };
 
-tc_table_t tc_pxp[] = {
-       /* HPS functions */
-       {"BACK"
-               , BT_UNIT_TEST_FUNCTION_BACK},
-       {"Proximity Reporter(Register)"
-               , BT_UNIT_TEST_FUNCTION_PXP_REPORTER_REGISTER},
-       {"Proximity Reporter(Unregister)"
-               , BT_UNIT_TEST_FUNCTION_PXP_REPORTER_UNREGISTER},
-       {"Proximity Reporter(Start Advertising Proximity Reporter)"
-               , BT_UNIT_TEST_FUNCTION_PXP_REPORTER_START_ADVERTISING},
-       {"Proximity Reporter (Set State Changed callback)"
-               , BT_UNIT_TEST_FUNCTION_PXP_REPORTER_SET_CONNECTION_STATE_CHANGED_CB},
-       {"Proximity Reporter (UnSet State Changed callback)"
-               , BT_UNIT_TEST_FUNCTION_PXP_REPORTER_UNSET_CONNECTION_STATE_CHANGED_CB},
-       {"Proximity Reporter (Set Property Changed callback)"
-               , BT_UNIT_TEST_FUNCTION_PXP_REPORTER_SET_PROPERTIES_CHANGED_CB},
-       {"Proximity Reporter (UnSet Property Changed callback)"
-               , BT_UNIT_TEST_FUNCTION_PXP_REPORTER_UNSET_PROPERTIES_CHANGED_CB},
-       {"Proximity Reporter(Read Linkloss Alert Level)"
-               , BT_UNIT_TEST_FUNCTION_PXP_REPORTER_READ_LINKLOSS_ALERT},
-       {"Proximity Reporter(Read Immediate Alert Level)"
-               , BT_UNIT_TEST_FUNCTION_PXP_REPORTER_READ_IMMEDIATE_ALERT},
-       {"Proximity Monitor(Create)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_CREATE},
-       {"Proximity Monitor(Destroy)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_DESTROY},
-       {"Proximity Monitor(Connect)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_CONNECT},
-       {"Proximity Monitor(Disconnect)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_DISCONNECT},
-       {"Proximity Monitor (Set State Changed callback)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_SET_CONNECTION_STATE_CHANGED_CB},
-       {"Proximity Monitor (UnSet State Changed callback)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_UNSET_CONNECTION_STATE_CHANGED_CB},
-       {"Proximity Monitor(Set LE Scan Filter for Proximity UUID)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_SET_SCAN_FILTER_SERVICE_UUID},
-       {"Proximity Monitor(Unet LE Scan Filter for Proximity UUID)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_UNSET_SCAN_FILTER_SERVICE_UUID},
-       {"Proximity Monitor(Write Linkloss Alert Level)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_WRITE_LINKLOSS_ALERT},
-       {"Proximity Monitor(Write Immediate Alert Level)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_WRITE_IMMEDIATE_ALERT},
-       {"Proximity Monitor(Read Linkloss Alert Level)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_READ_LINKLOSS_ALERT},
-       {"Proximity Monitor(Read Immediate Alert Level)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_READ_IMMEDIATE_ALERT},
-       {"Proximity Monitor(Read Signal Level)"
-               , BT_UNIT_TEST_FUNCTION_PXP_MONITOR_READ_SIGNAL_LEVEL},
-       {"Select this menu to set parameters and then select the function again."
-               , BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS},
-       {NULL                                   , 0x0000},
-};
-
 tc_table_t tc_avrcp[] = {
        /* AVRCP functions */
        {"BACK"
@@ -1294,9 +1227,6 @@ void tc_usage_print(void)
        case BT_UNIT_TEST_TABLE_DPM:
                tc_table = tc_DPM;
                break;
-       case BT_UNIT_TEST_TABLE_PXP:
-               tc_table = tc_pxp;
-               break;
        case BT_UNIT_TEST_TABLE_HF:
                tc_table = tc_hf;
                break;
@@ -1746,7 +1676,7 @@ void __bt_gatt_server_read_value_requested_cb(
 
        /* Get the attribute new values here */
        bt_gatt_server_send_response(request_id,
-               BLUETOOTH_GATT_ATT_REQUEST_TYPE_READ, offset,
+               BT_GATT_REQUEST_TYPE_READ, offset,
                resp_status, char_value_1, 3 - offset);
 }
 
@@ -1966,19 +1896,6 @@ static void __bt_adapter_le_state_changed_cb(int result,
                        "ENABLED" : "DISABLED");
 }
 
-static void __bt_le_set_data_length_changed_cb(int result,
-               const char *remote_address, int max_tx_octets,
-               int max_tx_time, int max_rx_octets,
-               int max_rx_time, void *user_data)
-{
-       TC_PRT("__bt_le_set_data_length_changed_cb \n");
-       TC_PRT("max_tx_octets: %d  max_tx_time: %d"
-                       "max_rx_octets: %d  max_rx_time: %d",
-                       max_tx_octets, max_tx_time,
-                       max_rx_octets, max_rx_time);
-       TC_PRT("result: %s", __bt_get_error_message(result));
-}
-
 void __bt_opp_client_push_responded_cb(int result,
                const char *remote_address, void *user_data)
 {
@@ -2618,46 +2535,6 @@ void __bt_proximity_reporter_property_changed_cb(int result, const char *remote_
        TC_PRT("prop_value : %d", prop_value);
 }
 
-void __bt_proximity_monitor_connection_state_changed_cb(int result, const char *remote_address,
-                       bt_proximity_monitor_h monitor_s, bool connected, int supported_service, void *user_data)
-{
-       TC_PRT("result: %s", __bt_get_error_message(result));
-       if (result == BT_ERROR_NONE) {
-               if (connected) {
-                       TC_PRT("PXP connected(address = %s)", remote_address);
-                       TC_PRT("PXP Reporter supported Service\n");
-                       if (supported_service & BT_PROXIMITY_LINKLOSS_ALERT)
-                               TC_PRT("BT_PROXIMITY_LINKLOSS_ALERT\n");
-                       if (supported_service & BT_PROXIMITY_IMMEDIATE_ALERT)
-                               TC_PRT("BT_PROXIMITY_IMMEDIATE_ALERT\n");
-                       if (supported_service & BT_PROXIMITY_TX_POWER)
-                               TC_PRT("BT_PROXIMITY_TX_POWER");
-               } else {
-                       TC_PRT("PXP DISconnected");
-               }
-       }
-}
-
-void __bt_proximity_reporter_connection_state_changed_cb(int result, const char *remote_address,
-                       bt_proximity_reporter_h reporter_s, bool connected, int supported_service, void *user_data)
-{
-       TC_PRT("result: %s", __bt_get_error_message(result));
-       if (result == BT_ERROR_NONE) {
-               if (connected) {
-                       TC_PRT("PXP connected(address = %s)", remote_address);
-                       TC_PRT("PXP Reporter supported Service\n");
-                       if (supported_service & BT_PROXIMITY_LINKLOSS_ALERT)
-                               TC_PRT("BT_PROXIMITY_LINKLOSS_ALERT\n");
-                       if (supported_service & BT_PROXIMITY_IMMEDIATE_ALERT)
-                               TC_PRT("BT_PROXIMITY_IMMEDIATE_ALERT\n");
-                       if (supported_service & BT_PROXIMITY_TX_POWER)
-                               TC_PRT("BT_PROXIMITY_TX_POWER");
-               } else {
-                       TC_PRT("PXP DISconnected");
-               }
-       }
-}
-
 void __tds_activation_req_cb(char *rem_bd_addr,
        bt_tds_transport_e transport, unsigned char *buf, int len, void *user_data)
 {
@@ -2697,7 +2574,7 @@ void __bt_gatt_server_write_value_requested_cb(const char *remote_address,
                printf("%d ", value[i]);
 
        bt_gatt_server_send_response(request_id,
-       BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE, offset,
+               BT_GATT_REQUEST_TYPE_WRITE, offset,
                resp_status, NULL, 0);
 
        printf("\n");
@@ -3725,22 +3602,6 @@ int test_set_params(int test_id, char *param)
                }
                break;
        }
-
-       case BT_UNIT_TEST_TABLE_PXP: {
-               switch (test_id) {
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_WRITE_LINKLOSS_ALERT:
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_WRITE_IMMEDIATE_ALERT:
-                       param_count = 1;
-                       TC_PRT("Input Value Type (avail. : \n0.NONE, \n1.MILD, \n2.HIGH");
-                       break;
-               default:
-                       TC_PRT("There is no param to set\n");
-                       need_to_set_params = false;
-                       break;
-               }
-               break;
-       }
-
        case BT_UNIT_TEST_TABLE_AVRCP: {
                switch (test_id) {
                default:
@@ -4979,51 +4840,6 @@ int test_input_callback(void *data)
 
                        break;
                }
-
-               case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_WRITE_HOST_SUGGESTED_DEFAULT_DATA_LENGTH: {
-
-                       TC_PRT("Testing: Write Host suggested default LE Data length");
-
-                       unsigned int def_tx_octects = 30;
-                       unsigned int def_tx_time = 330;
-                       ret = bt_adapter_le_write_host_suggested_default_data_length(
-                               def_tx_octects, def_tx_time);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_READ_HOST_SUGGESTED_DEFAULT_DATA_LENGTH: {
-
-                       TC_PRT("Read host suggested default LE Data length");
-
-                       unsigned int def_tx_octets = 0;
-                       unsigned int def_tx_time = 0;
-                       ret = bt_adapter_le_read_suggested_default_data_length(
-                               &def_tx_octets, &def_tx_time);
-                       TC_PRT("host suggested default le data length values are  %d %d",
-                                       def_tx_octets, def_tx_time);
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_LE_2M_PHY_SUPPORT: {
-
-                       TC_PRT("Check LE 2M PHY Feature support");
-                       bool is_2m_phy_supported = FALSE;
-
-                       ret = bt_adapter_le_is_2m_phy_supported(&is_2m_phy_supported);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       TC_PRT("LE 2M PHY Support [%s]", is_2m_phy_supported ? "YES" : "NO");
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_LE_CODED_PHY_SUPPORT: {
-
-                       TC_PRT("Check LE CODED PHY Feature support");
-                       bool is_coded_phy_supported = FALSE;
-
-                       ret = bt_adapter_le_is_coded_phy_supported(&is_coded_phy_supported);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       TC_PRT("LE CODED PHY Support [%s]", is_coded_phy_supported ? "YES" : "NO");
-                       break;
-               }
                case BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS:
                        need_to_set_params = true;
                        TC_PRT("Select the function again");
@@ -5213,39 +5029,6 @@ int test_input_callback(void *data)
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
                }
-               case BT_UNIT_TEST_FUNCTION_LE_DEVICE_SET_DATA_LENGTH: {
-
-                       TC_PRT("Set LE Data length paramters cmd");
-
-                       unsigned int tx_octets = 50;
-                       unsigned int tx_time = 500;
-
-                       if (g_test_param.param_count > 0) {
-                               tx_octets = atoi(g_test_param.params[0]);
-                               tx_time = atoi(g_test_param.params[1]);
-
-                               __bt_free_test_param(&g_test_param);
-                       }
-
-                       TC_PRT("settting le data length values  tx octects: %d  tx time: %d",
-                               tx_octets, tx_time);
-                       ret = bt_device_le_set_data_length(remote_addr,
-                               tx_octets, tx_time);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_LE_DEVICE_DATA_LENGTH_CHANGED_CB: {
-
-                       TC_PRT("Setting LE Data length change callback");
-
-                       ret = bt_device_le_set_data_length_change_cb(
-                               __bt_le_set_data_length_changed_cb,
-                               NULL);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                       break;
-               }
                case BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS:
                        need_to_set_params = true;
                        TC_PRT("Select the function again");
@@ -8717,261 +8500,6 @@ int test_input_callback(void *data)
                }
                break;
        }
-
-       case BT_UNIT_TEST_TABLE_PXP: {
-               switch (test_id) {
-               case BT_UNIT_TEST_FUNCTION_PXP_REPORTER_REGISTER: {
-                       if (reporter) {
-                               ret = bt_proximity_reporter_destroy(reporter);
-                               TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                               ret = bt_proximity_reporter_unset_property_changed_cb(reporter);
-                               TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                               ret = bt_proximity_reporter_unset_connection_state_changed_cb(reporter);
-                               TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                               reporter = NULL;
-                       }
-                       ret = bt_proximity_reporter_create(&reporter);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_REPORTER_UNREGISTER: {
-                       ret = bt_proximity_reporter_unset_connection_state_changed_cb(reporter);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                       ret = bt_proximity_reporter_unset_property_changed_cb(reporter);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-
-                       ret = bt_proximity_reporter_destroy(reporter);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       reporter = NULL;
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_CREATE: {
-                       if (monitor) {
-                               ret = bt_proximity_monitor_disconnect(monitor);
-                               TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                               ret = bt_proximity_monitor_unset_connection_state_changed_cb(monitor);
-                               TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                               ret = bt_proximity_monitor_destroy(monitor);
-                               TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                               monitor = NULL;
-                       }
-                       ret = bt_proximity_monitor_create(remote_addr, &monitor);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_DESTROY: {
-                       ret = bt_proximity_monitor_unset_connection_state_changed_cb(monitor);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                       ret = bt_proximity_monitor_destroy(monitor);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       monitor = NULL;
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_CONNECT: {
-                       ret = bt_proximity_monitor_connect(monitor);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_DISCONNECT: {
-                       ret = bt_proximity_monitor_disconnect(monitor);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_SET_CONNECTION_STATE_CHANGED_CB: {
-                       ret = bt_proximity_monitor_set_connection_state_changed_cb(monitor,
-                                       __bt_proximity_monitor_connection_state_changed_cb,
-                                       NULL);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_UNSET_CONNECTION_STATE_CHANGED_CB: {
-                       ret = bt_proximity_monitor_unset_connection_state_changed_cb(monitor);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_REPORTER_SET_CONNECTION_STATE_CHANGED_CB: {
-                       ret = bt_proximity_reporter_set_connection_state_changed_cb(reporter,
-                                       __bt_proximity_reporter_connection_state_changed_cb,
-                                       NULL);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_REPORTER_UNSET_CONNECTION_STATE_CHANGED_CB: {
-                       ret = bt_proximity_reporter_unset_connection_state_changed_cb(reporter);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_REPORTER_SET_PROPERTIES_CHANGED_CB: {
-                       ret = bt_proximity_reporter_set_property_changed_cb(reporter,
-                                       __bt_proximity_reporter_property_changed_cb,
-                                       NULL);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_REPORTER_UNSET_PROPERTIES_CHANGED_CB: {
-                       ret = bt_proximity_reporter_unset_property_changed_cb(reporter);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_SET_SCAN_FILTER_SERVICE_UUID: {
-                       if (pxp_scan_filter) {
-                               ret = bt_adapter_le_scan_filter_unset_proximity_uuid(pxp_scan_filter);
-                               TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                               ret = bt_adapter_le_scan_filter_destroy(pxp_scan_filter);
-                               TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                               pxp_scan_filter = NULL;
-                       }
-                       ret = bt_adapter_le_scan_filter_create(&pxp_scan_filter);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                       ret = bt_adapter_le_scan_filter_set_type(pxp_scan_filter,
-                                       BT_ADAPTER_LE_SCAN_FILTER_TYPE_PROXIMITY_UUID);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                       ret = bt_adapter_le_scan_filter_register(pxp_scan_filter);
-                       if (ret != BT_ERROR_NONE)
-                               TC_PRT("failed with [0x%04x]", ret);
-
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_UNSET_SCAN_FILTER_SERVICE_UUID: {
-                       ret = bt_adapter_le_scan_filter_unset_proximity_uuid(pxp_scan_filter);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-
-                       ret = bt_adapter_le_scan_filter_destroy(pxp_scan_filter);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       pxp_scan_filter = NULL;
-
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_REPORTER_START_ADVERTISING: {
-                       /* Add Reporter service in advertising data */
-                       advertiser = advertiser_list[advertiser_index];
-                       if (advertiser == NULL) {
-                               ret = bt_adapter_le_create_advertiser(&advertiser);
-                               if (ret != BT_ERROR_NONE) {
-                                       TC_PRT("created le advertiser(%d)", ret);
-                                       break;
-                               }
-
-                               advertiser_list[advertiser_index] = advertiser;
-                               ret = bt_adapter_le_set_advertising_device_name(advertiser,
-                                               BT_ADAPTER_LE_PACKET_SCAN_RESPONSE, true);
-                               if (ret != BT_ERROR_NONE) {
-                                       TC_PRT("set device name [0x%04x]", ret);
-                                       break;
-                               }
-                       }
-
-                       ret = bt_adapter_le_add_advertising_service_solicitation_uuid(advertiser,
-                                       BT_ADAPTER_LE_PACKET_ADVERTISING, PXP_IMMEDIATE_ALERT_SVC_UUID);
-                       if (ret != BT_ERROR_NONE) {
-                               TC_PRT("add service_solicitation_uuid [0x%04x]", ret);
-                               break;
-                       }
-
-                       ret = bt_adapter_le_add_advertising_service_solicitation_uuid(advertiser,
-                                       BT_ADAPTER_LE_PACKET_ADVERTISING, PXP_LINK_LOSS_SVC_UUID);
-                       if (ret != BT_ERROR_NONE) {
-                               TC_PRT("add service_solicitation_uuid [0x%04x]", ret);
-                               break;
-                       }
-
-                       /* Start advertising PXP Reporter service */
-                       bt_adapter_le_advertising_state_changed_cb cb;
-
-                       if (advertiser_index == 0) cb = __bt_adapter_le_advertising_state_changed_cb;
-                       else if (advertiser_index == 1) cb = __bt_adapter_le_advertising_state_changed_cb_2;
-                       else cb = __bt_adapter_le_advertising_state_changed_cb_3;
-
-                       advertiser = advertiser_list[advertiser_index];
-
-                       advertiser_index++;
-                       advertiser_index %= 3;
-
-                       TC_PRT("advertiser: %p", advertiser);
-
-                       ret = bt_adapter_le_start_advertising_new(advertiser, cb, NULL);
-                       if (ret < BT_ERROR_NONE)
-                               TC_PRT("failed with [0x%04x]", ret);
-
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_WRITE_LINKLOSS_ALERT: {
-                       int alert_value;
-                       if (g_test_param.param_count < 1) {
-                                       TC_PRT("Input parameters first");
-                                       break;
-                       }
-
-                       alert_value = atoi(g_test_param.params[0]);
-                       ret = bt_proximity_monitor_set_linkloss_alert(monitor, alert_value);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_WRITE_IMMEDIATE_ALERT: {
-                       int alert_value;
-                       if (g_test_param.param_count < 1) {
-                                       TC_PRT("Input parameters first");
-                                       break;
-                       }
-
-                       alert_value = atoi(g_test_param.params[0]);
-                       ret = bt_proximity_monitor_set_immediate_alert(monitor, alert_value);
-                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
-                       break;
-               }
-
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_READ_LINKLOSS_ALERT: {
-                       int alert_level = 0;
-                       ret = bt_proximity_monitor_get_linkloss_alert(monitor, &alert_level);
-                       TC_PRT("returns %s, alert_level: %d\n", __bt_get_error_message(ret), alert_level);
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_READ_IMMEDIATE_ALERT: {
-                       int alert_level = 0;
-                       ret = bt_proximity_monitor_get_immediate_alert(monitor, &alert_level);
-                       TC_PRT("returns %s, alert_level: %d\n", __bt_get_error_message(ret), alert_level);
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_MONITOR_READ_SIGNAL_LEVEL: {
-                       int alert_level = 0;
-                       ret = bt_proximity_monitor_get_signal_level(monitor, &alert_level);
-                       TC_PRT("returns %s, signal_level: %d\n", __bt_get_error_message(ret), alert_level);
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_REPORTER_READ_LINKLOSS_ALERT: {
-                       int alert_level = 0;
-                       ret = bt_proximity_reporter_get_linkloss_alert(remote_addr, &alert_level);
-                       TC_PRT("returns %s, alert_level: %d\n", __bt_get_error_message(ret), alert_level);
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_PXP_REPORTER_READ_IMMEDIATE_ALERT: {
-                       int alert_level = 0;
-                       ret = bt_proximity_reporter_get_immediate_alert(remote_addr, &alert_level);
-                       TC_PRT("returns %s, alert_level: %d\n", __bt_get_error_message(ret), alert_level);
-                       break;
-               }
-               case BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS:
-                       need_to_set_params = true;
-                       TC_PRT("Select the function again");
-                       break;
-
-               default:
-                       break;
-               }
-               break;
-       }
-
        case BT_UNIT_TEST_TABLE_HF: {
                switch (test_id) {
                case BT_UNIT_TEST_FUNCTION_HF_INITIALIZE:
@@ -9315,7 +8843,7 @@ int test_input_callback(void *data)
                }
                case BT_UNIT_TEST_FUNCTION_TDS_CUSTOM_PROVIDER_SEND_ACTIVATION_RESP: {
                        ret = bt_tds_provider_send_activation_resp(
-                                       tds_act_address, BLUETOOTH_ERROR_NONE, provider);
+                                       tds_act_address, BT_ERROR_NONE, provider);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
                }