summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2019-07-03 20:42:20 +0300
committerKonstantin Ritt <ritt.ks@gmail.com>2019-07-05 14:48:50 +0300
commita39f1357cc79cab9a0d7ea28986486b47b203422 (patch)
tree2717667191679a8ec6d40fb7a4717f52f4178518
parentb582af63040620bf5b67ebfb2c89d17297a283e3 (diff)
QLowEnergyController: Introduce AuthorizationError
intended to distinguish an arbitrary disconnection from disconnection due to insufficient authorization/encryption Change-Id: Ifcf73d0444fe6fd3a8d5d90155f3db572d6e23d1 Reviewed-by: Evgeniy Gagarin <eeiaao@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/bluetooth/qlowenergycontroller.cpp3
-rw-r--r--src/bluetooth/qlowenergycontroller.h3
-rw-r--r--src/bluetooth/qlowenergycontrollerbase.cpp3
3 files changed, 8 insertions, 1 deletions
diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp
index 3cf0d920..d6af6999 100644
--- a/src/bluetooth/qlowenergycontroller.cpp
+++ b/src/bluetooth/qlowenergycontroller.cpp
@@ -159,6 +159,9 @@ Q_DECLARE_LOGGING_CATEGORY(QT_BT_WINRT)
This value was introduced by Qt 5.7.
\value RemoteHostClosedError The remote device closed the connection.
This value was introduced by Qt 5.10.
+ \value AuthorizationError The local Bluetooth device closed the connection due to
+ insufficient authorization.
+ This value was introduced by Qt 5.14.
*/
/*!
diff --git a/src/bluetooth/qlowenergycontroller.h b/src/bluetooth/qlowenergycontroller.h
index 5498d4a5..37e7b82d 100644
--- a/src/bluetooth/qlowenergycontroller.h
+++ b/src/bluetooth/qlowenergycontroller.h
@@ -66,7 +66,8 @@ public:
InvalidBluetoothAdapterError,
ConnectionError,
AdvertisingError,
- RemoteHostClosedError
+ RemoteHostClosedError,
+ AuthorizationError
};
Q_ENUM(Error)
diff --git a/src/bluetooth/qlowenergycontrollerbase.cpp b/src/bluetooth/qlowenergycontrollerbase.cpp
index de72808e..059bd41b 100644
--- a/src/bluetooth/qlowenergycontrollerbase.cpp
+++ b/src/bluetooth/qlowenergycontrollerbase.cpp
@@ -106,6 +106,9 @@ void QLowEnergyControllerPrivate::setError(
case QLowEnergyController::RemoteHostClosedError:
errorString = QLowEnergyController::tr("Remote device closed the connection");
break;
+ case QLowEnergyController::AuthorizationError:
+ errorString = QLowEnergyController::tr("Failed to authorize on the remote device");
+ break;
case QLowEnergyController::NoError:
return;
default: