Disable GATT Client fd based function 58/190558/1 accepted/tizen/unified/20181005.012503 submit/tizen/20181004.010949
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 4 Oct 2018 00:58:07 +0000 (09:58 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 4 Oct 2018 01:00:02 +0000 (10:00 +0900)
After applying the security patchset, we will enable this feature.
To pass the web manaul TC, we disable this feature in now.

Change-Id: I35cb8e79bf0aba5a4b27171db1c0f22346e32f44
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-api/bt-gatt-client.c
bt-service-adaptation/services/bt-request-handler.c
packaging/bluetooth-frwk.spec

index 44d80fc..87819c4 100755 (executable)
@@ -2235,6 +2235,7 @@ static gboolean  bluetooth_gatt_client_notify_channel_watch_cb(GIOChannel *gio,
        return TRUE;
 }
 
+#ifndef TIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE
 static bt_gatt_characteristic_notify_info_t * bluetooth_gatt_client_get_characteristic_notify_info(unsigned  char *handle , int id)
 {
        GSList *l;
@@ -2246,6 +2247,7 @@ static bt_gatt_characteristic_notify_info_t * bluetooth_gatt_client_get_characte
        }
        return NULL;
 }
+#endif
 
 static bt_gatt_characteristic_notify_info_t *  bluetooth_gatt_client_create_watch_io(int fd, int id, int mtu, char * address, unsigned char *uuid)
 {
@@ -2289,6 +2291,7 @@ BT_EXPORT_API int bluetooth_gatt_client_watch_characteristics(
        BT_CHECK_PARAMETER(service_handle, return);
        BT_CHECK_PARAMETER(char_handle, return);
 
+#ifndef TIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE
        chr_info = bluetooth_gatt_client_get_characteristic_notify_info(char_handle->uuid , char_handle->instance_id);
        if (chr_info && !is_notify) {
                BT_INFO("Already CCCD enabled. fd %d", chr_info->notify_fd);
@@ -2296,6 +2299,7 @@ BT_EXPORT_API int bluetooth_gatt_client_watch_characteristics(
                close(chr_info->notify_fd);
                return result;
        }
+#endif
 
        /* ASync Function, result expected in callback from bt-service */
 
@@ -2318,6 +2322,16 @@ BT_EXPORT_API int bluetooth_gatt_client_watch_characteristics(
        g_array_append_vals(in_param3, &is_notify, sizeof(gboolean));
        g_array_append_vals(in_param4, &is_indicate, sizeof(gboolean));
 
+#ifdef TIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE
+       result = _bt_send_request(BT_BLUEZ_SERVICE,
+                       BT_GATT_WATCH_CHARACTERISTIC,
+                       in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       BT_INFO("Result [%d]", result);
+       return result;
+#endif
 
        GUnixFDList *out_fd_list = NULL;
 
@@ -2577,6 +2591,10 @@ BT_EXPORT_API int bluetooth_gatt_client_write_characteristic_value_by_type(
        g_array_append_vals(in_param2, data, sizeof(bluetooth_gatt_att_data_t));
        g_array_append_vals(in_param3, &write_type, sizeof(bluetooth_gatt_write_type_e));
 
+#ifdef TIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE
+       goto done;
+#endif
+
        if (write_type == BLUETOOTH_GATT_TYPE_WRITE_NO_RESPONSE) {
                int fd = -1;
                int mtu = 0;
index 1428e4a..3fa19cb 100644 (file)
@@ -2706,6 +2706,10 @@ int __bt_bluez_request(int function_name,
                __bt_service_get_parameters(in_param4, &is_indicate,
                                sizeof(gboolean));
 
+#ifdef TIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE
+               goto normal;
+#endif
+
                if (is_indicate == false) {
                        result   = _bt_gatt_acquire_notify(&param , &fd, &mtu);
                        if (BLUETOOTH_ERROR_NONE == result && fd > -1) {
index 4503076..7d2e857 100644 (file)
@@ -18,6 +18,7 @@ Source1001: bluetooth-frwk.manifest
 Requires: bluetooth-tools
 
 %define bt_bluez_hal ENABLED
+%define bt_gatt_client_fd DISABLED
 
 BuildRequires:  pkgconfig(aul)
 BuildRequires:  pkgconfig(dlog)
@@ -253,6 +254,10 @@ export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
 %endif
 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
 
+%if %{bt_gatt_client_fd} == DISABLED
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE"
+%endif
+
 %ifarch %{ix86} x86_64
 export CFLAGS+=" -DTIZEN_TEST_EMUL"
 export CXXFLAGS+=" -DTIZEN_TEST_EMUL"