From: DoHyun Pyun Date: Thu, 12 Dec 2019 07:57:33 +0000 (+0900) Subject: Add the check logic for the client connection X-Git-Tag: accepted/tizen/unified/20191224.131912~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F219993%2F7;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Add the check logic for the client connection Change-Id: Ib5badd216863f93a0776aedcd7b645e3ee9096e9 Signed-off-by: DoHyun Pyun --- diff --git a/bt-service-adaptation/services/gatt/bt-service-gatt.c b/bt-service-adaptation/services/gatt/bt-service-gatt.c index a0413c0..afaf5b8 100644 --- a/bt-service-adaptation/services/gatt/bt-service-gatt.c +++ b/bt-service-adaptation/services/gatt/bt-service-gatt.c @@ -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; }