summaryrefslogtreecommitdiff
path: root/src/bluetooth
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into ↵v5.15.8-lts-lgplTarja Sundqvist2022-11-1011-56/+155
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I4d53774cfe0783f50a123158d8bac7a02c382968
| * QBluetoothSocket Windows: check that host info is availableIvan Solovev2021-12-101-12/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | If we try to query local or remote socket info (name, address, port) before the connection is actually established, WinAPI will return a null instance of HostInfo for both local and remote hosts. This patch adds checks that these objects are not nullptrs before extracting data from them. Change-Id: I137f1270c1c7d95a1935cc8565cda6c9f7814292 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 45f9e9fcb054c28bc59f6cc480eb08e9b13e5f0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QBluetoothSocket Windows: fix localAddress and peerAddressIvan Solovev2021-12-101-2/+13
| | | | | | | | | | | | | | | | | | | | | | WinAPI returns the address with parentheses around it. QBluetoothAddress constructor does not understand such form, so we need to explicitly remove the parentheses. Change-Id: Ie2665b3dbe7bd001160ba01aa1db9beb1b8d4d86 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit aba20224710bf66c23909ef1d1f542eaeeeedbce) Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
| * QBluetoothSocket Windows: actually query remote portIvan Solovev2021-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | Before this patch we were querying local port for both localPort() and peerPort() calls. This patch fixes it. Change-Id: Iac1689ab22a010539c27c4890137cab8f7be5e10 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 973f8c6225016fe57d9e62946292f856f369561a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * CoreBluetooth: fix warning message concatenationTimur Pocheptsov2021-11-261-1/+1
| | | | | | | | | | | | | | | | | | Otherwise word in line join without space in between. Change-Id: I558daa0a26358d435d6000f73c65fb9a0054f53e Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> (cherry picked from commit 819629896fe080bdd79c96a5eb75eec6c368e563) Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Windows: fix object destruction order when terminating helper threadsIvan Solovev2021-11-262-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows implementation of QLowEnergyController is using helper threads to perform device connection and characteristics read for services. In both cases a new QObject-derived class instance is created and moved to a helper QThread. A QThread::finished signal was used to destroy both the helper thread and the object. This was creating a situation when the order of destruction for a thread and a nested object was not specified. In practice that could lead to hangs when reading multiple service characteristics, which is specially seen on Windows 11. This patch uses QThread::finished signal to destroy only the nested object. Later on, the object's QObject::destroyed signal is used to destroy the thread itself. Task-number: QTBUG-97578 Change-Id: Ic973b835496b6098d47cd1e124315903c143e3e1 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 981e3f10f48580641f5e2365953ec8a17b5c96a2)
| * Bluetooth (Darwin): bail out early, if Info.plist is missingTimur Pocheptsov2021-11-245-25/+91
| | | | | | | | | | | | | | | | | | | | | | | | or not having proper entries that required on iOS and (starting from Monterey) on macOS (but LE only). Without them, app crashes due to exception thrown by the framework. Task-number: QTBUG-97900 Task-number: QTBUG-96557 Change-Id: Ia1463fa4361884936594780312586eb17f8fe075 Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit dfa20ef097459587ef9086dd6f4edd313123676b)
| * Fix thread affinity for charListObtained slotIvan Solovev2021-11-242-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The connection between QWinRTLowEnergyServiceHandler::charListObtained and a corresponding lambda was established using a 3-argument version of QObject::connect, which is implying Qt::DirectConnection. This means that the lambda was actually executed on the same helper thread that was responsible for reading characteristics. This is not the intentional behavior, because it could result in a concurrent access to serviceList. Also registerForValueChanges() could be called from multiple threads. This patch uses the 4-argument version of QObject::connect, so that Qt::AutoConnection is used. It means that the lambda will be executed on the main thread. This patch also removes a duplicated call to thread->exit() from the lambda. The original call is already performed in a method that emits the signal. It was not an issue with Qt::DirectConnection, but can be a problem with the fixed behavior. Task-number: QTBUG-97578 Change-Id: Ia363489024e46e2879a4bd5e56c2ab8cd6606306 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 4ecc718d418689b9b9b66086ef4d041a21f44327)
| * IOBluetooth: avoid over-retaining Obj-C entityTimur Pocheptsov2021-11-103-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the past, QBluetoothLocalDevicePrivate was releasing its instance of DarwinBTConnectionMonitor, and IOBluetoothDevice was not retaining this object, thus the correct behavior was assured. Starting from macOS 12 the behavior changed, just releasing in a dtor is not enough anymore, instead we should unregister 'monitor' manually, so that IOBluetoothDevice releases its ownership too. The problem was found when connecting to LE device which is Classic device at the same moment, resulting in IOBluetooth sending a notification to the monitor object, which has a dandling pointer to QBluetoothLocalDevicePrivate. Fixes: QTBUG-97900 Change-Id: Idcc1233ce51795c561dbee8fd6d9a7aff592a5a2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> (cherry picked from commit 370de7fe8447b8d2216a4cd130df211b05260b8c) Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.7' into ↵v5.15.7-lts-lgplTarja Sundqvist2022-09-127-489/+657
|\ \ | |/ | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I5f92cce8507becd3683f24177d0f0251848b9cdc
| * Refactor characteristics read for WinRTIvan Solovev2021-10-131-171/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The characteristics read was using IAsyncOperation->put_Completed() to process the results of descriptor reading. Each of these completed callbacks is executed in its own thread. In our case each of the callbacks is also calling QWinRTFunctions::await() to perform some async operations. As a result, if the service has a lot of characteristics, we could end up spawning multiple threads, each of them doing some CPU-consuming operations. Normally it's not a problem, but looks like for some bluetooth peripherals reading the characteristics can take significant time. Connecting to such devices can result in 100% CPU load for all cores if the number of characteristics exceeds the number of logical CPUs. This patch removes the put_Completed() approach in favor of another QWinRTFunctions::async() call. This will guarantee that all the characteristics read operations are performed in the same worker thread. As a drawback, characteristics reading becomes sequential, which makes it slower. Fixes: QTBUG-97242 Change-Id: If46c3f0afe13a56d93f2b8fc46b87a2c90555bf3 (cherry picked from commit 2a7ef291d696745887e71f8b0e27cb4c8701bdd2) Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * QLowEnergyControllerWinRT: refactor connection to deviceIvan Solovev2021-10-112-224/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a separate worker that will do all the system calls in a separate thread and emit a signal once it's done. This will allow to avoid the crashes caused by disconnectFromDevice() being called while connection is still in progress and spinning in the QWinRTFunctions::await() method. Basically this patch moves the connection code to a separate worker, and introduces new macros to handle the errors. It also makes use of the new early return condition of QWinRTFunctions::await() that was introduced in 1f86957f1dd14cc538e7ad9ffee4eb63001af407. As a drive-by: increased the characteristics read timeout, because the initial one was not always enough even for a turned-on device. Apart from that this patch also solves some other issues and crashes that could happen due to async nature of some calls. For example: - handle the fact that service discovery might finish after the device was disconnected. No need to notify about discovered services in this case. - add missing checks for thisPtr != nullptr in some callbacks that capture thisPtr. Task-number: QTBUG-96057 Change-Id: Ia2d044a89e3427a53d0879e045b6230d16bac3ce Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit a00ffdfc3569a5741bc42739570dea2ec52b7f0f)
| * Move connecting to a LE device to background on WindowsJuha Vuolle2021-09-224-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BT LE connectToDevice() method on Windows was a synchronous operation for the caller by blocking while spinning the event loop to keep rest of the application responsive. Other platforms behave differently. This commit makes the connect call to return immediately while scheduling the connection in the background. The QTBUG-83633 was originally about slightly different crash which seems not be reproducible anymore, but this crash was found while investigating that and is investigated in that item. Task-number: QTBUG-83633 Change-Id: I092a94f2437351d27da758db6746f5b24d5fa9c7 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 3fc3716e0cd209cd9475d632925a9148b40b2f1d) Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * QLowEnergyController(WinRT): introduce timeout for connectionIvan Solovev2021-09-211-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The connection method was infinitely trying to connect to a specified bluetooth device, which does not make much sense and could lead to the application being stuck. This patch limits the connection attempts to a reasonable amount of time. If the connection was not established within this time, ConnectionError is set and controller state is reset to UnconnectedState Fixes: QTBUG-80719 Fixes: QTBUG-89149 Change-Id: Ib8efb690a8b0485c8e9d4844799c7332ab81bf97 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 007dcbf074a9e4d72e2a29a4a28ac5e502830e20) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * winrt: Protect from late AdvertisementReceived callbackIvan Solovev2021-09-211-97/+109
| | | | | | | | | | | | | | | | | | | | | | This commit amends 83a845aa0e5bb155fae3f1d5d27bb80801f90935. The callback can be called after the worker was deleted. Task-number: QTBUG-96057 Change-Id: Ifbd58b240667bd5ff805b4250cf98a9fd2f96e90 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 3573702aa81f3f7ea20e947dbd27c5d1122cc42a) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * IOBluetoothDeviceInquiry: manually interrupt Classic scanTimur Pocheptsov2021-09-101-19/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If 'inquiryLength' was ignored. This change is to be revisited after the official release of macOS 12 - it could be a bug in beta versions and all this additional timer machinery is a waste. The fact I was able to observe the same problem with 10.15.7 is quite troublesome though. Fixes: QTBUG-95960 Task-number: QTBUG-95686 Change-Id: I56685e07791dd751aec81bebbeefde19d31555df Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit cf8ade9fd809e62cb61bb897b3789c75a48f5996)
| * Bluetooth docs: mention the Apple's specific requirementsTimur Pocheptsov2021-09-071-0/+10
| | | | | | | | | | | | | | | | | | | | | | Info.plist with a textual description of why and what Bluetooth is needed for by a Qt-based app is required on iOS. Change-Id: If838b57d6c13da9aeaf436dd013bd8496984a8bb Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> (cherry picked from commit 5953696dbd294918baf33b26ccad526d3332f967) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.6' into ↵v5.15.6-lts-lgplTarja Sundqvist2022-08-164-79/+231
|\ \ | |/ | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Idc85041896434539774ca606f1b74002d98dc3ba
| * Doc: Fix typoPaul Wicking2021-07-261-1/+1
| | | | | | | | | | | | | | | | Fixes: QTBUG-95349 Change-Id: Ie1a7c71a33e5d620d914ffce193a89d080d81af9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit eef11fe06c8458b9668f367502a479497831db62) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QWinRTBluetoothDeviceDiscoveryWorker: Add error handlingOliver Wolff2021-07-202-66/+221
| | | | | | | | | | | | | | | | | | | | | | | | Instead of asserting everywhere, we at least set the error and return gracefully. Fixes: QTBUG-90369 Fixes: QTBUG-95156 Change-Id: I143408b4b30322bb8b490d5848f731f753669015 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> (cherry picked from commit 085af5ef811e293377ba92cd12dbda926db27620)
| * Improve detection of enabled location service on SDK<28Andreas Buhr2021-07-121-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bluetooth seems to be non-functional when location services are disabled. This is not documented in Android's documentations, but several bug entries exist about this which are closed as "works as intended". See the linked bug entry for details. Our code thus tries to detect whether location services are enabled. This patch improves the detection of enabled location services. While the previous code did only check for GPS and Network location providers, the new code should detect any enabled location provider. Fixes: QTBUG-90760 Change-Id: I0c670296d0af62161dbc3fca40889996fa91f0ca Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 4fdcd2d8d2c2b47ec142b744ad291c1e134db7d4) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.5' into ↵v5.15.5-lts-lgplTarja Sundqvist2022-05-163-10/+23
|\ \ | |/ | | | | | | | | tqtc/lts-5.15-opensource Change-Id: If90eb1db8f874742b028a258d582bdd0a5fd5322
| * Fix "loop variable creates a copy" warningKonstantin Ritt2021-05-171-2/+2
| | | | | | | | | | | | | | | | | | > warning: loop variable 'service' creates a copy from type 'const QBluetoothUuid' Change-Id: I37fce9793f4f8a18f64f2de5fa43b56ec430aabf Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 496801629cd44f21986960dc06810e4e481f5035) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Prefer QChar over QString that consists of a single QCharKonstantin Ritt2021-05-171-3/+2
| | | | | | | | | | | | | | Change-Id: I1465ba2b94fa02ebe4a852dae0747a8530c2968d Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit ec3c1b596455bb69af43cfdcb3b80b182b055162) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * CoreBluetooth: add a workaround to enable using scan optionsTimur Pocheptsov2021-05-111-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, the value for CBCentralManagerScanOptionAllowDuplicatesKey is 'NO' (but either passing it explicitly or passing nil as 'otpions'). According to a report, this disables a proper device discovery (contrary to what is documented by Apple). Since, according to the Apple's docs, "Disabling this filtering can have an adverse effect on battery life; use it only if necessary", we don't set it by default and instead provide a workaround using environment variable to set the option, if needed. The name of this variable is: "QT_BLUETOOTH_SCAN_ENABLE_DUPLICATES". [ChangeLog][QtConnecivity][Bluetooth][Darwin] Enable setting a scan option (that allows duplicates) Change-Id: I08a5a089020c433a87bcb622d08aa2cd260283b9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit e0e46f3f4cd5f482ef8a95b87a3d341cc3bf4076)
| * Backport a fix from Qt 6 (stop using a deprecated API)Timur Pocheptsov2021-05-071-4/+10
| | | | | | | | | | Change-Id: I740ecdd2a79bb4011b61e751edba918ea64b249e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.4' into ↵v5.15.4-lts-lgplTarja Sundqvist2022-04-075-11/+23
|\ \ | |/ | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I86f7492c32a43094f37cfb9b21ad1066aa49ba68
| * Always call setOpenMode before setSocketStateAndreas Buhr2021-03-233-6/+8
| | | | | | | | | | | | | | | | | | | | | | setSocketState emits signals and should thus be called last. I most code, setOpenMode is called before setSocketState. But in some occasions, setSocketState was called before setOpenMode. This patch introduces a consistent call order: setOpenMode before setSocketState. Change-Id: I07f33511c76fbd08c79050a3fcbc1e1dd72fff04 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 62da7abae76b78fdc9385a0d997f3483057cf37c)
| * Fix bug: Let QBluetoothsocket::close emit disconnected only onceAndreas Buhr2021-03-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QBluetoothSocket::close emitted "disconnected" twice on macOS. The first emit is by setSocketState(UnconnectedState). This patch fixes the behavior to only emit it once. Fixes: QTBUG-91164 Change-Id: I7147a28b40c49db947ee97a4f1a14f319da341d1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 2a6ab855c2a4ffc5253126d53bc667b0076dd9c9) Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Change tst_qlowenergycontroller to wait for disconnectsAndreas Buhr2021-02-262-0/+6
| | | | | | | | | | | | | | | | | | | | | | Many occurrences in tst_qlowenergycontroller exist where disconnectFromDevice() is called but the code did not wait for the disconnect to happen. This patch changes this. Change-Id: I1df4e68136b8a83640af1fc50298e559d983cc9a Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 180f895023f136a694738667a73674968964bafc) Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
| * Correct error handling in QLowEnergyControllerPrivateBluezDBUSAndreas Buhr2021-02-251-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a DBUS interface was removed for a device, error handling just assumed it was the org.bluez.Device1 interface, without checking. This lead to errors on disconnection if the device has a battery service: The code sends a disconnection request, then an InterfaceRemoved event for org.bluez.Battery1 occurs. This was interpreted as a removal of org.bluez.Device1 which in turn led to the controller going into UnknownRemoteDeviceError error state. This patch adds a check whether it is really org.bluez.Device1 which is removed. Change-Id: I449b29cb9528cda23ce972f36f716a8774f01fe5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit af5f801c6b8de0bf0d21798bddef54cb14759ecd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-24206-4250/+4250
|/ | | | | | | | | | | This reverts commit 0db3b38521e11147cb802798a2cb7811a96029a9. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: Ie82dac4e6a4e2e0e1207d17a10c09701871d6875 Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
* Fix error handling in BlueZ connectToServiceHelperAndreas Buhr2021-02-122-5/+20
| | | | | | | | | | | | | | QBluetoothSocketPrivateBluezDBus uses asynchronous calls, then blocking waits for the result and then does error handling. The blocking wait was missed in one place, rendering the following error handling code dysfunctional. This patch adds the required blocking wait. Fixes: QTBUG-82407 Change-Id: Ia45372e3b6cce3617d6c985fe1800a33631bc0fc Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 7aa19c8a512fdceac12cf4ee6587626e3de61c25) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add server role to BlueZ service registrationAndreas Buhr2021-02-121-0/+1
| | | | | | | | | | | | | | | In service registration, a profile is created. This profile had no clien/server flag. If two profiles with the same UUID are created (one for server side, one for client side) this led to the wrong profile being used in connection setup. This patch marks the profile which is created in registerService() as a server profile which prevents it from being used by BlueZ in a client context. Change-Id: I95b22657a7c7e45b334476a8513d79920ba9cc96 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit e74cb54a4cbc8aba188ea48ae3effcf10432df11) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update commercial license headersTarja Sundqvist2021-02-02206-4250/+4250
| | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qtconnectivity. Examples, tests or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in test. Task-number: QTQAINFRA-4159 Change-Id: Icf450df25282ffadf5bcd0950753d17ba6ab57e3 Reviewed-by: Antti Kokko <antti.kokko@qt.io>
* QLowEnergyController (Darwin) - restore the logic we had in 5.12Timur Pocheptsov2020-09-091-4/+9
| | | | | | | | | | | | | where serviceDiscovered was invoked via QueuedConnection and the controller was in the correct state for details discovery in case an application wants to discover details in the slot, attached to the serviceDiscovered signal. Change-Id: I3cbd0a0fa9913003d7b1c388a1c3653e04a505b0 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 7ff8f2d0546262816ab94684a992428cc2cb8a9e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update connects to QSocketNotifier::activatedv5.15.0-rc2v5.15.0-rc1v5.15.05.15.0Mårten Nordheim2020-04-292-5/+5
| | | | | | | | The int-overload produces a warning Task-number: QTBUG-70441 Change-Id: I1c787e0a5852388d5a08630a51189f9c0661968e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15.0Qt Forward Merge Bot2020-04-271-0/+1
|\ | | | | | | Change-Id: Iab21a9155cd4b1cba4c65332fff02df9c149f57a
| * QLowEnergyControllerPrivateWinRT::connectToDevice: Return early if LE device ↵Oliver Wolff2020-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | cannot be found If the host does not support BTLE, connectToDevice will fail and mDevice will be zero. The return in this case was missing so that we tried to access a null pointer and caused an exception. Change-Id: Iba973f3980a2ecbb82d2cb6dd8d0f60a5bdf4890 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15v5.15.0-beta4v5.15.0-beta3v5.15.0-beta2Qt Forward Merge Bot2020-03-073-3/+9
|\ \ | |/ | | | | Change-Id: I037246140f5c52dde3335952d4bf77e43b1c3503
| * support building with clang and libc++Denis Pronin2020-03-051-0/+1
| | | | | | | | | | | | | | fixed undefined errno when compiling with clang++ and libc++ Change-Id: I30be6e2da36f9189261535f103ce689462634f49 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Fix case of setupapi.h for mingw-w64Marius Kittler2020-03-031-1/+1
| | | | | | | | | | Change-Id: I9ddb290a10a620334abaf0500dd7b280e86b3a03 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Support characteristic Write Without Response on BlueZ 5.50+Alex Blasche2020-03-031-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | BlueZ 5.50 adds support for this feature. This patch was provided by David Lechner via QTBUG-81696. Fixes: QTBUG-81696 Change-Id: I2a73b173821e36534b3848f7d0e35df16f118011 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-291-0/+2
|\ \ | |/ | | | | Change-Id: I5fe705f8a5f375ae44169a465515bb2c54cf6393
| * Android: Ensure that LE errors are forwarded from JNI to QtAlex Blasche2020-02-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code to detect the error existed on the Java/JNI side. The code to handle and report the error was available on the Qt side. Unfortunately the essential signal and slot connection was never made though. This lead to [ChangeLog][QtBluetooth][Android] Fixed the missing QLowEnergyService::error() signal emission if the error was detected on the Java side. This probably cut 50% of all errors out. Change-Id: I6ee4d7605a1d1e61b920da56d7f67373fb7f5be5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-271-2/+2
| | | | | | | | | | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: I2de4dcdb43a3ac6640f07fba463462e58fa16000 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15v5.15.0-beta1Qt Forward Merge Bot2020-02-222-8/+55
|\ \ | |/ | | | | Change-Id: Iea61654bd94c9bb4be0736a5d5512fb42d845488
| * Grant ACCESS_FINE_LOCATION to QtBluetoothAlex Blasche2020-02-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Since Android 10(SDK v29+) all types of Bluetooth device discovery require ACCESS_FINE_LOCATION. This is highlighted by https://developer.android.com/about/versions/10/privacy/changes#location-telephony-bluetooth-wifi Fixes: QTBUG-81875 Change-Id: Icaecca1f72a994dc774dc2b90194da15cc0787b0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * Ensure that a failing classic discovery doesn't prevent LE scanAlex Blasche2020-02-211-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the classic scan does not start properly we immediately error out. If the user has requested LE discovery in addition to the classic discovery, we should continue with LE discovery. By convention, we only bother the user with an error signal if none of the two methods succeed. Task-number: QTBUG-81875 Change-Id: Id867892210fbef6da0e4937c2aef20f726ba9a2a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Add location-turned-on check before starting device discoveryAlex Blasche2020-02-211-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The location permission and a running location service have been a prerequisite for a successful LE scan since Android v23. While the permission has always been checked before doing a bluetooth scan, the state of the location service was not checked. LE discovery without location turned on does not error out. It just reports zero discoveries. Starting with Android SDK v29, a classic Bluetooth discovery requires a running Location service too. Due to BluetoothAdapater.startDiscovery() returning an error code when location is turned off, it was time to check the location service before triggering the discovery to simplify the error handling for the API user. This patch ensures that location is turned on before any type of device discovery is started and the API reports an error reflecting this problem. Task-number: QTBUG-81875 Change-Id: Id51fd502ae24cbadbc704451fdf49d999224c16f Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>