diff options
author | Liang Qi <liang.qi@qt.io> | 2018-01-20 22:38:09 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-20 22:38:52 +0100 |
commit | 1653ae6e8782fb96999a53736a773e9a31d86b8a (patch) | |
tree | 33e114d791c9b9db48ceb79ffeb6c1ac7bab3493 /src | |
parent | 4462750a68cb93b5d363b6efdbe1d6a6f0e5811f (diff) | |
parent | b274a83bf4f44d0e2642a8e3bd6bada4ccdbf83c (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
.qmake.conf
Change-Id: I6e93fc7435a49b601a5c10519ed86d2a15125074
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/bluetooth.pro | 2 | ||||
-rw-r--r-- | src/bluetooth/osx/osxbt.pri | 2 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothlocaldevice.cpp | 3 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothserver.cpp | 3 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent.cpp | 3 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothserviceinfo.cpp | 2 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothsocket.cpp | 3 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycontroller_bluez.cpp | 14 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycontroller_winrt.cpp | 23 | ||||
-rw-r--r-- | src/imports/bluetooth/plugin.cpp | 6 | ||||
-rw-r--r-- | src/imports/bluetooth/plugins.qmltypes | 8 | ||||
-rw-r--r-- | src/imports/nfc/plugin.cpp | 5 | ||||
-rw-r--r-- | src/imports/nfc/plugins.qmltypes | 7 |
13 files changed, 56 insertions, 25 deletions
diff --git a/src/bluetooth/bluetooth.pro b/src/bluetooth/bluetooth.pro index f675b0d9..ee548208 100644 --- a/src/bluetooth/bluetooth.pro +++ b/src/bluetooth/bluetooth.pro @@ -247,7 +247,7 @@ qtConfig(bluez) { PRIVATE_HEADERS += qlowenergycontroller_p.h } -winrt-*-msvc2015 { +winrt { MODULE_WINRT_CAPABILITIES_DEVICE += \ bluetooth.genericAttributeProfile \ bluetooth.rfcomm diff --git a/src/bluetooth/osx/osxbt.pri b/src/bluetooth/osx/osxbt.pri index 13187e4f..0f293107 100644 --- a/src/bluetooth/osx/osxbt.pri +++ b/src/bluetooth/osx/osxbt.pri @@ -1,6 +1,6 @@ SOURCES += osx/uistrings.cpp osx/osxbtnotifier.cpp PRIVATE_HEADERS += osx/uistrings_p.h -//QMAKE_CXXFLAGS_WARN_ON += -Wno-nullability-completeness +#QMAKE_CXXFLAGS_WARN_ON += -Wno-nullability-completeness CONFIG(osx) { PRIVATE_HEADERS += osx/osxbtutility_p.h \ diff --git a/src/bluetooth/qbluetoothlocaldevice.cpp b/src/bluetooth/qbluetoothlocaldevice.cpp index e2378460..40d86ae3 100644 --- a/src/bluetooth/qbluetoothlocaldevice.cpp +++ b/src/bluetooth/qbluetoothlocaldevice.cpp @@ -55,6 +55,9 @@ QT_BEGIN_NAMESPACE QBluetoothLocalDevice provides functions for getting and setting the state of local Bluetooth devices. + + On iOS, this class cannot be used because the platform does not expose + any data or API which may provide information on the local Bluetooth device. */ /*! diff --git a/src/bluetooth/qbluetoothserver.cpp b/src/bluetooth/qbluetoothserver.cpp index 99d3b53a..90c3ff19 100644 --- a/src/bluetooth/qbluetoothserver.cpp +++ b/src/bluetooth/qbluetoothserver.cpp @@ -66,6 +66,9 @@ QT_BEGIN_NAMESPACE If the \l QBluetoothServiceInfo::Protocol is not supported by a platform, \l listen() will return \c false. Android and WinRT only support RFCOMM for example. + On iOS, this class cannot be used because the platform does not expose + an API which may permit access to QBluetoothServer related features. + \sa QBluetoothServiceInfo, QBluetoothSocket */ diff --git a/src/bluetooth/qbluetoothservicediscoveryagent.cpp b/src/bluetooth/qbluetoothservicediscoveryagent.cpp index d6163f0e..05d62ab1 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent.cpp +++ b/src/bluetooth/qbluetoothservicediscoveryagent.cpp @@ -85,6 +85,9 @@ QT_BEGIN_NAMESPACE Energy services, it is likely to not advertise them via SDP. The \l QLowEnergyController class should be utilized to perform the service discovery on Low Energy devices. + On iOS, this class cannot be used because the platform does not expose + an API which may permit access to QBluetoothServiceDiscoveryAgent related features. + \sa QBluetoothDeviceDiscoveryAgent, QLowEnergyController */ diff --git a/src/bluetooth/qbluetoothserviceinfo.cpp b/src/bluetooth/qbluetoothserviceinfo.cpp index 385e9463..d706e4a7 100644 --- a/src/bluetooth/qbluetoothserviceinfo.cpp +++ b/src/bluetooth/qbluetoothserviceinfo.cpp @@ -105,6 +105,8 @@ QT_BEGIN_NAMESPACE service info object share the same data as they do not detach upon changing them. This ensures that two copies can (de)register the same Bluetooth service. + On iOS, this class cannot be used because the platform does not expose + an API which may permit access to QBluetoothServiceInfo related features. */ /*! diff --git a/src/bluetooth/qbluetoothsocket.cpp b/src/bluetooth/qbluetoothsocket.cpp index 6c14cffc..18567f34 100644 --- a/src/bluetooth/qbluetoothsocket.cpp +++ b/src/bluetooth/qbluetoothsocket.cpp @@ -81,6 +81,9 @@ Q_DECLARE_LOGGING_CATEGORY(QT_BT) \note QBluetoothSocket does not support synchronous read and write operations. Functions such as \l waitForReadyRead() and \l waitForBytesWritten() are not implemented. I/O operations should be performed using \l readyRead(), \l read() and \l write(). + + On iOS, this class cannot be used because the platform does not expose + an API which may permit access to QBluetoothSocket related features. */ /*! diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp index 72f4c678..c4ff0e7f 100644 --- a/src/bluetooth/qlowenergycontroller_bluez.cpp +++ b/src/bluetooth/qlowenergycontroller_bluez.cpp @@ -343,8 +343,8 @@ void QLowEnergyControllerPrivateBluez::handleGattRequestTimeout() } if (!openRequests.isEmpty() && requestPending) { - requestPending = false; // reset pending flag const Request currentRequest = openRequests.dequeue(); + requestPending = false; // reset pending flag qCWarning(QT_BT_BLUEZ).nospace() << "****** Request type 0x" << hex << currentRequest.command << " to server/peripheral timed out"; @@ -369,7 +369,6 @@ void QLowEnergyControllerPrivateBluez::handleGattRequestTimeout() case ATT_OP_EXCHANGE_MTU_REQUEST: // MTU change request // never received reply to MTU request // it is safe to skip and go to next request - sendNextPendingRequest(); break; case ATT_OP_READ_BY_GROUP_REQUEST: // primary or secondary service discovery case ATT_OP_READ_BY_TYPE_REQUEST: // characteristic or included service discovery @@ -403,8 +402,13 @@ void QLowEnergyControllerPrivateBluez::handleGattRequestTimeout() break; default: // not a command used by central role implementation - return; + qCWarning(QT_BT_BLUEZ) << "Missing response for ATT peripheral command: " + << hex << command; + break; } + + // spin openRequest queue further + sendNextPendingRequest(); } } @@ -1241,9 +1245,9 @@ void QLowEnergyControllerPrivateBluez::processReply( } else if (!isServiceDiscoveryRun) { // not encryption problem -> abort readCharacteristic()/readDescriptor() run if (!descriptorHandle) - emit service->error(QLowEnergyService::CharacteristicReadError); + service->setError(QLowEnergyService::CharacteristicReadError); else - emit service->error(QLowEnergyService::DescriptorReadError); + service->setError(QLowEnergyService::DescriptorReadError); } } else { if (!descriptorHandle) diff --git a/src/bluetooth/qlowenergycontroller_winrt.cpp b/src/bluetooth/qlowenergycontroller_winrt.cpp index 99a5af6d..628f1195 100644 --- a/src/bluetooth/qlowenergycontroller_winrt.cpp +++ b/src/bluetooth/qlowenergycontroller_winrt.cpp @@ -404,7 +404,17 @@ void QLowEnergyControllerPrivateWinRT::connectToDevice() Q_ASSERT_SUCCEEDED(hr); ComPtr<IGattReadResult> result; hr = QWinRTFunctions::await(op, result.GetAddressOf()); - Q_ASSERT_SUCCEEDED(hr); + if (hr == E_INVALIDARG) { + // E_INVALIDARG happens when user tries to connect to a device that was paired + // before but is not available. + qCDebug(QT_BT_WINRT) << "Could not obtain characteristic read result that triggers" + "device connection. Is the device reachable?"; + setError(QLowEnergyController::ConnectionError); + setState(QLowEnergyController::UnconnectedState); + return; + } else { + Q_ASSERT_SUCCEEDED(hr); + } ComPtr<ABI::Windows::Storage::Streams::IBuffer> buffer; hr = result->get_Value(&buffer); Q_ASSERT_SUCCEEDED(hr); @@ -497,7 +507,9 @@ void QLowEnergyControllerPrivateWinRT::obtainIncludedServices(QSharedPointer<QLo Q_ASSERT_SUCCEEDED(hr); ComPtr<IVectorView<GattDeviceService *>> includedServices; hr = service2->GetAllIncludedServices(&includedServices); - Q_ASSERT_SUCCEEDED(hr); + // Some devices return ERROR_ACCESS_DISABLED_BY_POLICY + if (FAILED(hr)) + return; uint count; hr = includedServices->get_Size(&count); @@ -596,7 +608,12 @@ void QLowEnergyControllerPrivateWinRT::discoverServiceDetails(const QBluetoothUu Q_ASSERT_SUCCEEDED(hr); ComPtr<IVectorView<GattDeviceService *>> deviceServices; hr = deviceService2->GetAllIncludedServices(&deviceServices); - Q_ASSERT_SUCCEEDED(hr); + if (FAILED(hr)) { // ERROR_ACCESS_DISABLED_BY_POLICY + qCDebug(QT_BT_WINRT) << "Could not obtain included services list for" << service; + pointer->setError(QLowEnergyService::UnknownError); + pointer->setState(QLowEnergyService::InvalidService); + return; + } uint serviceCount; hr = deviceServices->get_Size(&serviceCount); Q_ASSERT_SUCCEEDED(hr); diff --git a/src/imports/bluetooth/plugin.cpp b/src/imports/bluetooth/plugin.cpp index 2a152e32..07654ca9 100644 --- a/src/imports/bluetooth/plugin.cpp +++ b/src/imports/bluetooth/plugin.cpp @@ -81,10 +81,8 @@ public: qmlRegisterType<QDeclarativeBluetoothService >(uri, major, minor, "BluetoothService"); qmlRegisterType<QDeclarativeBluetoothSocket >(uri, major, minor, "BluetoothSocket"); - // Register the 5.9 types - // introduces 5.9 version, other existing 5.2 exports become automatically available under 5.2-5.8 - minor = 9; - qmlRegisterType<QDeclarativeBluetoothDiscoveryModel >(uri, major, minor, "BluetoothDiscoveryModel"); + // Register the latest Qt version as QML type version + qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR); } }; diff --git a/src/imports/bluetooth/plugins.qmltypes b/src/imports/bluetooth/plugins.qmltypes index e23f8740..a00b0324 100644 --- a/src/imports/bluetooth/plugins.qmltypes +++ b/src/imports/bluetooth/plugins.qmltypes @@ -4,7 +4,7 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtBluetooth 5.9' +// 'qmlplugindump -nonrelocatable QtBluetooth 5.10' Module { dependencies: ["QtQuick 2.8"] @@ -13,10 +13,9 @@ Module { prototype: "QAbstractListModel" exports: [ "QtBluetooth/BluetoothDiscoveryModel 5.0", - "QtBluetooth/BluetoothDiscoveryModel 5.2", - "QtBluetooth/BluetoothDiscoveryModel 5.9" + "QtBluetooth/BluetoothDiscoveryModel 5.2" ] - exportMetaObjectRevisions: [0, 0, 0] + exportMetaObjectRevisions: [0, 0] Enum { name: "DiscoveryMode" values: { @@ -93,6 +92,7 @@ Module { values: { "NoError": -2, "UnknownSocketError": -1, + "RemoteHostClosedError": 1, "HostNotFoundError": 2, "ServiceNotFoundError": 9, "NetworkError": 7, diff --git a/src/imports/nfc/plugin.cpp b/src/imports/nfc/plugin.cpp index 53febda2..749e03d7 100644 --- a/src/imports/nfc/plugin.cpp +++ b/src/imports/nfc/plugin.cpp @@ -98,10 +98,9 @@ public: minor = 5; qmlRegisterType<QDeclarativeNearField, 1>(uri, major, minor, "NearField"); - // Register the 5.6 - 5.9 types - minor = 9; - qmlRegisterType<QDeclarativeNearField, 1>(uri, major, minor, "NearField"); + // Register the latest Qt version as QML type version + qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR); } }; diff --git a/src/imports/nfc/plugins.qmltypes b/src/imports/nfc/plugins.qmltypes index 45cf53b8..e6e98c24 100644 --- a/src/imports/nfc/plugins.qmltypes +++ b/src/imports/nfc/plugins.qmltypes @@ -4,7 +4,7 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtNfc 5.9' +// 'qmlplugindump -nonrelocatable QtNfc 5.10' Module { dependencies: ["QtQuick 2.8"] @@ -57,10 +57,9 @@ Module { "QtNfc/NearField 5.0", "QtNfc/NearField 5.2", "QtNfc/NearField 5.4", - "QtNfc/NearField 5.5", - "QtNfc/NearField 5.9" + "QtNfc/NearField 5.5" ] - exportMetaObjectRevisions: [0, 0, 0, 1, 1] + exportMetaObjectRevisions: [0, 0, 0, 1] Property { name: "messageRecords"; type: "QQmlNdefRecord"; isList: true; isReadonly: true } Property { name: "filter"; type: "QDeclarativeNdefFilter"; isList: true; isReadonly: true } Property { name: "orderMatch"; type: "bool" } |