summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-10-16 13:19:51 +0200
committerAlex Blasche <alexander.blasche@digia.com>2014-10-17 16:15:21 +0200
commitc3e68510068d3ce3ce4cc65e0352e346b3722bd2 (patch)
treef01454a6813233db27dda2a80f570a6acb1f9a81 /tests
parent27250b126ad12c9f356c748588f0a1b75f060dfb (diff)
Add QLeController ctor that takes QBluetoothDeviceInfo
This ctor is required for OSX as the remote device address cannot be retrieved. On other platforms this ctor is syntactic sugar to be able to directly feed the device search results into the controller. Change-Id: I4839a48861ebc625740e37aee5a779deeb32f96d Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp b/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp
index ff958cc6..6678daab 100644
--- a/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp
+++ b/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp
@@ -62,7 +62,7 @@ private slots:
void tst_assignCompare();
private:
- QSet<QString> remoteLeDevices;
+ QList<QBluetoothDeviceInfo> remoteLeDeviceInfos;
QLowEnergyController *globalControl;
QLowEnergyService *globalService;
};
@@ -114,9 +114,9 @@ void tst_QLowEnergyDescriptor::initTestCase()
// find first service with descriptor
QLowEnergyController *controller = 0;
- foreach (const QString &remoteDevice, remoteLeDevices.toList()) {
- controller = new QLowEnergyController(QBluetoothAddress(remoteDevice), this);
- qDebug() << "Connecting to" << remoteDevice;
+ foreach (const QBluetoothDeviceInfo& remoteDeviceInfo, remoteLeDeviceInfos) {
+ controller = new QLowEnergyController(remoteDeviceInfo, this);
+ qDebug() << "Connecting to" << remoteDeviceInfo.address();
controller->connectToDevice();
QTRY_IMPL(controller->state() != QLowEnergyController::ConnectingState,
20000);
@@ -151,7 +151,7 @@ void tst_QLowEnergyDescriptor::initTestCase()
if (!ch.descriptors().isEmpty()) {
globalService = leService;
globalControl = controller;
- qWarning() << "Found service with descriptor" << remoteDevice
+ qWarning() << "Found service with descriptor" << remoteDeviceInfo.address()
<< globalService->serviceName() << globalService->serviceUuid();
break;
}
@@ -184,7 +184,7 @@ void tst_QLowEnergyDescriptor::cleanupTestCase()
void tst_QLowEnergyDescriptor::deviceDiscovered(const QBluetoothDeviceInfo &info)
{
if (info.coreConfigurations() & QBluetoothDeviceInfo::LowEnergyCoreConfiguration)
- remoteLeDevices.insert(info.address().toString());
+ remoteLeDeviceInfos.append(info);
}
void tst_QLowEnergyDescriptor::tst_constructionDefault()