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

Ayberk Özgür ayberk.ozgur at epfl.ch
Sat Nov 26 12:34:38 CET 2016


Hi Alexander, thanks for your reply.

It's not noted in the API but given a `QBluetoothSocket`, I was 
wondering what `socketDescriptor` corresponds to and whether I can use 
that somehow to obtain the socket pointer that can be used with Bluez' 
`bind()`?

In any case, is there planned support for binding a `QBluetoothSocket` 
to a `QBluetoothAddress`? Should I open a feature request in the issue 
tracker?

As a final note: On various Android devices (that already have Bluetooth 
adapters on board), I attached external dongles via OTG and they are 
indeed listed by `lsusb`. However, nothing happens as far as the 
Bluetooth stack is concerned, I don't even think there is any support 
for enumerating adapters in the Android Bluetooth stack.

On 25.11.2016 12:35, Alexander Blasche wrote:
>
>> -----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
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-- 
Ayberk Özgür, Doctoral Researcher
CHILI Laboratory, EPFL
www.ayberkozgur.com




More information about the Interest mailing list