Details
-
Epic
-
Resolution: Done
-
P1: Critical
-
6.0
-
None
-
Qt Bluetooth Changes in Qt 6
Description
The following changes should be considered as part of the Qt 6 release.
- Remove qbluetoothglobal.h (deprecated by https://codereview.qt-project.org/#/c/203657/3)
- Review QLowEnergyController state machine - Reading all descriptors and characteristic as part of the service discovery is very inefficient. Especially when the user already knows the exact service & char uuids he desires to interact with). The API should be changed such that QLowEnergyController discoverDetails() is no longer necessary.
- Add convenience function to enable/disable notifications per char and not having to know the details on how to write the ClientCharacteristicConfiguration descriptor
- Drop BlueZ 4 support https://bugreports.qt.io/browse/QTBUG-75342
Remove Custom GATT stack (pre BlueZ 5.42 releases require it due to missing GATT DBus API)- will not be done as its a good debug system and provides the BTLE peripheral functionality on Linux
- Investigate whether minimal Android version can be raised. This permits dropping of lots of reflection code which ensures that older Android version continue to work.
- Qt 5.13 increased to API v21 -> LE Scan API updated - see
QTBUG-67482 - More reflection calls in the backend -> needs verification
- Can be done after Qt 6
- Qt 5.13 increased to API v21 -> LE Scan API updated - see
- Various API cleanups (see various TODO items in headers), e.g.:
- Remove QLEController remoteAddressType property (only required on Linux for Custom Gatt stack)
- Remove QBluetoothDeviceDiscovery::inquiryType and all related functions and enums
- Cleanup the confusing notion when QBluetoothDeviceDiscovery::deviceDiscovered() and deviceUpdated() are emitted (see https://codereview.qt-project.org/c/qt/qtconnectivity/+/262375)
- Drop legacy QLEC on WinRT
- this implementation remains even if WinRT as platform is dropped from Qt 6 (there is no adequate win32 APi)
- two implementations on WinRT currently used (with differing Win10 API requirements)
- => compare the implementation, state minimal requirements (Anniversary vs Creators update)
- final decision based on wider Qt decision for minimal Win10 API
- Test behavior of platforms in case of same service uuid twice per peripheral or same char uuid twice per service
- small peripheral test app
- test across platforms
- if concluded decide on course of action for API
- Rename/deprecate QLEService:: DiscoveringServices -> QLEService:: DiscoveringService
- Remove concept of handle ID from QLECharacteristic & QLEDescriptor -> deprecation required
- Remove/deprecate the various error() signals
- current system requires extensive use of qOverload (getter and signal have same name)
- add replacement (errorOccurred or sth similar) to QLEController, QLEService, QBluetoothServer etc
https://codereview.qt-project.org/c/qt/qtconnectivity/+/339184
- Plugin system for Bluetooth Stack
- Investigate to what degree alternative stacks to Bluez play a role on Linux platforms. Some Bluez profiles are rather outdated. Such an alternative stack could provide a strong push towards a plugin system for Bluetooth implementations. This might even be helpful for users on Windows where WinRT and Win32 capabilities are vastly different from each but each still has strong use cases depending on the windows target platform. Alternatives are:
- A few iOS/macOS implementations have their own public class implementations (e.g. QLowEnergyService)
- Removes duplicated code
- Likely due to Objective C specifics -> needs investigation
- QBluetoothDiscoveryAgent uses a very complicated start/stop/cancel logic which shall be removed (behavior change)
- Replaced by simple isActive() logic which blocks start() while previous stop() is still pending
- Unit test needs adoption
- Review consistent use of Q_DECLARE_PRIVATE/Q_DECLARE_PUBLIC and QObjectPrivate inheritance
- Improve interaction between QBluetoothServer and QBluetoothServiceInfo
- QBluetoothServiceInfo becomes a true value type
- Move SDP registration part of QBluetoothServiceInfo to QBluetoothServer
- isRegistered() -> isListening()
- (un)registerService() -> becomes part of listen()/close() in server class
- removes need for fakeServerPort workaround
- QBluetoothServiceInfoPrivate becomes QObjectPrivate
- add assignment/mutable operator to QBSI
- QBluetoothServer::setSecurityFlags() (same in QBluetoothSocket)
- investigate a better parameter type as current set is based on old Linux kernel version (which has been replaced)
- QBluetoothSocket::Error & QBluetoothSocket::SocketState should loose the value coupling to QAbstractSocket (the class has no QAbstractSocket dependency
https://codereview.qt-project.org/c/qt/qtconnectivity/+/337069 - Remove QBluetoothTransferManager and friends from Qt
There is no evidence of it being used, the number of bug reports is zero too
https://codereview.qt-project.org/c/qt/qtconnectivity/+/335713/ - Remove QML API (socket programming in QML is very very limited at best if not even impossible)
https://codereview.qt-project.org/c/qt/qtconnectivity/+/335766 - Remove pairing agent related API from QBluetoothLocalDevice. Bluez 4 had the only complete and working implementation. Android requires unobtainable permission sets and no other platform implements it.
https://codereview.qt-project.org/c/qt/qtconnectivity/+/337005
Attachments
Issue Links
- is required for
-
QTBUG-74396 Technical enhancements of the Qt framework
- Closed
-
QTBUG-89509 Module Migration for Qt 6.2
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-62877 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
259500,6 | WIP: deduplicate public API implementation | dev | qt/qtconnectivity | Status: DEFERRED | -2 | 0 |
259830,9 | IO/CoreBluetooth - refactor the code a bit | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
259846,23 | De-duplicate device discovery code (Darwin) | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
260701,36 | LE controller/service remove code duplication (Darwin) | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
261144,1 | WIP: QBluetoothServiceInfo - remove Darwin-specific duplicate | dev | qt/qtconnectivity | Status: ABANDONED | -2 | 0 |
267119,9 | QBluetoothServer - cleanup and de-duplicate code | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
267138,5 | QBluetoothSocket - deduplicate the code (macOS) | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
267228,3 | QBluetoothServiceInfo - remove the code-duplicate (macOS) | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
267461,4 | Service discovery agent - remove the public API implementation (macOS) | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
300219,4 | Do not auto generate deprecated qbluetoothglobal.h | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
300220,4 | Rename QLEService::DiscoveringServices to DiscoveringService | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
300221,3 | Remove QBluetoothDeviceDiscoveryAgent::inquiryType property | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
333331,4 | Remove deprecated QLowEnergyController ctors and instance factories | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
335713,9 | Remove QBluetoothTransferManager and friends | dev | qt/qtconnectivity | Status: MERGED | -1 | 0 |
335766,8 | Remove QML API from QtBluetooth | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
337005,9 | Remove Pairing agent related API from QBluetoothLocalDevice | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
337161,5 | remove QtConcurrent dependency | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
339536,4 | Change QLowEnergyService::ServiceState enum to reflect future changes | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
340026,15 | Introduce option for reduced service discovery | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
340532,9 | Implement reduced service discovery on Linux-BlueZ-DBUS | dev | qt/qtconnectivity | Status: ABANDONED | 0 | 0 |
341223,1 | WIP: winrt implementation | dev | qt/qtconnectivity | Status: ABANDONED | -2 | 0 |
341226,5 | Implement reduced service discovery on Android | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
341227,2 | Implement reduced service discovery on Linux-BlueZ-DBUS | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
341228,6 | Implement reduced service discovery on WinRT | dev | qt/qtconnectivity | Status: ABANDONED | +2 | 0 |
342121,4 | Implement reduced service discovery on WinRTNew | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
343159,3 | Do not read characteristic values and descriptors unless mode is 'FullDiscovery' | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
345401,4 | Implement reduced service discovery on Linux-BlueZ | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
351540,12 | Add convenience API to access CCCD | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |