From 73e02ede397a03108b8cc0d9a7775448145a0682 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 17 Nov 2016 10:17:55 +0100 Subject: LE controller - add a getter for a remote device UUID A device UUID is valid/works on iOS/macOS only: platforms where CoreBluetooth hides addresses and generates 128-bit uuids instead. We connect to a LE device using such a UUID. This patch adds a getter to access a UUID of a remote device our controller works with (similar to 'remoteAddress' method on other platforms). Task-number: QTBUG-52690 Change-Id: I000e17bbea90c508922ac47ce5291e28d938de7c Reviewed-by: Alex Blasche --- tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp index 4acfe4d1..6475b8c4 100644 --- a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp +++ b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp @@ -142,7 +142,7 @@ void tst_QLowEnergyController::initTestCase() QVERIFY(finishedSpy.isEmpty()); bool deviceFound = false; - devAgent->start(); + devAgent->start(QBluetoothDeviceDiscoveryAgent::LowEnergyMethod); QTRY_VERIFY_WITH_TIMEOUT(finishedSpy.count() > 0, 30000); foreach (const QBluetoothDeviceInfo &info, devAgent->discoveredDevices()) { #ifndef Q_OS_MAC @@ -252,6 +252,7 @@ void tst_QLowEnergyController::tst_connect() QSKIP("No local Bluetooth or remote BTLE device found. Skipping test."); QLowEnergyController control(remoteDeviceInfo); + QCOMPARE(remoteDeviceInfo.deviceUuid(), control.remoteDeviceUuid()); QCOMPARE(control.role(), QLowEnergyController::CentralRole); QSignalSpy connectedSpy(&control, SIGNAL(connected())); QSignalSpy disconnectedSpy(&control, SIGNAL(disconnected())); -- cgit v1.2.3