Commit Graph

2 Commits

Author SHA1 Message Date
Juha Vuolle 4deb789fe6 Fix BT LE service addition timing issue on Android
If services were added in a tight loop sometimes the services are
created wrong. In practice this results in a situation where a client
reads a characteristic value from "Service A", but gets the value from
"Service B" - even if the client had no knowledge of "Service B".

The problem is that according to Android documentation, the
BluetoothGattServer::addService() must not be called before the prior
added service has received a
BluetoothGattServerCallback::onServiceAdded() -callback.

This commit serializes/queues the service additions.

Fixes: QTBUG-96742
Pick-to: 6.2 5.15
Change-Id: I42c980600419787d4490d1a1059e3893597cb7cf
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-11-18 15:28:16 +02:00
Andreas Buhr f3fcf88a0d Add bluetoothtestdevice tool
This patch adds a tool "bluetoothtestdevice" which
acts as a partner device in QtBluetooth unit tests.

Pick-to: 6.2
Change-Id: I5be89cf555a94a209de093d328fb29f91c2fea9a
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-26 13:23:19 +02:00