[SailfishDevel] Known Bluetooth devices

Bea Lam bea.lam at jolla.com
Tue Jun 24 03:49:39 UTC 2014


On 24 Jun 2014, at 11:30 am, Tomasz Sterna <tomek at xiaoka.com> wrote:

> Hello.
> 
> Is there a way of obtaining a list of known BT devices from pure Qt C++?
> 
> I know there is KnownDevicesModel in Sailfish.Bluetooth QML module, but
> I would like to get that information on C++ level - in an command-line
> application running without UI.

Hi Tomasz, 

I suggest using the BlueZ 4.x API directly through QtDBus until there is public API support for Bluetooth functionality. You can call org.bluez.Adapter.GetProperties and check the “Devices” property in the returned map to get a list of object paths for known devices. This is what KnownDevicesModel does internally. 

We would like to provide some kind of public API support for Bluetooth in the future — in the form of QtBluetooth support, for example — though this will be some way off.

cheers,
Bea


More information about the Devel mailing list