diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-12-05 14:40:58 +0100 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-12-05 15:47:47 +0100 |
commit | 1a7e79849ec0575d09231cfac3e7ea453f2fe932 (patch) | |
tree | 372841d6d2b0eec7e649fc200c13bffa0f3e6f47 /src | |
parent | 9856b182bb43ff36266e63027f18f67a0ce244ea (diff) |
QLowEnergyController - localAddress (OS X)
On OS X QLowEnergyController can return the valid local address,
even if it was constructed without this parameter.
Change-Id: I40252a9f1f64506ae23d6dfe1e61fc786e895860
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/qlowenergycontroller_osx.mm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bluetooth/qlowenergycontroller_osx.mm b/src/bluetooth/qlowenergycontroller_osx.mm index cde11f67..2983705e 100644 --- a/src/bluetooth/qlowenergycontroller_osx.mm +++ b/src/bluetooth/qlowenergycontroller_osx.mm @@ -141,7 +141,6 @@ QLowEnergyControllerPrivateOSX::QLowEnergyControllerPrivateOSX(QLowEnergyControl "QBluetoothLowEnergyControllerPrivateOSX(), " "failed to initialize central manager"; } - } QLowEnergyControllerPrivateOSX::QLowEnergyControllerPrivateOSX(QLowEnergyController *q, @@ -723,7 +722,10 @@ QLowEnergyController::QLowEnergyController(const QBluetoothAddress &remoteAddres : QObject(parent), d_ptr(new QLowEnergyControllerPrivateOSX(this)) { - Q_UNUSED(remoteAddress) + OSX_D_PTR; + + osx_d_ptr->remoteAddress = remoteAddress; + osx_d_ptr->localAddress = QBluetoothLocalDevice().address(); qCWarning(QT_BT_OSX) << "QLowEnergyController::QLowEnergyController(), " "construction with remote address is not supported!"; @@ -734,6 +736,9 @@ QLowEnergyController::QLowEnergyController(const QBluetoothDeviceInfo &remoteDev : QObject(parent), d_ptr(new QLowEnergyControllerPrivateOSX(this, remoteDevice)) { + OSX_D_PTR; + + osx_d_ptr->localAddress = QBluetoothLocalDevice().address(); // That's the only "real" ctor - with Core Bluetooth we need a _valid_ deviceUuid // from 'remoteDevice'. } |