From b9e6d2a484aea7ab8a7053adabf94780129e11e2 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Tue, 28 Oct 2014 13:44:45 +0100 Subject: Fix lowenergyscanner ui bugs when QLEController connection errors 1.) The QLEController may error out during connectToDevice() which does not require the eventloop to run. At the same time the services view is not yet loaded. Subsequently the services view never notices the errors and loads as if the controller is still trying to connect. 2.) The services view can only be left when a disconnect() signal is received. During a connection error the disconnect never happens because the connect never happened. Artificially introduce a disconnect() when the controller is not connected but disconnect was called by the UI. This part should be cleaned up to properly allow tracking of the controller's state in the future. Change-Id: I2cbd90d55b5e70fb275a8f4563d9436419874e6d Reviewed-by: Timur Pocheptsov Reviewed-by: Alex Blasche --- examples/bluetooth/lowenergyscanner/device.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'examples/bluetooth/lowenergyscanner/device.h') diff --git a/examples/bluetooth/lowenergyscanner/device.h b/examples/bluetooth/lowenergyscanner/device.h index 09b32599..049d1c61 100644 --- a/examples/bluetooth/lowenergyscanner/device.h +++ b/examples/bluetooth/lowenergyscanner/device.h @@ -66,6 +66,7 @@ class Device: public QObject Q_PROPERTY(QString update READ getUpdate NOTIFY updateChanged) Q_PROPERTY(bool useRandomAddress READ isRandomAddress WRITE setRandomAddress NOTIFY randomAddressChanged) Q_PROPERTY(bool state READ state NOTIFY stateChanged) + Q_PROPERTY(bool controllerError READ hasControllerError) public: Device(); ~Device(); @@ -74,6 +75,7 @@ public: QVariant getCharacteristics(); QString getUpdate(); bool state(); + bool hasControllerError() const; bool isRandomAddress() const; void setRandomAddress(bool newValue); -- cgit v1.2.3