Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux BlueZ dbus communication

I work with BlueZ 5.30 and kernel 3.13.0-32 and I need to implement in my app read/write characteristics functionality via DBus.

I'm using BlueZ test scripts to established connection:

"test-discovery", and then "test-device connect".

the problem is I don't see any services displayed in DBus (org.bluez). Using d-feet app I can only see:

"/org/bluez/hci0/dev_btaddr" Interfaces org.bluez.Device1 org.freedesktop/DBus.Introspectable org.freedesktop.DBus.Properties

and in "/var/log/syslog" I can see many of:

" bluetoothd[715]: Unable to register GATT service with handle 0x0045 for device..."

using gatttool I'm able to read/write characteristics, primaries etc. Under hcidump I see all of characteristics are read properly.

But, from DBus PoV only Device1 interface is available.

here is my BlueZ configuration: " ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-library --disable-systemd --enable-experimental --enable-maintainer-mode --enable-debug "

I was looking here: "http://i-miss-erin.blogspot.com/2010/12/gatt-related-dbus-api.html" but as I mentioned, don't have any interface or services which are displayed here.

For test I use proximity and hid devices. In case of hid, after proper connection I can see chars in the terminal window (hid keyboard device) so I assume it works correctly.

Any suggestions?

like image 582
Marcin Joppek Avatar asked Jul 13 '15 10:07

Marcin Joppek


1 Answers

You have to activate the experimental features for your bluetooth set in order to get GATT services enabled.

On a Debian system you can achieve this by putting

NOPLUGIN_OPTION="-E"

into the /etc/default/bluetooth file.

After restart, in order to get my device (Logitech MX Master) working properly on my Debian Stretch, I also had to pair and trust it manually using the bluetoothctl command. I had no success with the graphical bluetooth tool from Gnome.

like image 65
f00b43r Avatar answered Sep 28 '22 09:09

f00b43r