Fwd: GATT server example issues in BlueZ
flat view
From: Ivan Deviatkin <hidden>
Date: 2016-03-02 11:16:35
Dears,
I am working on GATT server application and would like to use BlueZ for that.
Unfortunately, I have faced different issues during trying to
establish working GATT server from examples provided by Bluez.
First of all, I have tried to run gatt_example plugin from Bluez
package in Ubuntu environment (14.04 LTS 32 bit and 15.10 64 bit).
For that I have rebuild from source 5.37 (Ubuntu 14.04, default BlueZ
- 4.x) and 5.35 (Ubuntu 15.10 - default Bluez 5.35) with:
$ ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc
--localstatedir=/var --enable-experimental --enable-debug
--enable-maintainer-mode
--with-systemdsystemunitdir=/lib/systemd/system
--with-systemduserunitdir=/usr/lib/systemd
And I have ran "bluetoothd" (previously configured my Bluetooth
dongle Cirago BTA8000) via:
$ sudo ./bluetoothd --plugin=gatt_example -nEd
To communicate to my Linux environment I have used Android Nexus 6
with "BLE Scanner" application (I have checked also with other
applications - result the same). However it works as expected only for
version 5.27.
Starting from 5.28 till latest 5.37 it does not work to me. Logs
shows issue: "Not enough free handles to register service" (See logs
attached).
It looks similar to one mentioned here -
http://stackoverflow.com/questions/29891254/bluez-5-30-not-enough-free-handles-to-register-service-error-in-starting-blue.
I have checked this link, and can see, that method which adding
servers to "servers glist" btd_adapter_gatt_server_start() is called
in 5.27 but not called in 5.37 at all.
Additionally I have checked python example "example-gatt-server"
from \tests - it reports that GATT server is running but in bluetoothd
logs still the same issue.
Also I have tried to work with BlueZ D-Bus interface
(experimental) but I can see that some methods used during registering
of external service via D-Bus are not fully implemented yet, see
example (bluez 5.37/tools/gatt_service, line 414):
“ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
"{sv}", &dict);
/* TODO: Add options dictionary */ <-- it means what it
is not finished, right?
”
It seems to me, that without passing dictionary it is impossible
to register external service. Because dictionary includes information
about characteristics of service.
May I kindly ask you to clarify to me next:
- Should I apply manual fix (call of
btd_adapter_gatt_server_start() method or some other way of adding
server to list) for that in Bluez 5.37 source? If "yes" what is the
proper place to do that from design point of view?
- What is recommended (and working) example in BlueZ package to
run GATT server?
- What is recommended code to follow as example/sample for my own
GATT server application?
- If I would like to participate in development of BlueZ
(http://git.kernel.org/cgit/bluetooth/bluez.git) who is the right
person to get latest GATT serevr status and ask design questions, to
apply fixes in proper place?
BR,
Ivan Attachments
- log.log [application/octet-stream] 10755 bytes