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.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp
index c152ded2..2b28a873 100644
--- a/src/bluetooth/qlowenergycontroller.cpp
+++ b/src/bluetooth/qlowenergycontroller.cpp
@@ -198,13 +198,17 @@ Q_DECLARE_LOGGING_CATEGORY(QT_BT)
This signal is emitted when the controller successfully connects to the remote
Low Energy device (if the controller is in the \l CentralRole) or if a remote Low Energy
device connected to the controller (if the controller is in the \l PeripheralRole).
+ On iOS and OS X this signal is not reliable if the controller is in the \l PeripheralRole
+ - the controller only guesses that some central connected to our peripheral as
+ soon as this central tries to write/read a characteristic/descriptor.
*/
/*!
\fn void QLowEnergyController::disconnected()
This signal is emitted when the controller disconnects from the remote
- Low Energy device or vice versa.
+ Low Energy device or vice versa. On iOS and OS X this signal is unreliable
+ if the controller is in the \l PeripheralRole.
*/
/*!
@@ -308,6 +312,9 @@ void QLowEnergyControllerPrivate::setError(
bool QLowEnergyControllerPrivate::isValidLocalAdapter()
{
+#ifdef QT_WINRT_BLUETOOTH
+ return true;
+#endif
if (localAdapter.isNull())
return false;
@@ -687,6 +694,11 @@ void QLowEnergyController::connectToDevice()
{
Q_D(QLowEnergyController);
+ if (role() != CentralRole) {
+ qCWarning(QT_BT) << "Connection can only be established while in central role";
+ return;
+ }
+
if (!d->isValidLocalAdapter()) {
d->setError(QLowEnergyController::InvalidBluetoothAdapterError);
return;