summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-2011-44/+40
|\ | | | | | | Change-Id: I9493330b991b387163f46b8359a611aa7ff7745e
| * Core/IO/Bluetooth - fix ambiguous conversions for macOSAndré Klitzing2019-07-196-26/+26
| | | | | | | | | | | | | | This is a sibling of QTBUG-76847 on macOS instead of iOS. Change-Id: I3df6e28d65b9835f5f54e92d462d23423c48d835 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Do not handle PAIRING_VARIANT_PINAlex Blasche2019-07-173-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user has to enter a pin in such cases. Since QBluetoothLocalDevice does not have an API to return a pin it makes no sense for QtBluetooth to handle this type of request. Android will provide its own fall back form. This patch is mostly a revert of f8c0572ddcd. Fixes: QTBUG-76565 Task-number: QTBUG-70295 Change-Id: I61062ac84ce508f3b82c7359a60d5c9c5bba86a4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * winrt: Do not try to delete nullptr workerOliver Wolff2019-07-171-3/+1
| | | | | | | | | | | | | | | | | | | | | | When calling QBluetoothDeviceDiscoveryAgentPrivate::stop the worker pointer is cleared in disconnectAndClearWorker so there is no need to call deleteLater (which will just result in a warning). Change-Id: I2713474833b61a12018ecfa6f9eb11618ed025a7 Task-number: QTBUG-75089 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Fix compilation with C++20Marc Mutz2019-07-161-2/+2
| | | | | | | | | | | | | | | | | | Implicit capture of 'this' in [=] is deprecated in C++20. Fix by using explicit capture. Change-Id: I96132d83d87ae61986ba1b1ea3f9cf8e50059f1f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"Qt Forward Merge Bot2019-07-113-8/+8
|\ \
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-113-8/+8
| |\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I48ae70ffcb475ced4a05619310f496527cdd4166
| | * Core/IO/Bluetooth - fix ambiguous conversionsTimur Pocheptsov2019-07-053-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... somewhat prospective fix (I do not have the new iOS yet), so far build never failed with my current SDK. Fixes: QTBUG-76847 Change-Id: Iab75c3cd47144cd83b679b1dbf82339e29c07bd1 Reviewed-by: André Klitzing <aklitzing@gmail.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Doc: Replace example file lists with links to code.qt.ioTopi Reinio2019-07-092-0/+2
|/ / | | | | | | | | | | Task-number: QTBUG-74391 Change-Id: I4e66d50a4b98a728956e351d1603e26933dd02c7 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | winrt: Add service thread loggingOliver Wolff2019-06-183-1/+42
| | | | | | | | | | | | | | | | | | | | | | We can run into problems if the list of low energy services is changed from threads other than the main thread. Make it possible to log this information in order to debug these problems more easily. Task-number: QTBUG-75907 Change-Id: Icda8dff45b8c1a72291ade0b1d6f734ab485a241 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Avoid threading issues when handling characteristic changesOliver Wolff2019-06-244-14/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As callbacks do not necessarily happen on Qt's main thread, it is possible that we access the service list while it is being changed if we access it from the callback directly. Doing this can cause application crashes. Thus we hand back the information about a changed characteristic to the main thread via signal/slot and handle it from the main thread. With QLowEnergyControllerPrivateWinRTNew having the Q_OBJECT macro, we can no longer use forward declares for the GATT classes as moc chokes on these. Thus an include is used. Fixes: QTBUG-75907 Change-Id: I063794eecf904921ff55fab76a5bdde3a9aebf44 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | qbluetoothsocket_winrt: Fix clang warningsOliver Wolff2019-06-181-18/+46
| | | | | | | | | | | | | | Change-Id: I71eafba9e7ff47dbfd89e3a650b83b55d1196693 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | qlowenergycontroller_winrt_new_p.h: Use forward declarations instead of ↵Oliver Wolff2019-04-252-4/+23
| | | | | | | | | | | | | | | | includes when possible Change-Id: Ic995631dfc15e34c7f2902bfa850c97671c52367 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Try "connectToDevice" indefinitelyOliver Wolff2019-05-132-103/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | connectToDevice should not fail after a timeout, but try to connect to the device indefinitely. Unfortunately the behavior depends on the device's pairing status so two connectToDevice functions are needed. But the current implementations potentially wait indefinitely until the connection can be established. Change-Id: Iacb81e2c995974020b14d297528e54c326eb0453 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | qlowenergycontroller_winrt_new: Avoid late callbacks that lead to crashesOliver Wolff2019-04-252-83/+97
| | | | | | | | | | | | | | | | | | | | | | Users may run into crashes on device disconnects in case that we run into a callback while the disconnects happen. Thus we have to avoid calling functions on deleted objects by avoiding lambdas if possible or using QPointers in lambda captures. Change-Id: Idcd3781bd396d4ef785191e4c65bae20e5149c04 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | qlowenergycontroller_winrt_new: Add registerStatusChanges and onStatusChange ↵Oliver Wolff2019-05-092-29/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | functions In preparation for following patches, functionality related to status changes was moved into dedicated functions. That makes code more readable and avoids late callbacks which can happen when lambdas are used. Change-Id: Ie699adef238013bb5391b57a1794e0b3d6bf8312 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Add QBluetoothLocalDevice::pairingStatusOliver Wolff2019-06-182-3/+95
| | | | | | | | | | | | Task-number: QTBUG-62294 Change-Id: I61ee7dc30996c8e12c0fa75f7c85931a61c12554 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Create qbluetoothlocaldevice_winrtOliver Wolff2019-06-184-15/+143
| | | | | | | | | | | | | | In preparation for the followup patches. Change-Id: I9b1f6c181adb847f6aafdaf60fcef7139a12b638 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Make sure that ProtocolDescriptorList is always set for servicesOliver Wolff2019-05-271-0/+11
| | | | | | | | | | | | | | | | | | | | | | For some devices the attribute map does not have a protocol descriptor set which throws off Qt's logic. As Windows can only discover RFCOMM services, we can just add that protocol to the service ourselves if it is not found automatically. Task-number: QTBUG-62520 Change-Id: I6ce3948892699049b678b026840d346879b98269 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | qbluetoothsocket_winrt: Use recommended service connection approach if possibleOliver Wolff2019-05-274-17/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSDN documentation states that the recommended way of RFCOMM service connection is via connectionHostName and connectionServiceName (see https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.rfcomm.rfcommdeviceservice). So whenever possible, we should use this information from the native device service when connecting directly to the discovered service. As QBluetoothServiceInfo is basically just a wrapper for the attributes map this information is stored in its private pendant and extracted when a connection attempt is being made. Task-number: QTBUG-62520 Change-Id: I95be5df89a722531393b45fd136d37f302393ca8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-262-0/+11
|\| | | | | | | Change-Id: I0d7c92be8609cb7ec46b1895e1f270678ad681ae
| * BlueZ: Fix leaking client socket when running QLEController Peripheral modeAlex Blasche2019-05-082-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | In fact there are two socket leaks. The first is the socket for the incoming l2cp connection from the central device and the second one is allocated in the ctor of QBluetoothSocket. When QBluetoothSocket::setSocketDescriptor is called the previously ctor allocated socket was simply ignorred. This patch closes both socket. Fixes: QTBUG-75278 Change-Id: Ia483e3c2a04bec3a53ddf744c22b794941edf848 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-111-1/+2
|\| | | | | | | Change-Id: Ieb05b1eb0fa8247726f5f5de771496a9b50b9f55
| * Bluetooth: Compare the server channel when checking for duplicatesAndy Shaw2019-05-101-1/+2
| | | | | | | | | | | | | | | | | | It is possible that the service will appear to be the same but have different server channels. So these services should not be seen as duplicates as a result. Change-Id: I36f9c376fcfd9378f4f18c639e87e1a7aad1815b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-205-8/+55
|\| | | | | | | Change-Id: Ifa3782b009430df67ef2e7ba78ea7d14cc053aa8
| * CoreBluetooth: add a missing -peripheral:didModifyServices: methodTimur Pocheptsov2019-04-164-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With some peculiar device we suddenly (during the service details discovery) got a crash with CBDescriptor suddenly becoming something else - NSString, NSMutableArray etc. - meaning the object was deleted and its memory re-used. It would appear, CBPeripheral can suddenly change it's services tree and it informs its delegate (aka 'us') about this change using the (previously) missing method. In this method we cannot do much, due to the specificity of our public API that allows concurrent discoveries, it's 'non-monolitic' (in several steps) discoveries etc. etc. So the only thing we can do - stop everything, remove all services, transition to QLowEnergyController::ConnectedState and wait for a user to re-discover services. Fixes: QTBUG-75043 Change-Id: Ie98d90aea112e40b4c6771e3f7315772dfd92b39 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * winrt: Fix reading of descriptor valuesOliver Wolff2019-04-151-8/+12
| | | | | | | | | | | | | | | | | | | | We have to access the service data instead of relying on passed references as these references might have run out of scope and thus might not be valid any more. Fixes: QTBUG-75070 Change-Id: I02ad0fef2337488c926fb950ddf2da6eda56a396 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Remove unused functionv5.13.0-beta3Oliver Wolff2019-04-151-28/+0
| | | | | | | | | | Change-Id: I795c9b60454c350c56a4dd362b5b359b12a3a8f9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Move byteArrayFromBuffer into qbluetoothutils_winrtOliver Wolff2019-04-156-82/+43
| | | | | | | | | | | | | | | | That code has been (unneededly) duplicated several times. We should have that helper function just once. Change-Id: I28fc9c5f7f7218b7870dc30bec228c9af8c6b090 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Avoid asserts in helper functionsOliver Wolff2019-04-151-8/+24
| | | | | | | | | | Change-Id: I1759d7507d778ee60c6727621a3f58a7c7509718 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-134-44/+78
|\| | | | | | | Change-Id: I92b7c4a2948ddb8bdf7fead0a3351379138b0905
| * Don't create QBluetoothServiceInfo when uuid is nullAlex Blasche2019-04-121-1/+4
| | | | | | | | | | | | | | | | Sometimes Android returns a null uuid as SDP result. There is no point processing them further. Change-Id: I07b52e79a31becda72452e3446aca9ea4933968b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Android: Don't filter SPP uuidAlex Blasche2019-04-121-11/+12
| | | | | | | | | | | | | | | | | | | | Even though it is not recommended to listen on reserverd BT UUIDs, there are SPP services which do not advertise with a custom uuid or the custom uuid is not an SPP service. In such cases we want a BluetoothServiceInfo instance that advertises SPP as serviceUuid(). Change-Id: Ic54d663392f8f8b2ba5684c57216bf2b69aca477 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| * Streamline QBluetoothServiceDiscoveryAgentPrivate::populateDiscoveredServicesAlex Blasche2019-04-101-32/+33
| | | | | | | | | | | | | | | | | | The changes are of cosmetic or code optimization nature. The functionality is not changed at all. Change-Id: Ideb63d87ed07201024b73e2f40d33393b68963bc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * Android: Increase chance of establishing serial connection w/o SPP uuidAlex Blasche2019-04-102-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SDP discovery on Android only returns a flat list of uuids. It mixes service class uuid and service uuids. Furthermore it is unable to detect whether a serial connection uses rfcomm or l2cp as base protocol. The last limitation is the fact that serial sockets can only be established using rfcomm (no l2cp). This poses a serious challenge because there is no way to say whether a given custom service uuid is indeed an SPP based service or whether it uses rfcomm. The only way to know for sure is to connect and check whether it succeeds. This also means QBluetoothServiceInfo instances returned by QBluetoothServiceDiscoveryAgent may or may not mark a serial service with SPP uuid or rfcomm protocol tag. Currently, it guess that that a custom uuid together with SPP uuid implies an rfcomm setup. If the SPP uuid was not found, rfcomm is never set (but is a requirement for QBluetoothSocket). This patch makes QBluetoothSocket on Android a bit more forgiving by assuming every given QBluetoothServiceInfo instance requires rfcomm. After all that's the only supported protocol on Android. Fixes: QTBUG-75035 Change-Id: I498ac5acd2a394b198a113fd23d750bbf17a7f7b Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| * Fix clang-cl errors about narrowing conversionsKai Koehne2019-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Force value to be a DWORD (unsigned long) instead of HRESULT (signed long). Fixes bluetoothsocket_winrt.cpp(770,10): error: case value evaluates to 2147952460, which cannot be narrowed to type 'long' [-Wc++11-narrowing] Change-Id: I4f1eb75807d4783b835094ad1b33e56f601ffb39 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Update plugins.qmltypes for Qt 5.13Kai Koehne2019-04-122-4/+4
| | | | | | | | | | Change-Id: I518201f08040260e85968347cc4c68330f1b8787 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Avoid asserts in discoverServiceDetailsOliver Wolff2019-04-101-15/+26
| | | | | | | | | | Change-Id: Ib949c16d80a09c47a0bb332e026459438c901031 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Avoid asserts in writeCharacteristicOliver Wolff2019-04-101-9/+18
| | | | | | | | | | Change-Id: I3044324fb300b918ae466d3c4430c4dd55eed2bd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Avoid asserts in readCharacteristicOliver Wolff2019-04-101-8/+8
| | | | | | | | | | Change-Id: I3617e22fcded5dc7066bf05c6d7bf791fce4dd02 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Avoid asserts in writeDescriptorOliver Wolff2019-04-101-24/+59
| | | | | | | | | | Change-Id: Ib8de4e76893104f27d79f44440a0186985d9abe5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Avoid asserts in readDescriptorOliver Wolff2019-04-101-25/+71
| | | | | | | | | | Change-Id: I0a446e5bc81e3d306da7c15e0c1907dab459a129 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Avoid deprecated functions and asserts in discoverServicesOliver Wolff2019-04-101-10/+27
| | | | | | | | | | | | | | | | get_GattServices is deprecated and we should use the operation's result to obtain the list of services. Change-Id: I45e7217f0667ade4fe975e13010238dbe48f197e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Avoid deprecated functions and asserts in obtainIncludedServicesOliver Wolff2019-04-101-9/+20
| | | | | | | | | | | | | | | | GetAllIncludedServices is marked deprecated and GetIncludedServicesAsync should be used instead. Change-Id: Ib5778809c1f90be9cddc9dd12e831c998f50469c Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Avoid asserts in getNativeCharacteristicOliver Wolff2019-04-101-2/+23
| | | | | | | | | | Change-Id: I4a555222071c75a56b45477b1a894b929ffc1e58 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: unregister status change callbacks on disconnectOliver Wolff2019-04-102-10/+20
| | | | | | | | | | | | | | We have to prevent late callbacks. Change-Id: Iedb36cdfb9708403bdbd68b68718c4b26f38d657 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Avoid asserts in connectToDeviceOliver Wolff2019-04-101-102/+106
| | | | | | | | | | | | | | | | | | get_GattServices is marked deprecated and GetGattServicesAsync should be used instead. We should avoid asserts whenever possible as users might run into "crashes" otherwise. Change-Id: Ibd07a846f3a23d3390061e42fd034d21ec2b9901 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Do not assert/crash in registerforValueChanges/unregisterFromValueChangesOliver Wolff2019-04-101-1/+13
| | | | | | | | | | Change-Id: I6ea4ae73b53cd705156e15ce8820467bddedcf6f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Proper error handling in obtainCharListOliver Wolff2019-04-102-147/+254
| | | | | | | | | | | | | | | | | | | | GetAllCharacteristics was deprecated by MS and GetCharacteristicsAsync should be used. Additionally we should avoid asserts and instead try to handle errors gracefully whenever possible as users will run into "crashes" otherwise Change-Id: I45d52374f8612621b5b3974a973d9a1a95b851ee Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta2Qt Forward Merge Bot2019-04-065-38/+38
|\| | | | | | | Change-Id: Ieeeab88ca3afd1fb42aafb9e05bf426caec065ef