[Interest] QBluetoothServiceDiscoveryAgent cannot retrieve sdp uuids

Alex Blasche alexander.blasche at qt.io
Thu Aug 16 07:51:27 CEST 2018



> -----Original Message-----
> From: Interest <interest-bounces+alexander.blasche=qt.io at qt-project.org> On
> Behalf Of Jérôme Godbout
> Sent: Wednesday, 15 August 2018 21:55
> To: Qt Interest <interest at qt-project.org>
> Subject: [Interest] QBluetoothServiceDiscoveryAgent cannot retrieve sdp uuids
> 
> Hi,
> I'm trying to discover some particular Bluetooth device on Android, but I have
> some trouble using the QBluetoothServiceDiscoveryAgent. Here's the workflow:
> 
> 1.	Scan using QBluetoothDeviceDiscoveryAgent to discovers all devices.
> 2.	Wait for scan to complete, wait for finished() signal.
> 3.	Start a scan  QBluetoothServiceDiscoveryAgent for found devices one by
> one. Using start(QBluetoothServiceDiscoveryAgent::MinimalDiscovery). I always
> end up with the following error: cannot retrieve sdp uuids.

Minimal discovery only uses cached SDP values. If the platform does not have any values the above message is the result. You have to do an active scan/FullDiscovery.

> If I try the complete
> discovery it just crash hard!

This is a problem. Please report a bug (https://bugreports.qt.io) that included your Qt version, a stack trace and ideally a small test program that reproduces the problem for you.

> I want to discover any device that can offer a particular services and I don't
> controls device name nor the advertising of the BLE devices. Anyway to do this?
> Or is it a bug with my Android device or am I using it improperly?

If you are looking for BLE services they cannot be retrieved using the SDP (QBluetoothServiceDiscoveryAgent) unless the device choose to use a classic advertisement too. That's usually not the case though.


> Do I have to use QLowEnergyControl and connect to each device one by one to
> fetch the services list on Android to do this?

Usually you should be able to identify the device using the device discovery already as the device discovery reveals quite a bit of information already. Otherwise yes, you actually have to connect.

--
Alex


More information about the Interest mailing list