summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Enable the use of the Win32 Bluetooth backendAndre de la Rocha2019-08-051-25/+18
| | | | | | | | | | | | 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>
* win32-bt: fix warnings related to comparisons and initializersLubomir I. Ivanov2019-02-131-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Silence a couple of type of warnings: 1) warning: missing initializer for member '_BLUETOOTH_DEVICE_INFO::Address' [-Wmissing-field-initializers] BLUETOOTH_DEVICE_INFO deviceInfo = {0}; Unlike C, C++ is not happy about this type of initializer Use '{}' instead to init all members to zero or 'NULL' properly. 2) warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (socket != INVALID_SOCKET) { 'socket' is defined as 'int', while 'INVALID_SOCKET' is derived from 'SOCKET' which is of type UINT. Cast 'socket' to 'SOCKET' before performing the comparison. Change-Id: I9fcbff1c60ae36b8a8fed63382a8ffc0157f4923 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* win32: inline unnecessary functions in qbluetooth*discoveryagentEric Lemanissier2018-06-251-45/+28
| | | | | | | | 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: make bluetooth tst_startStopDeviceDiscoveries passEric Lemanissier2018-06-211-2/+2
| | | | | | | | QVERIFY(discoveryAgent.errorString().isEmpty()) was failing Change-Id: I7b45db5b1af1ee3da75569d8855487c771cb29ed Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* win32: modernize qbluetooth*discoveryagentEric Lemanissier2018-06-211-23/+18
| | | | | | | | | | | 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-21/+42
| | | | | | | | | | | | | | | | 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>
* Update license information for Windows filesLubomir I. Ivanov (VMware)2018-02-201-14/+20
| | | | | Change-Id: Iec42df246c5faec4260bbeb0dbf806477530d30f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Improve processing of discovered deviceDenis Shienkov2017-06-201-33/+27
| | | | | | | | ... where now we use std::find_if algorithm instead of indexed container enumeration. Change-Id: I081dcc92e7b6c1d7a160e62d32ba2cc1182cf43a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix classic and LE devices discoveryDenis Shienkov2017-06-191-65/+148
| | | | | | | | | | | 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>
* Get rid of QList in favor to QVector where possibleDenis Shienkov2017-06-121-9/+7
| | | | | Change-Id: I872e7d6bc4371beed0b80eb1ebb374d2c48c9167 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Replace 'foreach' macro with range-based 'for'Denis Shienkov2017-06-071-3/+2
| | | | | Change-Id: I7010ff54a146a9d70029e2607b415e0e1dcc1d78 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Use std::find_if to check for local adapter addressDenis Shienkov2017-06-071-9/+7
| | | | | Change-Id: I53af8c2a5dc848d1f90221d036c59f17c44921dc Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Replace 'forever' macro with 'for (;;)' statementDenis Shienkov2017-06-071-1/+1
| | | | | Change-Id: I402b856be06db0e55ec2efb21fc6cb8f35e57a0c Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Initialize lowEnergySearchTimeout with -1Denis Shienkov2017-06-071-0/+1
| | | | | | | | .. that allows to pass the tst_discoveryTimeout() test. Change-Id: I1af53c8186151fcb6017b07b28f4b8355d91d072 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'gerrit/5.9' into wip/winAlex Blasche2017-05-121-2/+11
| | | | Change-Id: Ia247c260a9fa27df79d18e5397eba5918d626684
* Windows: Rename variables which is the system handlesDenis Shienkov2015-10-231-15/+15
| | | | | | | | | 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-229/+327
| | | | | | | | | | | | | * 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>
* Windows: Simplify code related to enumerating of a local radiosDenis Shienkov2015-10-131-13/+3
| | | | | | | | | | | It is the first stage to cleaning of the 'windows' directory. A shared code related to enumerating of a local adapters are moved to the QBluetoothLocalDevicePrivate class. Change-Id: I208b79c29cd1f906b6fed627d25c7b1310718581 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Windows: Use the new signsl/slot syntaxDenis Shienkov2015-10-011-4/+4
| | | | | Change-Id: I9ff77b2a245e41257521d1bac7474864c90dedaf Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* Update Digia headers to QtCompany headersAlex Blasche2015-03-031-22/+14
| | | | | | Change-Id: I07b67d4bd879994a480a70f4776d68256f51d736 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Add discovering for BLE devices on WindowsDenis Shienkov2014-12-041-30/+185
| | | | | | | | | | | 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-109/+100
| | | | | | | | | | | | | | | | | | | 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>
* Moved Q_DECLARE_METATYPE outside of Qt namespaceDavid Weisgerber2014-09-011-1/+9
| | | | | | | Added test if bluetooth device present in start sequence of device discovery Change-Id: I87db065a38bc5cb8e8acb603d48e5856d3bc7080 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Implement the QBluetoothDeviceDiscoveryAgent class on WindowsDenis Shienkov2014-09-011-11/+172
| | | | | Change-Id: I74eaf9acedbcd5b601ff3a6feef21869dbbf9bd9 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Add a stub modules to compile on WindowsDenis Shienkov2014-07-161-0/+82
It is the first commit which prepares possibility of build for Windows; still there is no Windows-specific implementation of bluetooth classes. Tested build with Qt5 (MinGW). Change-Id: I70d8c5cff4ac4e8b9192ab8556d81aad8432394a Reviewed-by: Alex Blasche <alexander.blasche@digia.com>