[Interest] QBluetoothServiceDiscoveryAgent cannot retrieve sdp uuids

Jérôme Godbout godboutj at amotus.ca
Thu Aug 16 21:32:18 CEST 2018


If it might help (since I don't have a stack trace, I will try to extract
Android HCI log to see if there is any info into it). Here is the console
information I have:

D/MyApp( 8516): ..\MyApp\BleMgr.cpp:174 (bool
BleMgrPrivate::checkForDevicesServices()): ---------  Start device service
discovery:  "4F:DA:03:3C:5F:6D"
D/BluetoothAdapter( 8516): getName
D/BluetoothAdapter( 8516): getAddress
D/BluetoothDevice( 8516): fetchUuidsWithSdp
D/BluetoothAdapter( 8516): onBluetoothServiceDown:
android.bluetooth.IBluetooth$Stub$Proxy at 2ef0eed9
D/BluetoothAdapter( 8516): onBluetoothServiceUp:
android.bluetooth.IBluetooth$Stub$Proxy at 3a32009e
D/BluetoothAdapter( 8516): onBluetoothServiceDown:
android.bluetooth.IBluetooth$Stub$Proxy at 3a32009e
D/BluetoothAdapter( 8516): onBluetoothServiceUp:
android.bluetooth.IBluetooth$Stub$Proxy at 1bae977f
--------------System Bluetooth Service Crash HERE with popup
------------------------
D/MyApp( 8516): ..\MyApp\BleMgr.cpp:287 (void
BleMgrPrivate::serviceDiscoveryError(QBluetoothServiceDiscoveryAgent::Error)):
"Error occured with service discovery 2"
D/MyApp( 8516): ..\MyApp\BleMgr.cpp:273 (void
BleMgrPrivate::serviceDiscoveryFinished()): ---------  Service discovery
completed.
D/MyApp( 8516): ..\MyApp\BleMgr.cpp:205 (void
BleMgrPrivate::checkServiceIsCompatible()): Device encounter error during
service scan, irgnore this device for now:  "4F:DA:03:3C:5F:6D"

On 16 August 2018 at 15:12, Jérôme Godbout <godboutj at amotus.ca> wrote:

> I also tried to recreate a new service agent for each scan, with the same
> result. The BLE stack crash and system notify with popup.
>
> On 16 August 2018 at 15:10, Jérôme Godbout <godboutj at amotus.ca> wrote:
>
>> > 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.
>>
>> How can we check if the device support the minimal discovery method? I
>> just get an empty result and a trace into the console. It's like it failed
>> silently to the application code and only leave a trace into the debug
>> console.
>>
>> >  This is a problem. Please report a bug
>> As for the full discovery I end up with the following error popup on the
>> Android device from the system*:*
>> *"Unfortunately, Bluetooth Share has stopped."* with an ok button. After
>> that the whole blueooth is shutdown on the device!
>> it's the system Bluetooth stack that crash hard! The scan emit error
>> signal: PoweredOffError
>> Seem like if the device cannot be reach on the second scan it does crash
>> the bluetooth stack and bring the Android Bluetooth service along with it!
>>
>> I have to quit the application and restart the Bluetooth stack and start
>> over and always get the same result with the complete scan!?!?
>>
>> On 16 August 2018 at 01:51, Alex Blasche <alexander.blasche at qt.io> wrote:
>>
>>>
>>>
>>> > -----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
>>> _______________________________________________
>>> Interest mailing list
>>> Interest at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180816/fa002f3a/attachment.html>


More information about the Interest mailing list