Fix uuid duplication issue 79/299579/1
authorWootak Jung <wootak.jung@samsung.com>
Thu, 5 Oct 2023 04:44:30 +0000 (13:44 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 5 Oct 2023 07:51:29 +0000 (16:51 +0900)
Same uuids are in used if client instance register request is coming
right before server instance initialized

Change-Id: I93438ae0cadbceefc6c819454bfec3776e40ddb6
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
bt-service/services/gatt/bt-service-gatt.c

index d269975..8df68da 100644 (file)
@@ -3857,7 +3857,7 @@ int _bt_register_gatt_client_instance(const char *sender,
        /* App should ensure that it should not send */
        BT_INFO("Check on which instance GATT Client instance can be initialized....");
        for (k = 1; k < MAX_APPS_SUPPORTED; k++) {
-               if (numapps[k].is_initialized == 1) {
+               if (numapps[k].is_initialized == 1 || strlen(numapps[k].uuid) > 0) {
                        BT_DBG("Instance ID [%d] is already in use..Check next slot",
                                        numapps[k].instance_id);
                } else {