[PATCH BlueZ 2/3] shared/gatt-client: Fix failing to discover included attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

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.20.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux