[Interest] [Qt Bluetooth] How to choose local adapter when connecting to service with QBluetoothSocket?

Alexander Blasche alexander.blasche at qt.io
Fri Nov 25 12:35:15 CET 2016



> -----Original Message-----
> From: Interest [mailto:interest-bounces+alexander.blasche=qt.io at qt-
> project.org] On Behalf Of Ayberk Özgür
> Sent: Friday, 25 November 2016 09:39
> To: interest at qt-project.org
> Subject: [Interest] [Qt Bluetooth] How to choose local adapter when connecting
> to service with QBluetoothSocket?
> 
> Hello,
> 
> In the presence of multiple Bluetooth adapters, is it possible to specify which
> local adapter to use when creating a QBluetoothSocket or calling
> QBluetoothSocket::connectToService()?

The local adapter cannot be chosen everywhere. The following API elements support the feature you are describing:

QBluetoothLocalDevice(QBluetoothAddress, , QObject*)
QBluetoothDeviceDiscoveryAgent(QBluetoothAddress, QObject*)
QBluetoothServiceDiscoveryAgent(QBluetoothAddress, QObject*)
QBluetoothServer::listen(QBluetoothAddress, QString)

None of the other classes has support for it.

> I'm interested in Linux/BlueZ as well as
> Android (where it is not even clear whether multiple Bluetooth adapters are
> supported by the Bluetooth stack).

The behaviour above was tested for Bluez. In theory this should work on Android as well but since I have yet to get an Android device that actually has two adapters it was never tested and I would not rule out essential implementation details missing. In fact, I have even seen comments indicating that Android as platform was not really tested for such a setup. There might be problems there too.


--
Alex


More information about the Interest mailing list