diff options
author | Liang Qi <liang.qi@qt.io> | 2019-10-14 14:15:54 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-10-14 14:15:54 +0200 |
commit | c273b642ff142e4d567a62c558e9564d6d8defa4 (patch) | |
tree | cdfeeb4a03ab78161eb6fcf35806312897de88ee | |
parent | db56df7fb05b465bf0e77dd086fc2a7b054ab1d9 (diff) | |
parent | 245f19122c2a6a112a35ee65556bcf00b6545d87 (diff) | |
download | qtconnectivity-c273b642ff142e4d567a62c558e9564d6d8defa4.tar.gz |
Merge remote-tracking branch 'origin/5.13' into 5.14v5.14.0-beta2
Conflicts:
src/bluetooth/doc/src/bluetooth-index.qdoc
Change-Id: If353b4ac63c72d6f94415e1349a206ade4ceb52e
3 files changed, 25 insertions, 11 deletions
diff --git a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java index c6ffbbf4..8a69b4c7 100644 --- a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java +++ b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java @@ -431,8 +431,15 @@ public class QtBluetoothLE { descriptor.getUuid().toString(), descriptor.getValue()); } else { if (isServiceDiscoveryRun) { - //ignore - Log.w(TAG, "onDescriptorcRead during discovery error: " + status); + // Cannot read but still advertise the fact that we found a descriptor + // The value will be empty. + Log.w(TAG, "onDescriptorRead during discovery error: " + status); + Log.d(TAG, "Non-readable descriptor " + descriptor.getUuid() + + " for characteristic " + descriptor.getCharacteristic().getUuid() + + " for service " + descriptor.getCharacteristic().getService().getUuid()); + leDescriptorRead(qtObject, descriptor.getCharacteristic().getService().getUuid().toString(), + descriptor.getCharacteristic().getUuid().toString(), foundHandle + 1, + descriptor.getUuid().toString(), descriptor.getValue()); } else { // This must be in sync with QLowEnergyService::DescriptorReadError final int descriptorReadError = 6; diff --git a/src/bluetooth/doc/src/bluetooth-index.qdoc b/src/bluetooth/doc/src/bluetooth-index.qdoc index 7b54df85..0f5b96d6 100644 --- a/src/bluetooth/doc/src/bluetooth-index.qdoc +++ b/src/bluetooth/doc/src/bluetooth-index.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -42,7 +42,7 @@ Currently, the API is supported on the following platforms: \li \l {Qt for iOS}{iOS} \li \l {Qt for Linux/X11}{Linux (BlueZ 4.x/5.x)} \li \l \macos - \li \l {Qt for WinRT}{WinRT} + \li \l {Qt for UWP}{UWP (Universal Windows Platform)} \li \l {Qt for Windows}{Win32} \row \li Classic Bluetooth @@ -80,8 +80,8 @@ Currently, the API is supported on the following platforms: Qt 5.14 adds a native Win32 port supporting Classic Bluetooth on Windows 7 or newer, and Bluetooth LE on Windows 8 or newer. It must be enabled at build time by configuration -option -native-win32-bluetooth. The WinRT backend is used by default if this option is not -set and the Win32 target platform supports the required WinRT APIs (minimal requirement is +option -native-win32-bluetooth. The UWP backend is used by default if this option is not +set and the Win32 target platform supports the required UWP APIs (minimal requirement is Windows 10 version 1507, with slightly improved service discovery since Windows 10 version 1607). @@ -168,7 +168,8 @@ The \l QtBluetooth module exports the following \li Enables logging of the QtBluetooth QML implementation \row \li qt.bluetooth.winrt - \li Enables logging of the \l {Qt for WinRT} {WinRT} implementation + \li Enables logging of the \l {Qt for UWP}{UWP (Universal Windows Platform)} + implementation \row \li qt.bluetooth.windows \li Enables logging of the \l {Qt for Windows} {Win32} implementation diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp index 5376ad2f..2562395a 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp @@ -441,8 +441,11 @@ void QWinRTBluetoothDeviceDiscoveryWorker::classicBluetoothInfoFromDeviceIdAsync hr = deviceFromIdOperation->put_Completed(Callback<IAsyncOperationCompletedHandler<BluetoothDevice *>> ([thisPointer](IAsyncOperation<BluetoothDevice *> *op, AsyncStatus status) { - if (status == Completed && thisPointer) - thisPointer->onPairedClassicBluetoothDeviceFoundAsync(op, status); + if (thisPointer) { + if (status == Completed) + thisPointer->onPairedClassicBluetoothDeviceFoundAsync(op, status); + --thisPointer->m_pendingPairedDevices; + } return S_OK; }).Get()); if (FAILED(hr)) { @@ -475,8 +478,11 @@ void QWinRTBluetoothDeviceDiscoveryWorker::leBluetoothInfoFromDeviceIdAsync(HSTR hr = deviceFromIdOperation->put_Completed(Callback<IAsyncOperationCompletedHandler<BluetoothLEDevice *>> ([thisPointer] (IAsyncOperation<BluetoothLEDevice *> *op, AsyncStatus status) { - if (status == Completed && thisPointer) - thisPointer->onPairedBluetoothLEDeviceFoundAsync(op, status); + if (thisPointer) { + if (status == Completed) + thisPointer->onPairedBluetoothLEDeviceFoundAsync(op, status); + --thisPointer->m_pendingPairedDevices; + } return S_OK; }).Get()); if (FAILED(hr)) { |