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 --- src/bluetooth/qlowenergycontroller.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/bluetooth/qlowenergycontroller.cpp') diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp index 2b28a873..89e65ce7 100644 --- a/src/bluetooth/qlowenergycontroller.cpp +++ b/src/bluetooth/qlowenergycontroller.cpp @@ -634,6 +634,23 @@ QBluetoothAddress QLowEnergyController::remoteAddress() const return d_ptr->remoteDevice; } +/*! + Returns the unique identifier of the remote Bluetooth Low Energy device. + + On macOS/iOS/tvOS CoreBluetooth does not expose/accept hardware addresses for + LE devices; instead developers are supposed to use unique 128-bit UUIDs, generated + by CoreBluetooth. These UUIDS will stay constant for the same central <-> peripheral + pair and we use them when connecting to a remote device. For a controller in the + \l CentralRole, this value will always be the one passed in when the controller + object was created. For a controller in the \l PeripheralRole, this value is invalid. + + \since 5.8 + */ +QBluetoothUuid QLowEnergyController::remoteDeviceUuid() const +{ + return QBluetoothUuid(); +} + /*! Returns the name of the remote Bluetooth Low Energy device, if the controller is in the \l CentralRole. Otherwise the result is unspecified. -- cgit v1.2.3