From: Andrejs Hanins <andrejs.hanins@ubnt.com>
To: "linux-bluetooth@vger.kernel.org"
<linux-bluetooth@vger.kernel.org>,
marcin.kraglak@tieto.com, szymon.janc@tieto.com
Subject: Non-consecutive handle values in GATT
Date: Wed, 04 Mar 2015 20:45:44 +0200 [thread overview]
Message-ID: <54F752D8.1000605@ubnt.com> (raw)
Hello,
I'm experimenting with an LE peripheral device which provides GATT
services described by attributes with non-consecutive handle values,
i.e. there are "gaps" between handle values. According to the Bluetooth
Core specification 4.0 (Volume 3, Part G, "2.5.1 Overview") it is allowed:
Although the Attribute Handle values are in increasing order,
following Attribute Handle values may differ by more than one.
Based on my experiments, BlueZ 5.28 and also git-master as of today
does not support non-consecutive handle values GATT table. As a result,
I can't connect to my device because gatt-client fails to initialize
properly. The failing place is in discover_descs():
if (gatt_db_attribute_get_handle(attr) !=
chrc_data->value_handle)
goto failed;
The value of chrc_data->value_handle is correct and matches GATT
table one the device, but the attr->handle has the value of previous
attribute (Primary Service UUID in my case) +2. This handle value
calculation happens in gatt_db_service_add_characteristic() which has
strange code:
/* We set handle of characteristic value, which will be added next */
put_le16(get_handle_at_index(service, i - 1) + 2, &value[1]);
Before trying to fix the problem by myself it would be great to
hear some comments about this issue. Does it seem like a bug or I missed
something?
As a note, I can successfully connect to my LE peripheral from an
iPhone LightBlue app, which does not posses any issues during GATT
discovery and can read/write the characteristic on the device.
BR, Andrey
next reply other threads:[~2015-03-04 18:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-04 18:45 Andrejs Hanins [this message]
2015-03-04 21:39 ` Non-consecutive handle values in GATT Arman Uguray
2015-03-04 22:21 ` Lukasz Rymanowski
2015-03-04 22:34 ` Andrejs Hanins
2015-03-05 8:39 ` Luiz Augusto von Dentz
2015-03-16 11:05 ` Luiz Augusto von Dentz
2015-03-16 13:20 ` Andrejs Hanins
2015-03-16 13:54 ` Andrejs Hanins
2015-03-16 14:13 ` Luiz Augusto von Dentz
2015-03-16 14:22 ` Andrejs Hanins
2015-03-17 13:07 ` Luiz Augusto von Dentz
2015-03-17 13:33 ` Andrejs Hanins
2015-03-17 15:01 ` Luiz Augusto von Dentz
2015-03-18 13:27 ` Luiz Augusto von Dentz
2015-03-18 13:54 ` Andrejs Hanins
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=54F752D8.1000605@ubnt.com \
--to=andrejs.hanins@ubnt.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcin.kraglak@tieto.com \
--cc=szymon.janc@tieto.com \
/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