Add the check logic for the client connection 93/219993/7
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 12 Dec 2019 07:57:33 +0000 (16:57 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 13 Dec 2019 00:16:06 +0000 (09:16 +0900)
Change-Id: Ib5badd216863f93a0776aedcd7b645e3ee9096e9
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-service-adaptation/services/gatt/bt-service-gatt.c

index a0413c0..afaf5b8 100644 (file)
@@ -3990,8 +3990,22 @@ gboolean _bt_is_remote_gatt_device_connected(bluetooth_device_address_t *address
        if (conn_info) {
                BT_INFO("Remote GATT Server device [%s] is Connected", conn_info->addr);
                connected = TRUE;
-       } else
+       } else {
+               struct gatt_client_info_t *client_info = NULL;
+
                BT_INFO("Remote GATT Server Device [%s] is not Connected", addr);
+
+               /* Check if device is already in connected list */
+               client_info = __bt_find_remote_gatt_client_info(addr);
+
+               if (client_info) {
+                       BT_INFO("Remote Client device [%s] is Connected", client_info->addr);
+                       connected = TRUE;
+               } else {
+                       BT_INFO("Remote GATT Client Device [%s] is not Connected", addr);
+               }
+       }
+
        g_free(addr);
        return connected;
 }