From a5c67459d87a95209fd9b58e00ef91456b574d1a Mon Sep 17 00:00:00 2001 From: Paulo Borges Date: Fri, 30 Nov 2012 15:31:33 -0300 Subject: [PATCH] gatt: Improve characteristics discovery In the Discover Characteristics by UUID sub-procedure, if a fetched characteristic doesn't matches with the target UUID, all others characteristics in that response were discarded. Because of this, the procedure will make a new request to possibly rediscover the characteristics in the range beyond this last characteristic. At present, this procedure works because the gatt library will send a Read by Type Request starting at the first attribute after the non matching characteristic. This commit makes the rest of the characteristics to be checked for a matching type, which should reduce the number of requests sent during the discovery of characteristics. --- attrib/gatt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attrib/gatt.c b/attrib/gatt.c index b834b1345..38c050ed3 100644 --- a/attrib/gatt.c +++ b/attrib/gatt.c @@ -476,7 +476,7 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen, uuid = att_get_uuid128(&value[5]); if (dc->uuid && bt_uuid_cmp(dc->uuid, &uuid)) - break; + continue; chars = g_try_new0(struct gatt_char, 1); if (!chars) { -- 2.47.3