summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergycontroller.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2019-01-21 15:08:57 +0100
committerAlex Blasche <alexander.blasche@qt.io>2019-02-11 07:19:22 +0000
commit8af2bea29a4aec10d68f022520d4abca7320ebb1 (patch)
treea88a7993959b3d44c7a253f3165875451d4ca152 /src/bluetooth/qlowenergycontroller.cpp
parentcd2f90d9157199ebadcf182a471f264a619fd521 (diff)
Add QLowEnergyController::createCentral() with localDevice overload
The QLowEnergyController ctor with localDevice overload was obsoleted but the new API did not provide an equivalent createCentral() overload. This patch fixes the problem. Fixes: QTBUG-63019 Change-Id: I4c5a249bbf20c78da5507fecc874daa67e3dce46 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/bluetooth/qlowenergycontroller.cpp')
-rw-r--r--src/bluetooth/qlowenergycontroller.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp
index 8fc044fb..d8aa00d7 100644
--- a/src/bluetooth/qlowenergycontroller.cpp
+++ b/src/bluetooth/qlowenergycontroller.cpp
@@ -432,6 +432,29 @@ QLowEnergyController *QLowEnergyController::createCentral(const QBluetoothDevice
return new QLowEnergyController(remoteDevice, parent);
}
+/*!
+ Returns a new instance of this class with \a parent.
+
+ The \a remoteDevice must contain the address of the remote Bluetooth Low
+ Energy device to which this object should attempt to connect later on.
+
+ The connection is established via \a localDevice. If \a localDevice is invalid,
+ the local default device is automatically selected. If \a localDevice specifies
+ a local device that is not a local Bluetooth adapter, \l error() is set to
+ \l InvalidBluetoothAdapterError once \l connectToDevice() is called.
+
+ Note that specifying the local device to be used for the connection is only
+ possible when using BlueZ. All other platforms do not support this feature.
+
+ \since 5.13
+ */
+QLowEnergyController *QLowEnergyController::createCentral(const QBluetoothAddress &remoteDevice,
+ const QBluetoothAddress &localDevice,
+ QObject *parent)
+{
+ return new QLowEnergyController(remoteDevice, localDevice, parent);
+}
+
/*!
Returns a new object of this class that is in the \l PeripheralRole and has the