summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergycontroller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/qlowenergycontroller.cpp')
-rw-r--r--src/bluetooth/qlowenergycontroller.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp
index 315d18dd..d0afc5d1 100644
--- a/src/bluetooth/qlowenergycontroller.cpp
+++ b/src/bluetooth/qlowenergycontroller.cpp
@@ -124,6 +124,19 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \enum QLowEnergyController::RemoteAddressType
+
+ Indicates what type of Bluetooth address the remote device uses.
+
+ \value PublicAddress The peripheral uses a public Bluetooth address.
+ \value RandomAddress A random address is a Bluetooth Low Energy security feature.
+ Peripherals using such addresses may frequently change their
+ Bluetooth address. This information is needed when trying to
+ connect to a peripheral.
+ */
+
+
+/*!
\fn void QLowEnergyController::connected()
This signal is emitted when the controller successfully connects to the remote
@@ -360,6 +373,7 @@ QLowEnergyController::QLowEnergyController(
d->q_ptr = this;
d->remoteDevice = remoteDevice;
d->localAdapter = QBluetoothLocalDevice().address();
+ d->addressType = QLowEnergyController::PublicAddress;
}
/*!
@@ -429,6 +443,26 @@ QLowEnergyController::ControllerState QLowEnergyController::state() const
return d_ptr->state;
}
+/*!
+ Returns the type of \l remoteAddress(). By default, this value is initialized
+ to \l PublicAddress.
+
+ \sa setRemoteAddressType
+ */
+QLowEnergyController::RemoteAddressType QLowEnergyController::remoteAddressType() const
+{
+ return d_ptr->addressType;
+}
+
+/*!
+ Sets the remote address \a type. The type is required to connect
+ to the remote Bluetooth Low Energy device.
+ */
+void QLowEnergyController::setRemoteAddressType(
+ QLowEnergyController::RemoteAddressType type)
+{
+ d_ptr->addressType = type;
+}
/*!
Connects to the remote Bluetooth Low Energy device.