labapart / gattlib

Library to access GATT information from BLE (Bluetooth Low Energy) devices
http://labapart.com/
454 stars 160 forks source link

How to get connected devices? #130

Open zewenhs opened 5 years ago

zewenhs commented 5 years ago

After scan and connect we can get the BLE device object which is broadcasting, then communication with it by gattlib, but in some cases, need to communication with an already connected devices , for example, an BLE remote controller have already connected to the master, we can't disconnect the remote controller then scan and connect to it with gattlib . so now we need to get an connected device object and use gattlib do further thing. how to do with this? thanks!

xloem commented 3 years ago

I looked into this a little. It looks like bluez doesn't return connected devices in discovery results. They can be enumerated via dbus similar to services or characteristics, but I don't see code in gattlib to do that yet, so this is probably a feature request, and a documentation bug that the limitation isn't documented.