From 38be6726f5cfca549cc298b66108d23ee77f51a0 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 18 Mar 2019 18:14:00 +0200 Subject: [PATCH] shared/gatt-client: Fix failing to discover included attributes When there exists a included service a descriptor may already exists in the handle location so instead of failing check if the UUID matches and then skip to the next descriptor. --- src/shared/gatt-client.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index ec1041f66..858209c24 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -815,6 +815,11 @@ static void discover_descs_cb(bool success, uint8_t att_ecode, &uuid, 0, NULL, NULL, NULL); if (!attr) { + attr = gatt_db_get_attribute(client->db, handle); + if (attr && !bt_uuid_cmp(&uuid, + gatt_db_attribute_get_type(attr))) + continue; + util_debug(client->debug_callback, client->debug_data, "Failed to insert descriptor at 0x%04x", handle); -- 2.47.3