summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Update dependencies on '6.2.4' in qt/qtconnectivityv6.2.46.2.4Qt Submodule Update Bot2022-03-041-2/+2
| | | | | Change-Id: I91667d748c07caa63b1d4c0fa4053dc2ddccf73f Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.2.4' in qt/qtconnectivityQt Submodule Update Bot2022-03-011-2/+2
| | | | | Change-Id: Ifb1df8e4612cc48bbf67cd65a9d39f1219900648 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.2.4' in qt/qtconnectivityQt Submodule Update Bot2022-02-211-2/+2
| | | | | Change-Id: I4651be01e21b3cb52a2b4b1c02ed023892b21977 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Fix Linux bluetooth service discovery crash with multiple servicesJuha Vuolle2022-02-181-2/+4
| | | | | | | | | | | | | | | | | | 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 Change-Id: Ica300cd8461543b533800ca06551b21d9b256613 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 2de33f78ec374ce6963b9c1715e4942c8cf70bb0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update dependencies on '6.2' in qt/qtconnectivityQt Submodule Update Bot2022-02-171-2/+2
| | | | | Change-Id: I0e21a2c837bddcb68a813916f98fa608e04f7385 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Improve bluetooth service discovery on macOS MontereyJuha Vuolle2022-02-173-12/+72
| | | | | | | | | | | | | | | | | | | | | | The original problem is that on macOS Monterey the service discovery, and subsequent usage of the services, is unreliable. This commit improves the situation a bit by checking the connectivity status of the device instead of relying on IOBluetooth callbacks which quite often don't arrive. Also there was a crash due to stray callbacks from IOBluetooth. These seem to cease when we now close the connection we have established for SDP inquiry purposes. The crash happened especially if the remote device got paired during the service scan. In addition this commit introduces more event logging which helps when debugging these issues. Fixes: QTBUG-100303 Change-Id: Id063401390b141cff412cbb47d20d441cc394d3f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 2e09bf6c57c8cb0c1069b562ab2451ec8b68c27a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unintended early return from Bluez lowenergycontrollerJuha Vuolle2022-02-151-1/+0
| | | | | | | | Fixes: QTBUG-100819 Change-Id: Ic90ff324f1e7c89c8056efa89cd7c6525de73b74 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit d2dafd2893208263a37fde9547348a602cfc2231) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid multiple client sockets in pingpong bluetooth exampleJuha Vuolle2022-02-121-2/+6
| | | | | | | | | | | | | This commit guards against creating multiple client sockets if multiple services are found. In addition the service scanning is stopped when a service has been found and we start connecting a bluetooth socket. Fixes: QTBUG-100289 Change-Id: Iac2e7eaca17a186ac2d2f62e338be16911f08032 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 788c4980e67386d2407c4c7bc7182430fc9054c3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Keep the bluetooth service name if the remote has provided itJuha Vuolle2022-02-101-1/+4
| | | | | | | | | | For example the "Bt Chat Server" example application service would always show up as a "Custom Service". Change-Id: If73423d90d5681ee0c3655ef7ee3ad6cd7638755 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit e27c6600eca2c9b704c73a0b6d28780eb236cefb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update dependencies on '6.2' in qt/qtconnectivityQt Submodule Update Bot2022-02-101-2/+2
| | | | | Change-Id: I012f05e904e1eded2a5093c06d2c9de634e15462 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Windows BT: reverse the latter UUID part to correct orderJuha Vuolle2022-02-081-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | The Windows IDataReader::ReadGuid function, which is used to read long 128 bit UUIDs from the SDP results, gives the last 8 bytes of the UUID in reverse order. This commit reverses the byte order. Without the correct byte order the UUIDs of the services are reported wrong, and for example the uuidFilter does not work reliably. The original bug was that the "pingpong" Windows client never finds a Linux pingpong server. It turned out that it finds it, but interprets the UUID wrong. The same interpretation error can also be seen against an Android server. Running the pingpong client against an Android server however works for the reason below. This issue has gone undetected so far because the serviceID field is read differently using different interface and method, and as a consequence has made the uuid filters to work against some platforms. Fixes: QTBUG-99689 Change-Id: I71ab44264579f9eb46461ed8fdd7a49dbf402531 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 0dd124498e91308eb7ac16e976049b431770f7ef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve macOS classic bluetooth (server) SDP record creationJuha Vuolle2022-02-081-14/+36
| | | | | | | | | | | | | | | | | | | | | | This commit fixes four SDP record issues 1. The nested sequences were created too "shallow", missing one layer of depth 2. The attribute keys are expected to be in hex format but were given as decimals 3. The matching with variant.canConvert<QString> results in too broad acceptance, and for example ushort was interpreted as a string 4. With fix for "3" above in place, the UINT16 attributes were put in as UINT32 because of how macOS by default interprets the NSNumbers as part of SDP dictionary Without these fixes Windows client does not find the service, and Linux client misses some of the details. Fixes: QTBUG-100445 Change-Id: I4f063e49bd8832d0e97bdf69acbd1ee7dacf0f87 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 119ef898806d8f67f13877a655b7e2c6b6eb168b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Switch examples to build as isolated sub-builds part 2Alexandru Croitor2022-02-051-1/+1
| | | | | | | | | | | | | | | | qt_examples_build_begin needs the EXTERNAL_BUILD flag to know that it's safe to build examples as ExternalProjects. It still won't do it in CI until we enable building examples as ExternalProjects for prefix builds. This is preparation for that. Task-number: QTBUG-90820 Change-Id: I675ce84342fbebf714ae5090a5ef668f28dc198b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 887f975af5a28d2b4410dcaf8429b864a28240f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows Bluetooth: replace deprecated methods (part 2)Ivan Solovev2022-02-011-8/+43
| | | | | | | | | | | | | | | Replace deprecated BluetoothLEDevice::GetGattService() call with its async version. As the code in qlowenergycontroller_winrt.cpp is already using QWinRTFunctions::await() heavily, this patch just uses it to get the result of async operation, instead of creating another callback. Task-number: QTBUG-94001 Change-Id: Iee1bc7e61211cbfc376ba2637dcd9bc546323412 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit 2edfc9012026d906e5fd7ab2516d59a3a96c198b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Close the GattDeviceService once we are done with itIvan Solovev2022-02-012-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | The Windows implementation is missing a significant detail. According to the docs, we need to call a Close() method when we are done working with the GattDeviceService, so that its resources are freed. In practice that is not so easily achievable, because the lifetime of the GattDeviceService instance can't be easily controlled due to various async operations. Apart from that, we subscribe for value changes of the characteristics that can notify. As a result, the most reasonable solution is to implement a cache of opened GattDeviceService instances. Objects from this cache are reused each time we need to perform some operations on the service. The cache is cleared when we disconnect from the device. Apart from that we need to remove the specific instances from the cache when we rediscover services and their details. Task-number: QTBUG-94001 Change-Id: I9f7cc55d7972591715e33081db6e43a97d5f0b67 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit 0b60ca266f0fe27053a58eff3dbd903e3a1678ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows Bluetooth: replace deprecated methods (part 3)Ivan Solovev2022-02-011-18/+84
| | | | | | | | | | | | | | Replace deprecated BluetoothLEDevice::GetGattService() call with its async version during device discovery. The fix is done by moving part of the method to a new callback. As a drive-by: add processing of the result status. Task-number: QTBUG-94001 Change-Id: Ie20db9eed3a57eae41275bb4d3e975eb2ec368b3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit 478fd1e51962fbf75f2f768c7498d6b7b7250ba2)
* Bump version to 6.2.4Jani Heikkinen2022-02-012-2/+2
| | | | | Change-Id: I16c9f5e4e11ea34f806fbbdbdb60773e9d01c81b Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.2' in qt/qtconnectivityQt Submodule Update Bot2022-02-011-2/+2
| | | | | Change-Id: I5e08306ff2a924f05bc480149510e18ec330511c Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Document the bluetooth socket data pausing on macOS MontereyJuha Vuolle2022-01-311-0/+5
| | | | | | | | | Fixes: QTBUG-99410 Change-Id: I600a861821b87978b9bbcd425d30f49ba6b1aeea Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 6224fee61f0e8a77031dbd7edbb87bd77c43d710) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows Bluetooth: replace deprecated methods (part 1)Ivan Solovev2022-01-281-13/+81
| | | | | | | | | | | | | | | | | | Replace deprecated BluetoothDevice::RfcommServices() call with its async version. This requires to move a part of the method to a new callback. As a drive-by: fixed the check for finishDiscovery() condition. Previously it could be skipped if some of the COM operations failed and we returned early. Now the check is wrapped into a QScopeGuard, so it is always executed. Task-number: QTBUG-94001 Change-Id: I2238e9aa64747503916672f023d7bd036ec9d37a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit 12aa9a228dcd8d4edd8cb273ef303598234a2d4c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make Windows bluetooth to scan all found devices for servicesJuha Vuolle2022-01-273-39/+49
| | | | | | | | | | | | | | | | | | | | | | | The service scan is split in two phases. First we discover the available devices and then we scan each discovered device for their services. The problem was that the Windows bluetooth backend scanned only the device that was discovered the last and then stopped. This patch addresses this by making the scanning logic to follow that of the other backends (Bluez, macOS, and Android). The change required also some adjustments to the stop() logic where the Windows backend did not send the canceled() signal. The worker "cancel logic" is nonexistent and does not produce the signal. A related issue was that the stop() function is called both by the baseclass and the windows specialization itself for slightly differing purposes => needed to be split in two: releaseWorker() and stop(). Fixes: QTBUG-99687 Change-Id: Ie9e25cf0261c5259125dd0f4c6305ef1a99051e7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit 30390a1285c631b766d98fc8dd79d9d9ec6a5eb0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* IOBluetooth: fix SDP inquiry broken by MontereyTimur Pocheptsov2022-01-272-7/+114
| | | | | | | | | | | | | | | | | | | -performSDPQuery:self - does not open a baseband connection anymore to a device, if not connected yet (despite it's documented to do so). Now we have to ensure isConnected == true first. An attempt to connect is not guaranteed to ever complete (with/out errors), so we need a timeout logic in place. -performSDPQuery:self uuids:filter is simply a noop function on Monterey, we have to filter services manually, after SDP query finished. In addition, it was discovered that service class ID list attribute (its id is 0x0001) as reported by Apple may have a non-sequence type, but UUID itself instead. Fixes: QTBUG-99673 Change-Id: I5464faa0a2eb350f738be0531e726f464c6f2caa Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit f00ea686c841e14a89bd776ac3b86766a4980bb3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Decrement the pending paired device counter only once per deviceJuha Vuolle2022-01-271-10/+20
| | | | | | | | | | | | | | | | | | | | The m_pendingPairedDevices variable keeps track of if there are more devices which should be discovered. The counter was decrement twice instead of once leading to possibly non-ending discovery or missing a discovered device. This patch also introduces a helper method to decrement-and-check the amount of pending paired devices. Using this method in classicBluetoothInfoFromDeviceIdAsync allows to properly finish device discovery in case of an async operation error for the last device in the list. Task-number: QTBUG-99685 Done-with: Ivan Solovev <ivan.solovev@qt.io> Change-Id: Iaa36b212e8754940d9d574a60379fa0c32fdad2c Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 0c76617b0cbb7ad4903c2573c206e00bfb6add59) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: fix signal order during service discoveryIvan Solovev2022-01-211-2/+3
| | | | | | | | | | | | | | | | | | | Android implementation uses timers to check for services with a delay. At some point it could lead to a state, when all discovered devices are handled, but the timers for service discoveries were still active. Before the patch, a finished() signal was emitted in such case, and later, when the timer expires, the services got populated and we received a serviceDiscovered() signal. With this patch, we do not emit a finished() signal when the timers are still pending. Instead the signal is emitted from the slot (which was done anyway). Change-Id: I55485ed842ff45f8aedfdca92b3fb1ee0adbae37 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit c24a04ba4beb719ed423f69f80850d0bea5903b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: Fix SPP protocol detection during service discoveryIvan Solovev2022-01-211-2/+1
| | | | | | | | | | | | | A bug was introduced during refactoring in 66bb9839dbccea311cbb85168da86fb6d4a2d136. After the refactoring the boolean 'ok' variable was always false, so the condition in the right part was always evaluated to false. Change-Id: I25e98f7315778fa9f3fa22f2874d5641337c5715 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit c7d2cf1127012e8be8d9cb4aed5ea7bd6718133c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PingPong example: let the parent QObject do the cleanupIvan Solovev2022-01-211-2/+1
| | | | | | | | | | | | | The m_timer and m_serverInfo instances are created using 'this' as a parent, so we do not need to explicitly delete them in the destructor, but let the parent object deal with them. This also prevents a crash at application close. Change-Id: If91f01e1ab6dc8e839a06773464eeb9858d2fd36 Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 4d2df2461f304eb7e1db5030e1c63d17bc2bac85) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Mark QBluetoothServer::listen() overload with [[nodiscard]]Juha Vuolle2022-01-211-1/+2
| | | | | | | | | | | | The results are intended to be stored as it is the only reference to the registered service. Task-number: QTBUG-100042 Change-Id: Ic8f939aeb9d4bb61a91106e456e3c80d9ace11c0 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 4bd126afaef1cafd42f8806651226e2b37325537) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Store the serviceinfo in pingpong exampleJuha Vuolle2022-01-211-1/+1
| | | | | | | | | | | | | | | The service info returned by the QBluetoothServer::listen() overload that returns it needs to be stored or otherwise it will be destroyed. The consequence was that the SDP "advertisement" didn't properly include the added pingpong service record on Windows. Task-number: QTBUG-100042 Change-Id: I79cbd0f574e35bbc1c9c3123ce8382f3aad296d4 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit debf0fd212b232bcd83c8bb8f51ba2bad2f57a1c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows: Fix bufferFromAttribute for QBluetoothUuidsOliver Wolff2022-01-211-6/+4
| | | | | | | | | | | | | | | | In the past a QVariant's typeId was QMetaType::UserType if it contained a QBluetoothUuid. This is no longer the case, so handling of QBluetoothUuid and co has to happen inside the "default" condition of the switch statement. As a flyby an unused variable was removed. Fixes: QTBUG-99617 Change-Id: I3e338dd3e43c57a0f8355ccb4fc6fe3ea808f91c Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit 218dcb1a2e7a6d290f53cc9bdc6b20a20579aea9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update dependencies on '6.2' in qt/qtconnectivityQt Submodule Update Bot2022-01-201-2/+2
| | | | | Change-Id: I88806c092e4a2bb70c1c47a57b074222a1cdb926 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.2' in qt/qtconnectivityQt Submodule Update Bot2022-01-191-2/+2
| | | | | Change-Id: I17ace3ad0dd110624a8d284adc9491069f514eef Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* IOBluetooth: tweak a couple of classesTimur Pocheptsov2022-01-072-3/+12
| | | | | | | | | | | | | | | | 1. Connection monitor: instead of asserting on 'monitor != nullptr' - issue a warning and bail-out early. Despite of us unregistering from connection notifications and trying to release the monitor, IOBluetooth seems to keep references and sometimes it's possible to trigger this assert in our autotests. 2. IOBluetoothDeviceInquiry - stop reporting errors completely, they are not mapped to any error in QtBluetooth and give nothing but failing auto-tests. Change-Id: I8fc2e23d3685b912759df91c65b02537f39d1b5f Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit ba38f64e22c98ba6b0d3bdccbd00ea5a643404f8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update dependencies on '6.2' in qt/qtconnectivityQt Submodule Update Bot2022-01-041-2/+2
| | | | | Change-Id: I91bcb65c942b87ae793f72b56431b36736feb51e Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.2' in qt/qtconnectivityQt Submodule Update Bot2022-01-031-2/+2
| | | | | Change-Id: I417a76cfc4b368cb0fc9459f931e8d9e2a8de73f Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* tst_QBluetoothServiceInfo::tst_assignment - fix for MontereyTimur Pocheptsov2021-12-272-2/+20
| | | | | | | | | | | | To register a service record 'bluetoothd' now (on Monterey) wants us to have ServiceClassIDList. This fixes the test from RfcommProtocol, but not L2CAP (which we consider non-working in such form). Task-number: QTBUG-98955 Change-Id: I4c8c9e4ca38f0ac86b7fb6cb039b430688b4b359 Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit b4621669c7bff244ad490a21e3faf1ec51ba28a4) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Android: Call handleTargetLost directly on NFC TagLostExceptionJens Trillmann2021-12-241-3/+3
| | | | | | | | | | | | | | | | | | If in a transceive() a TagLostException occurs, subsequent calls to transceive() may lead to an app crash with "JNI DETECTED ERROR IN APPLICATION: GetMethodID received NULL jclass" on Android 11 if the timer did not clean up first. This fix calls handleTargetLost directly. This could lead to a race condition in which the targetLost signal is send twice, which should be handled correctly by the Qt code. Change-Id: I886e0bd436272ee393a92b0193fd4d40ed4e965e Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de> (cherry picked from commit 8362edb220cb77e7bcaf766dc8a9545d1c9246e5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Re-enable BT tests on macOS and add appropriate Info.plistJuha Vuolle2021-12-2217-80/+73
| | | | | | | | | | | | | | | | The custom Info.plist is needed to run the tests on macOS 12+ If the bluetooth adapter is OFF (as it is in CI) the tests pass fast. If the bluetooth adapter is ON there is one fail that will be addressed with another task (QTBUG-98955). In addition fixed one invokeMethod error which the testing revealed. Task-number: QTBUG-99222 Change-Id: Ia9fb10f0c3d00f5519fafc56234dcaacbb8013e8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit a508b9092bd2cfba67e059bf3b09f0dcdb3ae440) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* IOBluetooth (device scan) - reduce the manual timeoutTimur Pocheptsov2021-12-201-1/+2
| | | | | | | | | | | | Normally, we set it to 15 s. when creating inquiry instance, since Monterey our 15 s. are ignored and we had a timer to stop the scan in 30 s. Now that tests are runing on CI a painfully long timeout is not needed. Make it 17 s. in case IOBluetooth will be able to stop in 15. Change-Id: I8e07c2a3f3c46bed3780f3287e637b5324660305 Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit 24674633ecebc85f09fe8bd5babeba9abe0ee3e0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Bump version to 6.2.3Jani Heikkinen2021-12-182-2/+2
| | | | | Change-Id: I0dfc31f7662f2fd803886f4b9f0c68e573b0bcf1 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.2' in qt/qtconnectivityQt Submodule Update Bot2021-12-181-2/+2
| | | | | Change-Id: I2d9b290ed0665e7a57d462b5abe2cb541f7616de Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Android BT LE Client thread protection improvementJuha Vuolle2021-12-171-502/+541
| | | | | | | | | | | | | | | The Android BT LE Client is a threaded feature; the Java-side callbacks from Android execute in different threads and JNI calls from Qt/C++ execute in the Qt thread. This commit augments the existing protection by synchronizing the accesses to shared variables on the client object. Task-number: QTBUG-98351 Change-Id: Icb39499c42bbdeec5e65ed5368294e1c631d3bfa Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> (cherry picked from commit a8e6de3863c89db251e6420a70351860c375b3f3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Adjust BT LE test to pass with most client-server combinationsJuha Vuolle2021-12-152-13/+65
| | | | | | | | | Task-number: QTBUG-98781 Change-Id: I97f365136000cf5d9d10e8d5e3e69c56654e28a3 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 07ea79b92b59f5bb2d644a6f690032b6c54f7641) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Switch examples to build as isolated sub-buildsAlexandru Croitor2021-12-152-8/+8
| | | | | | | | Task-number: QTBUG-90820 Change-Id: Ife7b112e7a800460740f21a69d2ac85133bf0827 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 0d9dc44fef5dcad6daf574bc81ac7b1ae5743c82) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't disconnect Darwin BT LE server on characteristic unsubscribeJuha Vuolle2021-12-151-37/+5
| | | | | | | | | | | | | | | | | | | The darwin CoreBluetooth does not really report client-device (dis)connect events on the server side. Instead we use some heuristics on the Qt backend to detect these. One heuristic for disconnection was unsubscription from a characteristic, which however causes a problem; there may still be several clients connected (and possibly subscribed) and we shouldn't shut down the server. Checking if there are subscriptions left on any of the characteristics wouldn't be adequate either, as a client can be connected and functional without any subscriptions too. Fixes: QTBUG-98878 Change-Id: I36a37484ef3c98449ad43fd0463f682994c53568 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 95f349237bc37b9e3e5f47b4e2aa85855bccc2cd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QLowEnergyController Windows: fix early disconnect crash on Win 11Ivan Solovev2021-12-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | QLowEnergyController connection helper object was calling CoInitialize() in connectToDevice() and CoUninitialize() in its destructor. This was working fine on Windows 10, but on Windows 11, in case when the connection attempt is interrupted by a disconnect request, it was crashing. The stack trace showed that Windows 11 is trying to do more COM-related calls after CoUninitialize() is called. Specifically, it was calling CoIncrementMTAUsage(), and some others. This patch replaces CoInitialize(), which uses a single-threaded apartment model, to CoInitializeEx(NULL, COINIT_MULTITHREADED) that uses multi-threaded apartment. It also explicitly clears the ComPtr-based class members before calling CoUninitialize(). These two measures help to prevent the crashes. Although I do not completely understand why it helps. Fixes: QTBUG-98582 Change-Id: I6fe5a877dbc2c0518ba97fddb132c2f87fc397c2 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 6b910367d859504a0bb48b82e6a2400f76e35241) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update dependencies on '6.2' in qt/qtconnectivityQt Submodule Update Bot2021-12-131-2/+2
| | | | | Change-Id: Ibf635c313f3bdf8d0d931ff0a4c9139829b59b95 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.2' in qt/qtconnectivityQt Submodule Update Bot2021-12-111-2/+2
| | | | | Change-Id: I682271474bd5d79d544fe7e46ca04558f60315cd Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.2' in qt/qtconnectivityQt Submodule Update Bot2021-12-111-2/+2
| | | | | Change-Id: I83695e983a65c57da5ec3ca64be82c8379991801 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* QBluetoothSocket Windows: remove unneeded mutexIvan Solovev2021-12-101-6/+0
| | | | | | | | | | | The SocketWorker::onReadyRead() callback is invoked in the same thread where the SocketWorker object is created. That means that we do not need to protect the access to data using mutex. Change-Id: Ie828d38ea1c79df245bf6944b7c22b1edeaaec36 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 49f546e053368b6458bfaa123832129c5d5d8be2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows QBluetoothSocket: fix crash at disconnectingIvan Solovev2021-12-101-2/+17
| | | | | | | | | | | | | The last onReadyRead callback can come after the object is destroyed. Protect against it by wrapping 'this' in a QPointer, and checking the QPointer in the callback. Fixes: QTBUG-98719 Change-Id: I3d5200e29744012815cd168a340bc617f85c6540 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 79a1523ed6262ccd148173ec8732865c0721063a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>