Fix server_instance not found issue 70/226570/1
authorWootak Jung <wootak.jung@samsung.com>
Mon, 2 Mar 2020 04:32:06 +0000 (13:32 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Wed, 4 Mar 2020 03:17:48 +0000 (12:17 +0900)
advertising will be failed if gatt client is registered in advance

Change-Id: I963623f6da9857aa774d9fde2e4a0446be223030

bt-service-adaptation/services/gatt/bt-service-gatt.c

index 2a93723..164f14e 100644 (file)
@@ -521,6 +521,9 @@ void _bt_update_adv_handle(const char *sender, int adv_handle)
 
        for (k = 1; k < MAX_APPS_SUPPORTED; k++) {
                info = &numapps[k];
+               /* Do not update client instance */
+               if (info->instance_id == -1)
+                       continue;
                /* Search for a app which has same sender and adv handle as 0 */
                if (!g_strcmp0(info->sender, sender) && info->adv_handle == 0)
                        info->adv_handle = adv_handle;