summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
Commit message (Collapse)AuthorAgeFilesLines
* bluez: Fix out of sync property cacheThiemo van Engelen2019-12-041-0/+1
| | | | | | | | | | | | | | | Since commit 2c6dcc643, a map containing dbus property values is kept per device to be able to make QBluetoothDeviceInfo instances without having to make dbus calls. However, this map could get out of sync. The reason was that the code started to listen to PropertyChanged signals after it received the initial set of properties. This meant that there was a short amount of time where bluez could send out a signal with changed properties and the DiscoveryAgent would not receive it. In order to keep the map in sync, a PropertyChanged listener is now installed when scanning is started, picking up all changes. Change-Id: Iae5e219b187e94bf280a6dd76ccde49cafd1d9c5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Do not make blocking dbus calls in dbus callbacksAlex Blasche2019-09-111-1/+2
| | | | | | | | | | Doing so blocks the main event handler which could lead to a sluggish UI experience. Fixes: QTBUG-77390 Change-Id: Id3624d602131c04e535584a7a4740ce2f751daaf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiemo van Engelen <tvanengelen@victronenergy.com>
* Align deviceUpdated() & deviceDiscovered() behaviorAlex Blasche2019-09-111-1/+1
| | | | | | | | | | The documentation for QBluetoothDeviceInfo::deviceDiscovered() and deviceUpdated() is fairly specific. This change brings Bluez5 behavior in line with Android and Apple platforms. Change-Id: Ia819f8b8a9b5c2268edbee0a3005e0129d0553e6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiemo van Engelen <tvanengelen@victronenergy.com>
* Merge remote-tracking branch 'origin/dev' into wip/winOliver Wolff2019-08-071-2/+67
|\ | | | | | | Change-Id: I83175151c0eef1a11d2f21648cc04c86e46777c1
| * De-duplicate device discovery code (Darwin)Timur Pocheptsov2019-06-141-2/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - use the shared *._p.h file/class declaration for the private class - use the shared *.cpp with the public class implementation - get rid of *_ios.mm - iOS/tvOS/watchOS specific implementation and use the shared (by macOS, iOS, tvOS, watchOS) *_darwin.mm source. - get rid of somewhat weird 'isValid' in the private class, it is is not taken care of in the public API anyway and today its whole concept/usage looks (quite) buggy to me. I only have to check that the default controller is not nil and has the state 'ON'. Task-number: QTBUG-75348 Change-Id: I5383e4f8df02ac12f069c2f59e252cb8a200800b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * winrt: Implement manufacturer dataOliver Wolff2019-03-191-1/+5
| | | | | | | | | | | | Fixes: QTBUG-71943 Change-Id: Idb0524dde871d4aa153f0170f926ae76679f14cb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * winrt: Implement rssiOliver Wolff2019-03-191-0/+1
| | | | | | | | | | | | Task-number: QTBUG-71943 Change-Id: I5f508c6d858f088d518fc0b3ad9644273f31e2de Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'gerrit/dev' into win32Alex Blasche2018-11-221-5/+5
|\| | | | | | | Change-Id: Ie99a67b63f8259227f42f5b464c6bbc16e79313b
| * Code cleanup: Use nullptr wherever possibleAlex Blasche2018-08-241-5/+5
| | | | | | | | | | Change-Id: I7dd2d055c8d667f049d7cb2c371619137bf76030 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | win32: inline unnecessary functions in qbluetooth*discoveryagentEric Lemanissier2018-06-251-13/+3
| | | | | | | | | | | | | | | | by migrating to templated QMetaObject::invokeMethod Change-Id: I79e2dec7aa81987894a26859648d31da60cf47ee Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | win32: modernize qbluetooth*discoveryagentEric Lemanissier2018-06-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | arguments pass by ref NULL and 0 replaced with nullptr ::ZeroMemory replaced by default initialization range based for loop Change-Id: I393806f19155ee31e4ebe7f33ce22e9d14eafe40 Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | win32: remove usage of QFuture in qbluetoothdevicediscoveryagentLubomir I. Ivanov (VMware)2018-05-291-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a couple of QThread instances and workers for the Bluetooth Classic and BLE device discovery. Replaces the usage of QFuture for this file. Remove includes of QtConcurrent. This introduced some errors which are solved by including: - QLoggingCategory in qbluetoothdevicediscoveryagent_win.cpp - QDataStream and QCoreApplication in qlowenergycontroller_win.cpp Change-Id: Iba2cbc147c714ae87515294d50cb4e502edd00a7 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Merge remote-tracking branch 'gerrit/dev' into winAlex Blasche2018-02-201-0/+3
|\| | | | | | | Change-Id: I4e86dcfe5088b0bd5087de309c435250c76d4718
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-301-0/+5
| |\ | | | | | | | | | Change-Id: Iaa053dcb125490ee1e83d7e27cb75d4171297b9f
| | * winrt: Fix build using -no-pchOliver Wolff2017-10-251-0/+5
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-63210 Change-Id: I98637337d8a77c8847bd0f2c567fec5e6a4ace31 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Merge remote-tracking branch 'gerrit/dev' into winAlex Blasche2017-10-171-4/+3
|\| | | | | | | | | | | Change-Id: I28ee9f95cc0fb85a36b5bd7b2ad87e0179446995
| * | Merge remote-tracking branch 'gerrit/5.9' into devAlex Blasche2017-07-261-2/+2
| |\| | | | | | | | | | Change-Id: Ida3681a873698f22c28bc60230ca0c49d2a9d25f
| | * Windows: Fix namespaced buildOliver Wolff2017-07-261-2/+2
| | | | | | | | | | | | | | | Change-Id: I9f6a7c3884c2d7c9b0856a0e9a689ad88cca59fe Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * | Use Bluez's SetDiscoveryFilter to control the device discovery methodAlex Blasche2017-07-241-1/+1
| |/ | | | | | | | | | | | | Task-number: QTBUG-57575 Change-Id: Ia289bcb1e0172e74bbda7f4b2dbc904ca1f5a856 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * winrt: Do not emit canceled in timeout case in device discoveryOliver Wolff2017-07-041-1/+0
| | | | | | | | | | | | | | | | | | canceled should only be emitted if stop was used to abort a running device discovery. A timeout happening has to cause a normal finished. Change-Id: I1072c14a44b84da0cb93420cf7344b8bc56b523e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Fix classic and LE devices discoveryDenis Shienkov2017-06-191-6/+12
| | | | | | | | | | | | | | | | | | | | | | Devices discovery was broken due to merging from 5.9 branch. Where were introduced new QBluetoothDeviceDiscoveryAgent::DiscoveryMethods feature. But now, this code is refactored and adjusted in completelly asynchronous manner. Change-Id: I9b7c4cbe27066ed05d1ed4546f71ea559544f6f5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'gerrit/5.9' into wip/winAlex Blasche2017-05-121-19/+43
|\| | | | | | | Change-Id: Ia247c260a9fa27df79d18e5397eba5918d626684
| * Replace custom QT_BLUEZ_BLUETOOTH against the related feature defineAlex Blasche2017-04-061-3/+3
| | | | | | | | | | Change-Id: I4fbb948841a610640acaf87364e2157e31782836 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| * winrt: Enable BTLE support for Windows 10 (Mobile)Oliver Wolff2016-10-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As Windows 10 (Mobile) asks for permission before the user is able to use a Bluetooth (LE) device, the synchronous approach does not work any more. While implementing that new asynchronous way the sources were also cleaned up to be more readable (separate declaration and definition of QWinRTBluetoothDeviceDiscoveryWorker). As device discovery and Bluetooth LE work as expected on Windows 10 (Mobile) it is enabled by default now. Task-number: QTBUG-55862 Change-Id: I9e4a8d21d013b9eaf603380a784afdda3e1ab9ec Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * winrt: Filter devices found by the LE device watcherOliver Wolff2016-08-091-0/+1
| | | | | | | | | | | | | | | | | | It is possible that devices are found by the initial scan and by the device watcher. In this cases the "device found" signal should not be emitted. Change-Id: Ic8aa5a088092adfa8a5b2ea5a3c91350a7897e6a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * winrt: Implement LE device discovery timeoutOliver Wolff2016-08-041-0/+3
| | | | | | | | | | Change-Id: If6ec32dc3105b3498eef8a20e8f464a85f1ee891 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Merge remote-tracking branch 'gerrit/dev' into btleAlex Blasche2016-07-131-1/+3
| |\ | | | | | | | | | | | | | | | | | | Adds the minimum compile requirements for the new QBluetoothDeviceDiscoveryAgent API. Change-Id: Idfe07bee63de9d2849ab68eb455d0be470591795
| | * Permit selection of discovery mode (btle vs classic)Alex Blasche2016-07-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces the new API but does not yet implement the specific selection. In any case BlueZ does not need any specific implementation as classic and BTLE devices are found using the same method. iOS does not need any specific implementation as it only supports BTLE discovery. Task-number: QTBUG-46253 Change-Id: Ie6365966091effe5f3a68f8a283657c7cb43b692 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| | * Add BTLE device discovery timeout APIAlex Blasche2016-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This timeout adjusts the BTLE device discovery. Some BTLE devices require some time to show up in such a search. In general the platforms use open ended search methodologies as their own usage pattern for BTLE device discovery too. So far Qt Bluetooth limited the time through a hardcoded value which the API user could not adjust. Task-number: QTBUG-53012 Change-Id: Ia37cebd4015b438db998c6b4a265f563c1a2f89f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * | Merge branch 'dev' into btleAlex Blasche2016-05-131-14/+20
| |\| | | | | | | | | | Change-Id: I073f6c45696fe28b83335fb65cca6270c458851d
| | * Updated license headersAntti Kokko2016-01-201-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I856c13e2a6d4d12c46e1286b0ca1c092ee4608f8 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | winphone: Added bluetooth device discoveryOliver Wolff2015-09-221-1/+14
| |/ | | | | | | | | | | Change-Id: I1086ffb05b7a632a9329822c150169a3482c6655 Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Windows: Use Qt::HANDLE instead of typedef void*Denis Shienkov2015-11-171-2/+1
| | | | | | | | | | | | Change-Id: I4f2194501f652c38cff43ac1716a5853cd1e1b13 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Windows: Use QT_WIN_BLUETOOTH macro where it is possibleDenis Shienkov2015-11-171-3/+3
| | | | | | | | | | | | Change-Id: I77811a65b530c8994b622d4d18718c50ec629684 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Windows: Rename variables which is the system handlesDenis Shienkov2015-10-231-1/+1
| | | | | | | | | | | | | | | | | | Now the system handles have the 'h' prefix (e.g. hService), not to confuse with the others variables which contains the 'Handle' suffix (e.g. with the serviceHandle and so on). Change-Id: I3b79c5323bce043c93326edf6d660ea4bde8522a Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Windows: Refactor code related to discovering of a remote devicesDenis Shienkov2015-10-141-37/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | * There is no need to do parallel scan for LE and Classic devices. It is enough to do it one after another by using one QFutureWatcher instead of two QFutureWatchers. * Now the qwinclassicbluetooth(h).cpp files are deleted from the 'windows' directory, and its related code is moved into QBluetoothDeviceDiscoveryAgentPrivate. Change-Id: I2acf102c3a8d313d078b351e9a2ce54ebca79dee Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Merge branch 'dev' into winAlex Blasche2015-09-241-28/+1
|\| | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetooth.cpp src/bluetooth/qbluetoothdevicediscoveryagent_p.h src/bluetooth/qbluetoothlocaldevice_p.h Change-Id: I20fa8968db6c6461014899698c17aa86cd969189
| * Remove QNX/BlackBerry implementation for QtBluetoothAlex Blasche2015-06-171-28/+1
| | | | | | | | | | | | | | | | | | [ChangeLog][QtBluetooth][Platform Specific Changes] Removed support for Blackberry 10. Change-Id: I431c4f34bb10aa3668542df7a8b3403b61bf4705 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge branch 'dev' into wip/winAlex Blasche2015-02-261-7/+7
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetooth.cpp src/bluetooth/qbluetoothdevicediscoveryagent.h src/bluetooth/qbluetoothdevicediscoveryagent_p.h src/bluetooth/qbluetoothlocaldevice_p.h Change-Id: I29d64bd02580a8d0e547b0d7e7b7cf14832c5034
| * Update copyright headersJani Heikkinen2015-02-161-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I3822a6484e8f7a420330de1cb1aeb0c3d1cf41b7 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | Add discovering for BLE devices on WindowsDenis Shienkov2014-12-041-0/+23
| | | | | | | | | | | | | | | | | | | | | | BLE devices are supported in Windows 8 and above. Windows has not public API to discovering/pairing of BLE devices. A user shall do it by means of standard "bluetooth" application which are inbox into Windows. Only after that there is an opportunity to display the discovered devices. Change-Id: Idd3d2949456a32c8c333744205755853aef80422 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Refactor of code for "classic" part on WindowsDenis Shienkov2014-12-011-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous code is based on the assumption where we can use each of local radio separatelly to discovery of remote devices. Windows API allows to use a handle of separately local bluetooth adapter to operate with its power, to start/stop detection of remote devices through it and so on. But in this API there is no opportunity to enumerate services and attributes of the given remote device via the concrete local adapter. Therefore now to discovery of remote devices are used all local bluetooth adapters in system. Also, the power and the host modes management now are belongs to all local adapters at once. Tested on Windows 8 with the USB CSR8510 A10 adapter Change-Id: I949b112158a575f5b563a78163c1e3990c952ada Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Merge branch 'dev' into wip/winAlex Blasche2014-11-131-3/+10
|\| | | | | | | | | | | | | | | Conflicts: src/bluetooth/bluetooth.pro src/bluetooth/qbluetoothlocaldevice_p.h Change-Id: Ic50580a3828e6c1f7c71fc79e1247df73cc1ecb7
| * Android: Add BluetoothLE device scanAlex Blasche2014-10-281-3/+10
| | | | | | | | | | | | Change-Id: Ibbb1e9f141d494327082aebaf9e34ffe44039115 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Merge branch '5.4' into wip/winAlex Blasche2014-09-081-18/+21
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetooth.cpp src/bluetooth/qbluetoothdevicediscoveryagent.h src/bluetooth/qbluetoothdevicediscoveryagent_p.h src/bluetooth/qbluetoothlocaldevice_p.h Change-Id: I87958a39605af9c2d45bbc63dc61771c5fa1cc76
| * Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-281-0/+11
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp Change-Id: Ie8bf1903f9c7c1ccd5b05a3f97049ae0882b88b8
| | * Add missing private headers warningSamuel Gaist2014-08-181-0/+11
| | | | | | | | | | | | | | | Change-Id: I0f079a9b1b45bd2d2e946e06d7688f299a9c3fc3 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * | Update license headers and add new licensesJani Heikkinen2014-08-241-19/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I7a8b8b787fcae9a178794364efdefe1021d10b1b Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | | Implement the QBluetoothDeviceDiscoveryAgent class on WindowsDenis Shienkov2014-09-011-1/+29
|/ / | | | | | | | | Change-Id: I74eaf9acedbcd5b601ff3a6feef21869dbbf9bd9 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Improve consistency of device discovery.Alex Blasche2014-08-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device discovery of BTLE devices fails once the second device discovery is performed in the current process. The first discovery always succeeds. BTLE devices are advertised right after the start of the device discovery session. However the discovery session never seems to stop once it is done for the first time. This can be seen by the fact that the Discovering property of the adapter constantly toggles between true and false. As a consequence the second device discovery won't find a BTLE device in 99% of all cases. The odds that the API user initiates the second discovery right between two continues adapter searches is rather slim. The fix is to extend the device discovery process beyond a toggle of a single device discovery cycle. We ignore the end signal of the first cycle and continue to the end of the second cycle. At the same time we rely on the perceived bug which restarts the second cycle automatically. Just for the case that the second cycle doesn't start automatically we utilize a timer to manually force an end of the device discovery. The problem is likely to be a bug in Bluez4. A negative side effect of this workaround is a longer device discovery process. Change-Id: I986c8d6498b2cc9ed51f4457267c53813132cf8e Reviewed-by: Fabian Bumberger <fbumberger@rim.com>