summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bluetooth/qlowenergycontroller_winrt_new.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/bluetooth/qlowenergycontroller_winrt_new.cpp b/src/bluetooth/qlowenergycontroller_winrt_new.cpp
index 95acfbb9..42451e35 100644
--- a/src/bluetooth/qlowenergycontroller_winrt_new.cpp
+++ b/src/bluetooth/qlowenergycontroller_winrt_new.cpp
@@ -200,7 +200,8 @@ public slots:
Q_ASSERT_SUCCEEDED(hr);
hr = descAsyncResult->put_Completed(
Callback<IAsyncOperationCompletedHandler<GattDescriptorsResult*>>(
- [this, characteristic](IAsyncOperation<GattDescriptorsResult*> *, AsyncStatus status) {
+ [this, characteristic](IAsyncOperation<GattDescriptorsResult *> *op,
+ AsyncStatus status) {
if (status != AsyncStatus::Completed) {
qCDebug(QT_BT_WINRT) << "Could not obtain descriptors";
return S_OK;
@@ -237,14 +238,12 @@ public slots:
ComPtr<IVectorView<GattDescriptor *>> descriptors;
- ComPtr<IGattCharacteristic2> characteristic2;
- hr = characteristic.As(&characteristic2);
+ ComPtr<IGattDescriptorsResult> result;
+ hr = op->GetResults(&result);
Q_ASSERT_SUCCEEDED(hr);
-
- hr = characteristic2->GetAllDescriptors(&descriptors);
+ hr = result->get_Descriptors(&descriptors);
Q_ASSERT_SUCCEEDED(hr);
-
uint descriptorCount;
hr = descriptors->get_Size(&descriptorCount);
Q_ASSERT_SUCCEEDED(hr);