diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2017-05-19 16:44:06 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2017-06-16 07:52:29 +0000 |
commit | cba4c454543ab83797b44946b132323687a198dc (patch) | |
tree | 8cb2ab0bfe0aa52702eb7516e70cc65e94ad1dab /src/bluetooth/qlowenergycontroller.cpp | |
parent | 1d1b133fa86c0874e8fe3bc9320dd2c3b02de9c3 (diff) |
Obtain random bt address flag via Bluetooth Mgmt API
DBus does not expose this information. The Bluetooth Management API
advertises the information but requires CAP_NET_ADMIN. The Management
class monitors DEVICE FOUND events and records the random bit flag
of each new device. QBluetoothDeviceDiscoveryAgent can subsequently
add this information to the internal data set.
Ultimately this makes QLowEnergyController::setRemoteAddressType
obsolete. This function was only ever required on Linux.
Task-number: QTBUG-46776
Change-Id: If10df86d332dfc7cc98b7c783eb28487c3fa9045
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/bluetooth/qlowenergycontroller.cpp')
-rw-r--r-- | src/bluetooth/qlowenergycontroller.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp index a3aad282..2337268d 100644 --- a/src/bluetooth/qlowenergycontroller.cpp +++ b/src/bluetooth/qlowenergycontroller.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtBluetooth module of the Qt Toolkit. @@ -691,6 +691,19 @@ QLowEnergyController::RemoteAddressType QLowEnergyController::remoteAddressType( /*! Sets the remote address \a type. The type is required to connect to the remote Bluetooth Low Energy device. + + This attribute is only required to be set on Linux/BlueZ systems with older + Linux kernels (v3.3 or lower), or if CAP_NET_ADMIN is not set for the executable. + The default value of the attribute is \l RandomAddress. + + \note All other platforms handle this flag transparently and therefore applications + can ignore it entirely. On Linux, the address type flag is not directly exposed + by BlueZ although some use cases do require this information. The only way to detect + the flag is via the Linux kernel's Bluetooth Management API (kernel + version 3.4+ required). This API requires CAP_NET_ADMIN capabilities though. If the + local QtBluetooth process has this capability set QtBluetooth will use the API. This + assumes that \l QBluetoothDeviceDiscoveryAgent was used prior to calling + \l QLowEnergyController::connectToDevice(). */ void QLowEnergyController::setRemoteAddressType( QLowEnergyController::RemoteAddressType type) |