summaryrefslogtreecommitdiffstats
path: root/src/bluetooth
Commit message (Collapse)AuthorAgeFilesLines
...
| | | * 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>
| | * | 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.13' into devQt Forward Merge Bot2019-04-095-38/+38
| |\| | | | | | | | | | | | | | Change-Id: I92bdddd630d739b83aa8837d238eefbd3108e32e
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta2Qt Forward Merge Bot2019-04-065-38/+38
| | |\| | | | | | | | | | | | | Change-Id: Ieeeab88ca3afd1fb42aafb9e05bf426caec065ef
| | | * Use QAndroidJniExceptionCleaner instead of QAndroidJniEnvironmentBogDan Vatra2019-04-051-11/+4
| | | | | | | | | | | | | | | | | | | | Change-Id: I357091799f04a3ef1c8df78960eb63a46e2b3d6c Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | | * Fix possible leakBogDan Vatra2019-04-051-2/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Ide883a3c354eb42ea0017e1d623843967b522083 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | | * Check the reverted UUID when filteringBogDan Vatra2019-04-053-25/+33
| | | | | | | | | | | | | | | | | | | | Change-Id: Idb12d3bb116d6c5b34f1ca145f473b118b58d5ee Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-024-20/+12
| |\| | | | | | | | | | | | | | Change-Id: Ie85bb5c9311cfdb2f18dc4fd04854ec22e620ff5
| | * | winrt: More corrections for handling device disconnectionsOliver Wolff2019-03-282-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signal about device disconnections has to be done at the very end of disconnectFromDevice as a user's application might access an invalid mDevice otherwise if it tries to reconnect automatically. The list of device services has to be invalidated when a remote device disconnects. The same is done in other backends. Additionally the "valueChanged" callbacks should be unregistered on device disconnection. Thus we avoid late callbacks which might cause asserts. Task-number: QTBUG-74394 Change-Id: I156be8ebefc9d9e5533bc60e7018088641680ba3 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-272-16/+2
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Id7c4409314c2ad5daf5bc9860befe096a2384849
| | | * Ensure DBus based QBluetoothSocket emits bytesWritten() signalAlex Blasche2019-03-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtBluetooth][Linux/BlueZ] Fixed missing emission of QBluetoothSocket::bytesWritten() signal on Bluez v5.46+. Fixes: QTBUG-74513 Change-Id: I93cb5abe65e13f6a5cc5bb195cc98526a507916a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * qlowenergycontroller_android_p.h: Remove unrelated preprocessor blocksOliver Wolff2019-03-251-16/+0
| | | | | | | | | | | | | | | | | | | | Change-Id: I964806ccdb3bd39a33b860d496ef05f8b96135db Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-269-51/+225
| |\| | | | | | | | | | | | | | Change-Id: Ib26b9afb157c24164af7c37db66531910c570b53
| | * | Remove winrt TODOs about manufacturer dataOliver Wolff2019-03-252-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-71943 Change-Id: I35f9aedb0615d8341f93f67b4549d1e9a03c9cb9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * | winrt: Fix deprecation warningOliver Wolff2019-03-251-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IGattCharacteristic::GetAllDescriptor is deprecated and thus should not be used. As we are calling GetDescriptorsAsync anyways and are inside the Completed callback of that function we should use its result anyways. Change-Id: I362f860d66da75dd899ed89604e426952ce9fe1b Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * | winrt: Fix notifications in Bluetooth LEOliver Wolff2019-03-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to register callbacks for every indicatable characteristics we encounter during lookup so we have to store our list for the whole lookup period. Previously the list of indicatable characteristics was recreated in every "Completed" handler of Characteristic::GetDescriptorsAsync. The result was, that at most 1 indicatable characteristic was found. That behavior is wrong and we have to store the list of indicatable characteristics through the whole obtainCharList call. Fixes: QTBUG-74394 Change-Id: Ie93d9bd0184686d2d7cf9b082e85cf89ca5493ce Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * | winrt: Stop LE device watcher when discovery is finishedOliver Wolff2019-03-191-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to protect ourselves from late callbacks we have to unregister the LE watcher's callback as soon as we signal, that we are done with device discovery. We do not expect any additional devices afterwards and might run into a late callback otherwise, so we should stop the watcher immediately and not wait until worker destruction. Change-Id: I85520a4724397aeb5a693d2c8b940a72d68d9663 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * | winrt: Handle device disconnection properlyOliver Wolff2019-03-194-14/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "ConnectedState" is not the only valid "connected" state for QLowEnergyController. "disconnected" also has to be emitted, if we were in DiscoveredState and co. Additionally every value change callback has to be removed and mDevice has to be closed in disconnectFromDevice to make Windows disconnect from the device as there is no specific API to do that manually. Task-number: QTBUG-74394 Change-Id: Ic025b2c668f887db6c4a631cd8fee26a457bc279 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * | winrt: Use correct worker signal slot disconnectionOliver Wolff2019-03-191-4/+3
| | | | | | | | | | | | | | | | | | | | Change-Id: I41929e01b79ca0eacf80fcb1d5cead2146eb2e8e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * | winrt: Implement manufacturer dataOliver Wolff2019-03-193-24/+117
| | | | | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-71943 Change-Id: Idb0524dde871d4aa153f0170f926ae76679f14cb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * | winrt: Implement rssiOliver Wolff2019-03-192-11/+67
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-71943 Change-Id: I5f508c6d858f088d518fc0b3ad9644273f31e2de Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * | Fix warning about initialized but not referenced variableOliver Wolff2019-03-191-1/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: Iabb236577d813bf72b2237fedc60b894fae06bc4 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-121-0/+3
| |\| | | | | | | | | | | | | | Change-Id: I87d4b6fa5c7f6d9107ab2c6f93b3c9f21b67e6c8
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta1Qt Forward Merge Bot2019-03-091-0/+3
| | |\| | | | | | | | | | | | | Change-Id: Ia762f6ebce1512f937a529f68eb02c008ecd9732
| | | * Bluez-DBus: Fix crash at calling disconnect while not connectedChristian Wassmuth2019-03-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling disconnectFromDevice() while not connected or in ClosingState caused a crash on accessing device which is null. [ChangeLog][QtBluetooth][Bluez-DBus] Fix crash at calling QLowEnergyController::disconnectFromDevice while not connected Change-Id: I5979e3e5fca62c4a1469014e4f553c7db24f8dac Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-194-47/+66
| |\| | | | | | | | | | | | | | Change-Id: I4f9863399eff37efed66787ae6746f6f2103d109
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-164-47/+66
| | |\| | | | | | | | | | | | | Change-Id: Idd29729e80d44abe6404da2853c2fe1e887f7db4
| | | * Ensure signed int are written in base 10 notationAlex Blasche2019-02-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was converting signed ints/chars/shorts to hex notation without prepanding the '0x'. This led to Bluez reading the value as base 10 value and created the problem that values containing letters were improperly parsed. Fixes: QTBUG-73330 Change-Id: I9407a82495761b2e541e13b282ad6ccdb7cdd84a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| | | * Cleanup QBluetoothServiceInfo xml stream writer on BluezAlex Blasche2019-02-151-11/+3
| | | | | | | | | | | | | | | | | | | | Change-Id: Iad66628307a2167cdd6c64080457c670697bd1f7 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * Ensure SDP records can be byte arrays/hex encodedAlex Blasche2019-02-154-33/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses the issue on Bluez only. macOS ignore such attribute values and WinRT implicitly converts them to hex strings. The macOS debug stream operator produced slightly different output compared to the other platforms. The output between the platforms must match though. Therefore, the general version was copied over to macOS. Task-number: QTBUG-73328 Change-Id: Ieea2a3a559b5686f7f7d16d5c75dd9ef2782cdf5 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-125-43/+97
| |\| | | | | | | | | | | | | | Change-Id: I572be0994aa38a7f6fbfdd5e80738ee350c637d7
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-095-43/+97
| | |\| | | | | | | | | | | | | Change-Id: Ie734d2574c039a7f45d84455811472ea5b8c8e1c
| | | * Fix unit test failure on AndroidAlex Blasche2019-02-081-11/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It fixes the following failure FAIL! : tst_QBluetoothServiceDiscoveryAgent::tst_invalidBtAddress() Compared values are not the same Actual (discoveryAgent->error()) : InvalidBluetoothAdapterError Expected (QBluetoothServiceDiscoveryAgent::NoError): NoError This behavior was caused by the fact that the InvalidBluetoothAdapterError was already triggered in the QBluetoothServiceDiscoveryAgent ctor whereas convention for this class states that the error is set when QBluetoothServiceDiscoveryAgent::start() is called. The fix detects whether the requested local adapter address matches the existing local adapter address. If there is no match Invalid adapter error is thrown. Task-number: QTBUG-73571 Change-Id: I3216e1609820a66893768b33f0fc695fbad6966a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * Add Android exclamation to QBluetoothServiceDiscoveryAgent ctor docsAlex Blasche2019-02-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing the local address does not work because the passed address cannot be matched against the local adapter address. For privacy reasons this is not possible anymore since Android 6.0. Change-Id: Iacc632dda4af83265bdc3a062c0eba6c31cfa596 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * Fix potential bug in osxbtcentralmanagerTimur Pocheptsov2019-02-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to the problem found in osxbtleinquiry - 'timers' waiting to fire on "qt-LE-queue" know nothing about us, potentially deleting the delegate object in response to Bluetooth switched off. Task-number: QTBUG-73140 Change-Id: I1a39a1ca02d019f90a1b4214cdbbb76e26b9eea0 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | | * Bluetooth LE scan - fix a crash (CoreBluetooth)Timur Pocheptsov2019-02-071-30/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. When the central's state changes to powered off, we emit PoweredOffError and QBluetoothDeviceDiscoveryAgent deletes Obj-C instance - a delegate for CBCentralManager. But we can still have GDC timer waiting in a queue and triggering the crash while using a dangling pointer. So we have to properly cancel the timer. 2. CoreBluetooth under debugger warns about API misuse - calling stopScan, apparently, is not allowed if CBCentralManager is in a state different from 'powered on'. Change-Id: Ib218105735995dc7988751fa04a6c76cab10cba8 Fixes: QTBUG-73140 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | | * Doc: Fix link error to \macosNico Vertriest2019-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I82d691667232bebf7fed2cf9b24b234289e6d258 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | | Add QLowEnergyController::createCentral() with localDevice overloadAlex Blasche2019-02-113-4/+34
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | The QLowEnergyController ctor with localDevice overload was obsoleted but the new API did not provide an equivalent createCentral() overload. This patch fixes the problem. Fixes: QTBUG-63019 Change-Id: I4c5a249bbf20c78da5507fecc874daa67e3dce46 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Enable the use of the Win32 Bluetooth backendAndre de la Rocha2019-08-0522-297/+497
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change enables the optional use of the Win32-based Bluetooth backend on Windows. By default, the WinRT backend is used, if supported by the platform. The use of the Win32 backend must be selected by the -native-win32-bluetooth configuration option. Task-number: QTBUG-40698 Change-Id: I6904bf077467d826e3ff5ad026ebae5f955f2e37 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>