Fixed the return status for indicate property 27/190227/1 submit/tizen/20180930.234221
authorAmit Purwar <amit.purwar@samsung.com>
Fri, 28 Sep 2018 09:18:53 +0000 (14:48 +0530)
committerAmit Purwar <amit.purwar@samsung.com>
Fri, 28 Sep 2018 09:26:27 +0000 (14:56 +0530)
Return status for indicate property of characteristic
is fixed in set characteristic changed value cb for
TFIVE-14433 TFIVE-14439 issue

Change-Id: Ia3ef28961ef71fb81e7d74bce457e54a99ba3cb5
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
bt-api/bt-gatt-client.c

index 9e3d0d8..44d80fc 100755 (executable)
@@ -2329,29 +2329,30 @@ BT_EXPORT_API int bluetooth_gatt_client_watch_characteristics(
                BT_ERR("Fail to send request");
                BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
                return result;
-       } else if (NULL == out_fd_list) {
-               BT_ERR("out_fd_list is NULL");
-               result = BLUETOOTH_ERROR_INTERNAL;
-
-       } else {
-
-               int *fd_list_array;
-               int len = 0;
-               int mtu;
-               int fd = -1;
-
-               fd_list_array = g_unix_fd_list_steal_fds(out_fd_list, &len);
-               BT_INFO("Num fds in fd_list is : %d, fd_list[0]: %d", len, fd_list_array[0]);
-               fd = fd_list_array[0];
-               mtu =  g_array_index(out_param, int, 0);
+       }
 
-               chr_info = bluetooth_gatt_client_create_watch_io(fd, char_handle->instance_id, mtu, (char *)address, char_handle->uuid);
+       if (is_indicate == false) {
+               if (NULL == out_fd_list) {
+                       BT_ERR("out_fd_list is NULL");
+                       result = BLUETOOTH_ERROR_INTERNAL;
+               } else {
+                       int *fd_list_array;
+                       int len = 0;
+                       int mtu;
+                       int fd = -1;
+
+                       fd_list_array = g_unix_fd_list_steal_fds(out_fd_list, &len);
+                       BT_INFO("Num fds in fd_list is : %d, fd_list[0]: %d", len, fd_list_array[0]);
+                       fd = fd_list_array[0];
+                       mtu =  g_array_index(out_param, int, 0);
 
-               gatt_characteristic_notify_list = g_slist_append(gatt_characteristic_notify_list, chr_info);
+                       chr_info = bluetooth_gatt_client_create_watch_io(fd, char_handle->instance_id, mtu, (char *)address, char_handle->uuid);
 
-               g_free(fd_list_array);
-               g_object_unref(out_fd_list);
+                       gatt_characteristic_notify_list = g_slist_append(gatt_characteristic_notify_list, chr_info);
 
+                       g_free(fd_list_array);
+                       g_object_unref(out_fd_list);
+               }
        }
 
        /*result = _bt_send_request(BT_BLUEZ_SERVICE,