summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2015-09-28 21:15:28 +0300
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-10-13 13:09:38 +0000
commit797624ac0c5f0a7ee3dd0a938454d55cb8786373 (patch)
treecb834888381805b491d373d63ef4a5c5e0b4a284 /src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
parent3e7d0c6b62d2fd6acd2c8a64b8e007729843e088 (diff)
Windows: Simplify code related to enumerating of a local radios
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>
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
index 05f7091d..937bc2a4 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
@@ -36,6 +36,7 @@
#include "qbluetoothdevicediscoveryagent_p.h"
#include "qbluetoothaddress.h"
#include "qbluetoothuuid.h"
+#include "qbluetoothlocaldevice_p.h"
QT_BEGIN_NAMESPACE
@@ -171,20 +172,9 @@ void QBluetoothDeviceDiscoveryAgentPrivate::initialize(
bool QBluetoothDeviceDiscoveryAgentPrivate::isClassicAdapterValid(
const QBluetoothAddress &deviceAdapter)
{
- const WinClassicBluetooth::LocalRadiosDiscoveryResult result =
- WinClassicBluetooth::enumerateLocalRadios();
-
- if (!isDiscoveredSuccessfully(result.error)) {
- qCWarning(QT_BT_WINDOWS) << "Occurred error during search of classic local radios";
- return false;
- } else if (result.radios.isEmpty()) {
- qCWarning(QT_BT_WINDOWS) << "No any classic local radio found";
- return false;
- }
-
- foreach (const BLUETOOTH_RADIO_INFO &radio, result.radios) {
+ foreach (const QBluetoothHostInfo &adapterInfo, QBluetoothLocalDevicePrivate::localAdapters()) {
if (deviceAdapter == QBluetoothAddress()
- || deviceAdapter == QBluetoothAddress(radio.address.ullLong)) {
+ || deviceAdapter == adapterInfo.address()) {
return true;
}
}