From: Paulo Borges <paulo.borges@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Cc: Paulo Borges <paulo.borges@openbossa.org>
Subject: [PATCH 4/4] gatt: Improve characteristics discovery
Date: Fri, 30 Nov 2012 15:31:33 -0300 [thread overview]
Message-ID: <1354300294-9105-4-git-send-email-paulo.borges@openbossa.org> (raw)
In-Reply-To: <1354300294-9105-1-git-send-email-paulo.borges@openbossa.org>
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 b834b13..38c050e 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) {
--
1.7.9.5
next prev parent reply other threads:[~2012-11-30 18:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 18:31 [PATCH 1/4] gas: Fix memory leak at gas struct removal Paulo Borges
2012-11-30 18:31 ` [PATCH 2/4] input: Fix memory leak at hogdev " Paulo Borges
2012-11-30 18:31 ` [PATCH 3/4] gatt: Fix memory leak in characteristic discovery Paulo Borges
2012-11-30 18:31 ` Paulo Borges [this message]
2012-12-01 9:11 ` [PATCH 1/4] gas: Fix memory leak at gas struct removal Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1354300294-9105-4-git-send-email-paulo.borges@openbossa.org \
--to=paulo.borges@openbossa.org \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox