Skip to content

2 bluetooth fixes

Fix Linux bluetooth service discovery crash with multiple services

The application code may call stop() for the service discovery agent
when it has detected the service-of-interest.

The crash occurs because the stop() will clear the list of discovered
devices, but the service discovery result handling loop may still be in
the middle of processing the services. If the loop accesses
the by-now cleared device list on its next iteration, it will cause a
list access violation assert.

Fixes: QTBUG-100894
Pick-to: 5.15 6.2 6.3
Change-Id: Ica300cd8461543b533800ca06551b21d9b256613
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit 2de33f78ec374ce6963b9c1715e4942c8cf70bb0)

Use the service's socket protocol info on Bluez bluetooth socket

The QBluetoothSocket::connectToService(QBluetoothServiceInfo) should
extract the socket protocol info (rfcomm/l2cap) from the provided
service info.

Fixes: QTBUG-101018
Pick-to: 5.15 6.2 6.3
Change-Id: Ibbf4daef28a2661e4699759d6f834779d27ac750
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit 29b51e28a961a09fb25d668da5a5e3c9d89390b9)

Merge request reports