summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2018-08-31 14:21:30 +0200
committerOliver Wolff <oliver.wolff@qt.io>2018-08-31 12:48:57 +0000
commit771867113c7d531f576768652a40c5cf53d9e57f (patch)
tree56211e7c997b4cb7e31df9ca9e25af8869615d10
parent0c2b6dc44351352e8a88248b98e1d45c0403e01c (diff)
winrt: Do proper error handling if connecting to a LE device fails
Task-number: QTBUG-70162 Change-Id: I4556cbf1965121b042a55e3e36e24383f8fa8dc9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/bluetooth/qlowenergycontroller_winrt.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bluetooth/qlowenergycontroller_winrt.cpp b/src/bluetooth/qlowenergycontroller_winrt.cpp
index 628f1195..a7ad662b 100644
--- a/src/bluetooth/qlowenergycontroller_winrt.cpp
+++ b/src/bluetooth/qlowenergycontroller_winrt.cpp
@@ -413,7 +413,11 @@ void QLowEnergyControllerPrivateWinRT::connectToDevice()
setState(QLowEnergyController::UnconnectedState);
return;
} else {
- Q_ASSERT_SUCCEEDED(hr);
+ qCWarning(QT_BT_WINRT) << "Connecting to device failed: "
+ << qt_error_string(hr);
+ setError(QLowEnergyController::ConnectionError);
+ setState(QLowEnergyController::UnconnectedState);
+ return;
}
ComPtr<ABI::Windows::Storage::Streams::IBuffer> buffer;
hr = result->get_Value(&buffer);