From 8a6d9c307851f3492ddc597f5f03e80f236a7857 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 15 Jul 2019 12:57:40 +0200 Subject: Fix compilation with C++20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implicit capture of 'this' in [=] is deprecated in C++20. Fix by using explicit capture. Change-Id: I96132d83d87ae61986ba1b1ea3f9cf8e50059f1f Reviewed-by: Mårten Nordheim --- src/bluetooth/qlowenergycontroller_bluezdbus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/bluetooth/qlowenergycontroller_bluezdbus.cpp b/src/bluetooth/qlowenergycontroller_bluezdbus.cpp index f019d9c2..26ceefb0 100644 --- a/src/bluetooth/qlowenergycontroller_bluezdbus.cpp +++ b/src/bluetooth/qlowenergycontroller_bluezdbus.cpp @@ -336,7 +336,7 @@ void QLowEnergyControllerPrivateBluezDBus::connectToDevice() QDBusPendingReply<> reply = device->Connect(); QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(reply, this); connect(watcher, &QDBusPendingCallWatcher::finished, this, - [=](QDBusPendingCallWatcher* call) { + [this](QDBusPendingCallWatcher* call) { QDBusPendingReply<> reply = *call; if (reply.isError()) { qCDebug(QT_BT_BLUEZ) << "BTLE_DBUS::connect() failed" @@ -358,7 +358,7 @@ void QLowEnergyControllerPrivateBluezDBus::disconnectFromDevice() QDBusPendingReply<> reply = device->Disconnect(); QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(reply, this); connect(watcher, &QDBusPendingCallWatcher::finished, this, - [=](QDBusPendingCallWatcher* call) { + [this](QDBusPendingCallWatcher* call) { QDBusPendingReply<> reply = *call; if (reply.isError()) { qCDebug(QT_BT_BLUEZ) << "BTLE_DBUS::disconnect() failed" -- cgit v1.2.3 From 4ac755bb6e51891881b7477702be8ca917b60c8a Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 16 Jul 2019 13:03:01 +0200 Subject: winrt: Do not try to delete nullptr worker When calling QBluetoothDeviceDiscoveryAgentPrivate::stop the worker pointer is cleared in disconnectAndClearWorker so there is no need to call deleteLater (which will just result in a warning). Change-Id: I2713474833b61a12018ecfa6f9eb11618ed025a7 Task-number: QTBUG-75089 Reviewed-by: Timur Pocheptsov Reviewed-by: Alex Blasche --- src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp index ef2a69b1..b2554558 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp @@ -606,10 +606,8 @@ void QBluetoothDeviceDiscoveryAgentPrivate::stop() disconnectAndClearWorker(); emit q->canceled(); } - if (leScanTimer) { + if (leScanTimer) leScanTimer->stop(); - worker->deleteLater(); - } } void QBluetoothDeviceDiscoveryAgentPrivate::registerDevice(const QBluetoothDeviceInfo &info) -- cgit v1.2.3 From 263fc5186325a7dd59a7533b98b3bf1296ea0d16 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Tue, 16 Jul 2019 11:17:28 +0200 Subject: Do not handle PAIRING_VARIANT_PIN The user has to enter a pin in such cases. Since QBluetoothLocalDevice does not have an API to return a pin it makes no sense for QtBluetooth to handle this type of request. Android will provide its own fall back form. This patch is mostly a revert of f8c0572ddcd. Fixes: QTBUG-76565 Task-number: QTBUG-70295 Change-Id: I61062ac84ce508f3b82c7359a60d5c9c5bba86a4 Reviewed-by: Timur Pocheptsov Reviewed-by: Oliver Wolff --- src/bluetooth/android/localdevicebroadcastreceiver.cpp | 12 +++++++++++- src/bluetooth/qbluetoothlocaldevice_android.cpp | 11 ----------- src/bluetooth/qbluetoothlocaldevice_p.h | 1 - 3 files changed, 11 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/bluetooth/android/localdevicebroadcastreceiver.cpp b/src/bluetooth/android/localdevicebroadcastreceiver.cpp index e3b01987..78aecc12 100644 --- a/src/bluetooth/android/localdevicebroadcastreceiver.cpp +++ b/src/bluetooth/android/localdevicebroadcastreceiver.cpp @@ -189,6 +189,14 @@ void LocalDeviceBroadcastReceiver::onReceive(JNIEnv *env, jobject context, jobje return; case 0: //BluetoothDevice.PAIRING_VARIANT_PIN { + qCDebug(QT_BT_ANDROID) << "Pairing : PAIRING_VARIANT_PIN -> use Android default handling"; + + // The section below is disabled because this Android pairing variant + // requires the user to enter a pin. Since QBluetoothLocalDevice does + // not have a setPin() equivalent which might be used to return the user's value. + // For now we ignore this request. If an app ignores such requests, + // Android shows a "fall-back" pin code entry form. + /* //generate a random key const QString pin = QStringLiteral("%1").arg(QRandomGenerator::global()->bounded(1000000), 6, 10, QLatin1Char('0')); @@ -225,10 +233,12 @@ void LocalDeviceBroadcastReceiver::onReceive(JNIEnv *env, jobject context, jobje } const QBluetoothAddress address(bluetoothDevice.callObjectMethod("getAddress").toString()); - emit pairingDisplayPinCode(address, pin); + emit pairingDisplayPinCode(address, pin);*/ + break; } case 2: //BluetoothDevice.PAIRING_VARIANT_PASSKEY_CONFIRMATION { + qCDebug(QT_BT_ANDROID) << "Pairing : PAIRING_VARIANT_PASSKEY_CONFIRMATION"; keyExtra = valueForStaticField(JavaNames::BluetoothDevice, JavaNames::ExtraPairingKey); key = intentObject.callMethod("getIntExtra", diff --git a/src/bluetooth/qbluetoothlocaldevice_android.cpp b/src/bluetooth/qbluetoothlocaldevice_android.cpp index 40e4c2d4..2995d368 100644 --- a/src/bluetooth/qbluetoothlocaldevice_android.cpp +++ b/src/bluetooth/qbluetoothlocaldevice_android.cpp @@ -69,8 +69,6 @@ QBluetoothLocalDevicePrivate::QBluetoothLocalDevicePrivate( this, &QBluetoothLocalDevicePrivate::processConnectDeviceChanges); connect(receiver, &LocalDeviceBroadcastReceiver::pairingDisplayConfirmation, this, &QBluetoothLocalDevicePrivate::processDisplayConfirmation); - connect(receiver, &LocalDeviceBroadcastReceiver::pairingDisplayPinCode, - this, &QBluetoothLocalDevicePrivate::processDisplayPinCode); } QBluetoothLocalDevicePrivate::~QBluetoothLocalDevicePrivate() @@ -206,15 +204,6 @@ void QBluetoothLocalDevicePrivate::processDisplayConfirmation(const QBluetoothAd return; emit q_ptr->pairingDisplayConfirmation(address, pin); -} - -void QBluetoothLocalDevicePrivate::processDisplayPinCode(const QBluetoothAddress &address, const QString &pin) -{ - // only send pairing notification for pairing requests issued by - // this QBluetoothLocalDevice instance - if (pendingPairing(address) == -1) - return; - emit q_ptr->pairingDisplayPinCode(address, pin); } diff --git a/src/bluetooth/qbluetoothlocaldevice_p.h b/src/bluetooth/qbluetoothlocaldevice_p.h index 98c62151..1f99f27e 100644 --- a/src/bluetooth/qbluetoothlocaldevice_p.h +++ b/src/bluetooth/qbluetoothlocaldevice_p.h @@ -113,7 +113,6 @@ private slots: QBluetoothLocalDevice::Pairing pairing); void processConnectDeviceChanges(const QBluetoothAddress &address, bool isConnectEvent); void processDisplayConfirmation(const QBluetoothAddress &address, const QString &pin); - void processDisplayPinCode(const QBluetoothAddress &address, const QString &pin); private: QBluetoothLocalDevice *q_ptr; -- cgit v1.2.3 From 8110fdd4c6d80d05934768fa808a4cb187212fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Klitzing?= Date: Fri, 19 Jul 2019 11:06:59 +0200 Subject: Core/IO/Bluetooth - fix ambiguous conversions for macOS This is a sibling of QTBUG-76847 on macOS instead of iOS. Change-Id: I3df6e28d65b9835f5f54e92d462d23423c48d835 Reviewed-by: Timur Pocheptsov --- .../qbluetoothdevicediscoveryagent_osx.mm | 6 ++--- src/bluetooth/qbluetoothlocaldevice_osx.mm | 2 +- src/bluetooth/qbluetoothserver_osx.mm | 6 ++--- src/bluetooth/qbluetoothserviceinfo_osx.mm | 2 +- src/bluetooth/qbluetoothsocket_osx.mm | 26 +++++++++++----------- src/bluetooth/qbluetoothtransferreply_osx.mm | 10 ++++----- 6 files changed, 26 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm b/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm index 4657da82..bdc3c85e 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm @@ -181,7 +181,7 @@ QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(con QBluetoothDeviceDiscoveryAgentPrivate::~QBluetoothDeviceDiscoveryAgentPrivate() { - if (inquiryLE && agentState != NonActive) { + if (inquiryLE.data() && agentState != NonActive) { // We want the LE scan to stop as soon as possible. if (dispatch_queue_t leQueue = OSXBluetooth::qt_LE_queue()) { // Local variable to be retained ... @@ -195,7 +195,7 @@ QBluetoothDeviceDiscoveryAgentPrivate::~QBluetoothDeviceDiscoveryAgentPrivate() bool QBluetoothDeviceDiscoveryAgentPrivate::isValid() const { - return hostController && [hostController powerState] == kBluetoothHCIPowerStateON; + return hostController.data() && [hostController powerState] == kBluetoothHCIPowerStateON; } bool QBluetoothDeviceDiscoveryAgentPrivate::isActive() const @@ -292,7 +292,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::startLE() // Check queue and create scanner: inquiryLE.reset([[LEDeviceInquiryObjC alloc] initWithNotifier:notifier.data()]); - if (inquiryLE) + if (inquiryLE.data()) notifier.take(); // Whatever happens next, inquiryLE is already the owner ... dispatch_queue_t leQueue(qt_LE_queue()); diff --git a/src/bluetooth/qbluetoothlocaldevice_osx.mm b/src/bluetooth/qbluetoothlocaldevice_osx.mm index 52b7bba8..e7dd9906 100644 --- a/src/bluetooth/qbluetoothlocaldevice_osx.mm +++ b/src/bluetooth/qbluetoothlocaldevice_osx.mm @@ -149,7 +149,7 @@ QBluetoothLocalDevicePrivate::QBluetoothLocalDevicePrivate(QBluetoothLocalDevice bool QBluetoothLocalDevicePrivate::isValid() const { - return hostController; + return hostController.data(); } void QBluetoothLocalDevicePrivate::requestPairing(const QBluetoothAddress &address, Pairing pairing) diff --git a/src/bluetooth/qbluetoothserver_osx.mm b/src/bluetooth/qbluetoothserver_osx.mm index eefaf4da..5d3b8fc4 100644 --- a/src/bluetooth/qbluetoothserver_osx.mm +++ b/src/bluetooth/qbluetoothserver_osx.mm @@ -142,7 +142,7 @@ void QBluetoothServerPrivate::stopListener() void QBluetoothServerPrivate::openNotify(IOBluetoothRFCOMMChannel *channel) { - Q_ASSERT_X(listener, Q_FUNC_INFO, "invalid listener (nil)"); + Q_ASSERT_X(listener.data(), Q_FUNC_INFO, "invalid listener (nil)"); Q_ASSERT_X(channel, Q_FUNC_INFO, "invalid channel (nil)"); Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)"); @@ -154,7 +154,7 @@ void QBluetoothServerPrivate::openNotify(IOBluetoothRFCOMMChannel *channel) void QBluetoothServerPrivate::openNotify(IOBluetoothL2CAPChannel *channel) { - Q_ASSERT_X(listener, Q_FUNC_INFO, "invalid listener (nil)"); + Q_ASSERT_X(listener.data(), Q_FUNC_INFO, "invalid listener (nil)"); Q_ASSERT_X(channel, Q_FUNC_INFO, "invalid channel (nil)"); Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)"); @@ -293,7 +293,7 @@ bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port) OSXBluetooth::qt_test_iobluetooth_runloop(); - if (d_ptr->listener) { + if (d_ptr->listener.data()) { qCWarning(QT_BT_OSX) << "already in listen mode, close server first"; return false; } diff --git a/src/bluetooth/qbluetoothserviceinfo_osx.mm b/src/bluetooth/qbluetoothserviceinfo_osx.mm index 34de4695..7ce4c645 100644 --- a/src/bluetooth/qbluetoothserviceinfo_osx.mm +++ b/src/bluetooth/qbluetoothserviceinfo_osx.mm @@ -152,7 +152,7 @@ bool QBluetoothServiceInfoPrivate::unregisterService() if (!registered) return false; - Q_ASSERT_X(serviceRecord, Q_FUNC_INFO, "service registered, but serviceRecord is nil"); + Q_ASSERT_X(serviceRecord.data(), Q_FUNC_INFO, "service registered, but serviceRecord is nil"); [serviceRecord removeServiceRecord]; serviceRecord.reset(nil); diff --git a/src/bluetooth/qbluetoothsocket_osx.mm b/src/bluetooth/qbluetoothsocket_osx.mm index 7f630146..2a856092 100644 --- a/src/bluetooth/qbluetoothsocket_osx.mm +++ b/src/bluetooth/qbluetoothsocket_osx.mm @@ -101,13 +101,13 @@ void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address, if (socketType == QBluetoothServiceInfo::RfcommProtocol) { rfcommChannel.reset([[ObjCRFCOMMChannel alloc] initWithDelegate:this]); - if (rfcommChannel) + if (rfcommChannel.data()) status = [rfcommChannel connectAsyncToDevice:address withChannelID:port]; else status = kIOReturnNoMemory; } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { l2capChannel.reset([[ObjCL2CAPChannel alloc] initWithDelegate:this]); - if (l2capChannel) + if (l2capChannel.data()) status = [l2capChannel connectAsyncToDevice:address withPSM:port]; else status = kIOReturnNoMemory; @@ -181,10 +181,10 @@ QString QBluetoothSocketPrivate::peerName() const NSString *nsName = nil; if (socketType == QBluetoothServiceInfo::RfcommProtocol) { - if (rfcommChannel) + if (rfcommChannel.data()) nsName = [rfcommChannel peerName]; } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { - if (l2capChannel) + if (l2capChannel.data()) nsName = [l2capChannel peerName]; } @@ -198,10 +198,10 @@ QBluetoothAddress QBluetoothSocketPrivate::peerAddress() const { BluetoothDeviceAddress addr = {}; if (socketType == QBluetoothServiceInfo::RfcommProtocol) { - if (rfcommChannel) + if (rfcommChannel.data()) addr = [rfcommChannel peerAddress]; } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { - if (l2capChannel) + if (l2capChannel.data()) addr = [l2capChannel peerAddress]; } @@ -211,10 +211,10 @@ QBluetoothAddress QBluetoothSocketPrivate::peerAddress() const quint16 QBluetoothSocketPrivate::peerPort() const { if (socketType == QBluetoothServiceInfo::RfcommProtocol) { - if (rfcommChannel) + if (rfcommChannel.data()) return [rfcommChannel getChannelID]; } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { - if (l2capChannel) + if (l2capChannel.data()) return [l2capChannel getPSM]; } @@ -231,7 +231,7 @@ void QBluetoothSocketPrivate::_q_writeNotify() Q_ASSERT_X(socketType == QBluetoothServiceInfo::L2capProtocol || socketType == QBluetoothServiceInfo::RfcommProtocol, Q_FUNC_INFO, "invalid socket type"); - Q_ASSERT_X(l2capChannel || rfcommChannel, Q_FUNC_INFO, + Q_ASSERT_X(l2capChannel.data() || rfcommChannel.data(), Q_FUNC_INFO, "invalid socket (no open channel)"); Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)"); @@ -275,13 +275,13 @@ bool QBluetoothSocketPrivate::setChannel(IOBluetoothRFCOMMChannel *channel) openMode = QIODevice::ReadWrite; rfcommChannel.reset([[ObjCRFCOMMChannel alloc] initWithDelegate:this channel:channel]); - if (rfcommChannel) {// We do not handle errors, up to an external user. + if (rfcommChannel.data()) {// We do not handle errors, up to an external user. q_ptr->setOpenMode(QIODevice::ReadWrite); state = QBluetoothSocket::ConnectedState; socketType = QBluetoothServiceInfo::RfcommProtocol; } - return rfcommChannel; + return rfcommChannel.data(); } bool QBluetoothSocketPrivate::setChannel(IOBluetoothL2CAPChannel *channel) @@ -299,13 +299,13 @@ bool QBluetoothSocketPrivate::setChannel(IOBluetoothL2CAPChannel *channel) openMode = QIODevice::ReadWrite; l2capChannel.reset([[ObjCL2CAPChannel alloc] initWithDelegate:this channel:channel]); - if (l2capChannel) {// We do not handle errors, up to an external user. + if (l2capChannel.data()) {// We do not handle errors, up to an external user. q_ptr->setOpenMode(QIODevice::ReadWrite); state = QBluetoothSocket::ConnectedState; socketType = QBluetoothServiceInfo::L2capProtocol; } - return l2capChannel; + return l2capChannel.data(); } diff --git a/src/bluetooth/qbluetoothtransferreply_osx.mm b/src/bluetooth/qbluetoothtransferreply_osx.mm index 65c8f82d..40a747f8 100644 --- a/src/bluetooth/qbluetoothtransferreply_osx.mm +++ b/src/bluetooth/qbluetoothtransferreply_osx.mm @@ -136,13 +136,13 @@ QBluetoothTransferReplyOSXPrivate::~QBluetoothTransferReplyOSXPrivate() // The OBEX session will be closed then. If // somehow IOBluetooth/OBEX still has a reference to our // session, it will not call any of delegate's callbacks. - if (session) + if (session.data()) [session closeSession]; } bool QBluetoothTransferReplyOSXPrivate::isActive() const { - return agent || (session && [session hasActiveRequest]); + return agent.data() || (session.data() && [session hasActiveRequest]); } bool QBluetoothTransferReplyOSXPrivate::startOPP(const QBluetoothAddress &device) @@ -218,7 +218,7 @@ void QBluetoothTransferReplyOSXPrivate::sendConnect(const QBluetoothAddress &dev void QBluetoothTransferReplyOSXPrivate::sendPut() { Q_ASSERT_X(inputStream, Q_FUNC_INFO, "invalid input stream (null)"); - Q_ASSERT_X(session, Q_FUNC_INFO, "invalid OBEX session (nil)"); + Q_ASSERT_X(session.data(), Q_FUNC_INFO, "invalid OBEX session (nil)"); Q_ASSERT_X([session isConnected], Q_FUNC_INFO, "not connected"); Q_ASSERT_X(![session hasActiveRequest], Q_FUNC_INFO, "session already has an active request"); @@ -268,7 +268,7 @@ void QBluetoothTransferReplyOSXPrivate::OBEXConnectError(OBEXError errorCode, OB Q_UNUSED(errorCode) Q_UNUSED(response) - if (session) { + if (session.data()) { setReplyError(QBluetoothTransferReply::SessionError, QCoreApplication::translate(TRANSFER_REPLY, TR_CONNECT_FAILED)); } else { @@ -283,7 +283,7 @@ void QBluetoothTransferReplyOSXPrivate::OBEXConnectError(OBEXError errorCode, OB void QBluetoothTransferReplyOSXPrivate::OBEXConnectSuccess() { // Now that OBEX connect succeeded, we can send an OBEX put request. - if (!session) { + if (!session.data()) { // We're still in OBEXConnect(), it'll take care of next steps. return; } -- cgit v1.2.3 From c9d585da2ddd49108d7b56f480bcfc9d71b67dbf Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 7 May 2019 15:09:00 +0200 Subject: winrt: Add limitations to bluetooth overview page Same as on Android, Obex is not supported on winrt. Even though QBluetoothServiceInfo has a small passage about winrt's limitations when it comes to RFCOMM. Users might miss these limitations as they are quite hidden. Make them more visible by also having them in the overview. Task-number: QTBUG-62520 Change-Id: Ibdf1a9b334b7138301e833981e67c7813488bbd1 Reviewed-by: Alex Blasche --- src/bluetooth/doc/src/bluetooth-overview.qdoc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bluetooth/doc/src/bluetooth-overview.qdoc b/src/bluetooth/doc/src/bluetooth-overview.qdoc index 8138e937..e27dc0ed 100644 --- a/src/bluetooth/doc/src/bluetooth-overview.qdoc +++ b/src/bluetooth/doc/src/bluetooth-overview.qdoc @@ -47,7 +47,12 @@ \li Receive advertisement from Bluetooth Low Energy device. \endlist - Note that the Object Push Profile is not supported on Android. + Note that the Object Push Profile is not supported on Android and Windows. + + Note that parts of RFCOMM functionality cannot be configured by Qt on Windows. + A service's \l {ServiceClassIds} and \l {ProtocolDescriptorList} are filled automatically by + Windows. Therefore registering a service with custom values for these fields might not yield the + expected result on Windows. The following sections describe how to use the Qt Bluetooth C++ API classes for the above use cases. -- cgit v1.2.3 From 406b18fdb3704a9e9e66cefbc74e7cff55f1947c Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Tue, 6 Aug 2019 09:28:46 +0200 Subject: Fix QLEAdvertisingData::setManufacturerData on Android The manufacturer data was not properly set because the related Java function requires a byte[] as second parameter. The equivelent JNI type is [B and not [B]. This caused a crash of the application. Change-Id: Iaa062ed9eb01e03d155583519d3f6a6bc01d72f7 Reviewed-by: Timur Pocheptsov --- src/bluetooth/qlowenergycontroller_android.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/bluetooth/qlowenergycontroller_android.cpp b/src/bluetooth/qlowenergycontroller_android.cpp index 35d943fc..86e6ade7 100644 --- a/src/bluetooth/qlowenergycontroller_android.cpp +++ b/src/bluetooth/qlowenergycontroller_android.cpp @@ -940,7 +940,7 @@ static QAndroidJniObject createJavaAdvertiseData(const QLowEnergyAdvertisingData env->SetByteArrayRegion(nativeData, 0, nativeSize, reinterpret_cast(data.manufacturerData().constData())); builder = builder.callObjectMethod("addManufacturerData", - "(I[B])Landroid/bluetooth/le/AdvertiseData$Builder;", + "(I[B)Landroid/bluetooth/le/AdvertiseData$Builder;", data.manufacturerId(), nativeData); env->DeleteLocalRef(nativeData); -- cgit v1.2.3 From dd4593c61e4b77c4e3b1ee516a1e8825ebb0197b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Thu, 5 Sep 2019 14:03:52 +0200 Subject: Fix build errors with clang-cl on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following errors are fixed: error: member access into incomplete type 'ABI::Windows::Devices::Bluetooth::IBluetoothDeviceStatics' error: unknown type name 'QMutex'; did you mean 'Mutex'? Task-number: QTQAINFRA-2139 Change-Id: I5e5d9c0776cd9feb5d682c5a0e1be2f5173101f9 Reviewed-by: Tony Sarajärvi --- src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | 1 + src/bluetooth/qbluetoothlocaldevice_p.h | 1 + src/bluetooth/qbluetoothlocaldevice_winrt.cpp | 2 ++ 3 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp index 940aa599..ae8e9184 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #include #include diff --git a/src/bluetooth/qbluetoothlocaldevice_p.h b/src/bluetooth/qbluetoothlocaldevice_p.h index 75e75aee..b2f03b9f 100644 --- a/src/bluetooth/qbluetoothlocaldevice_p.h +++ b/src/bluetooth/qbluetoothlocaldevice_p.h @@ -229,6 +229,7 @@ class QBluetoothLocalDevicePrivate : public QObject public: QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *q, QBluetoothAddress = QBluetoothAddress()); + ~QBluetoothLocalDevicePrivate(); bool isValid() const; diff --git a/src/bluetooth/qbluetoothlocaldevice_winrt.cpp b/src/bluetooth/qbluetoothlocaldevice_winrt.cpp index ae794db0..6e8b1966 100644 --- a/src/bluetooth/qbluetoothlocaldevice_winrt.cpp +++ b/src/bluetooth/qbluetoothlocaldevice_winrt.cpp @@ -114,6 +114,8 @@ QBluetoothLocalDevicePrivate::QBluetoothLocalDevicePrivate(QBluetoothLocalDevice GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Devices_Bluetooth_BluetoothDevice).Get(), &mStatics); } +QBluetoothLocalDevicePrivate::~QBluetoothLocalDevicePrivate() = default; + bool QBluetoothLocalDevicePrivate::isValid() const { return (mStatics != nullptr && mLEStatics != nullptr); -- cgit v1.2.3 From 10c8985b9151ea6b4ccfc7bbfb996af1001612ef Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 9 Sep 2019 10:43:43 +0200 Subject: qbluetoothdevicediscoveryagent_winrt.cpp: Fix build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing include for QMutex/Locker. Change-Id: I9e341b2ecaaae6e1b3a0bcf58ff7d890a4479091 Reviewed-by: André de la Rocha --- src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp index 7cabe9d0..3407d280 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From c52e8c83933ee6752233cc8c278c6972f3e412e5 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Thu, 8 Aug 2019 10:36:36 +0200 Subject: Align deviceUpdated() & deviceDiscovered() behavior The documentation for QBluetoothDeviceInfo::deviceDiscovered() and deviceUpdated() is fairly specific. This change brings Bluez5 behavior in line with Android and Apple platforms. Change-Id: Ia819f8b8a9b5c2268edbee0a3005e0129d0553e6 Reviewed-by: Timur Pocheptsov Reviewed-by: Thiemo van Engelen --- .../qbluetoothdevicediscoveryagent_bluez.cpp | 124 ++++++++++++++------- src/bluetooth/qbluetoothdevicediscoveryagent_p.h | 2 +- 2 files changed, 83 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp index a7def3d0..bc3ee587 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp @@ -403,50 +403,22 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_deviceFound(const QString &addres emit q->deviceDiscovered(device); } -void QBluetoothDeviceDiscoveryAgentPrivate::deviceFoundBluez5(const QString& devicePath) +// Returns invalid QBluetoothDeviceInfo in case of error +static QBluetoothDeviceInfo createDeviceInfoFromBluez5Device(const OrgBluezDevice1Interface &bluezDevice) { - Q_Q(QBluetoothDeviceDiscoveryAgent); - - if (!q->isActive()) - return; - - OrgBluezDevice1Interface device(QStringLiteral("org.bluez"), devicePath, - QDBusConnection::systemBus()); - - if (device.adapter().path() != adapterBluez5->path()) - return; - - const QBluetoothAddress btAddress(device.address()); - if (btAddress.isNull()) // no point reporting an empty address - return; - - const QString btName = device.alias(); - quint32 btClass = device.classProperty(); - - qCDebug(QT_BT_BLUEZ) << "Discovered: " << btAddress.toString() << btName - << "Num UUIDs" << device.uUIDs().count() - << "total device" << discoveredDevices.count() << "cached" - << "RSSI" << device.rSSI() << "Class" << btClass - << "Num ManufacturerData" << device.manufacturerData().size(); - - OrgFreedesktopDBusPropertiesInterface *prop = new OrgFreedesktopDBusPropertiesInterface( - QStringLiteral("org.bluez"), devicePath, QDBusConnection::systemBus(), q); - QObject::connect(prop, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged, - q, [this](const QString &interface, const QVariantMap &changedProperties, - const QStringList &invalidatedProperties) { - this->_q_PropertiesChanged(interface, changedProperties, invalidatedProperties); - }); + const QBluetoothAddress btAddress(bluezDevice.address()); + if (btAddress.isNull()) + return QBluetoothDeviceInfo(); - // remember what we have to cleanup - propertyMonitors.append(prop); + const QString btName = bluezDevice.alias(); + quint32 btClass = bluezDevice.classProperty(); - // read information QBluetoothDeviceInfo deviceInfo(btAddress, btName, btClass); - deviceInfo.setRssi(device.rSSI()); + deviceInfo.setRssi(bluezDevice.rSSI()); QVector uuids; bool foundLikelyLowEnergyUuid = false; - for (const auto &u: device.uUIDs()) { + for (const auto &u: bluezDevice.uUIDs()) { const QBluetoothUuid id(u); if (id.isNull()) continue; @@ -470,16 +442,56 @@ void QBluetoothDeviceDiscoveryAgentPrivate::deviceFoundBluez5(const QString& dev deviceInfo.setCoreConfigurations(QBluetoothDeviceInfo::BaseRateAndLowEnergyCoreConfiguration); } - const ManufacturerDataList deviceManufacturerData = device.manufacturerData(); + const ManufacturerDataList deviceManufacturerData = bluezDevice.manufacturerData(); const QList keys = deviceManufacturerData.keys(); for (quint16 key : keys) deviceInfo.setManufacturerData( key, deviceManufacturerData.value(key).variant().toByteArray()); + return deviceInfo; +} + +void QBluetoothDeviceDiscoveryAgentPrivate::deviceFoundBluez5(const QString &devicePath) +{ + Q_Q(QBluetoothDeviceDiscoveryAgent); + + if (!q->isActive()) + return; + + OrgBluezDevice1Interface device(QStringLiteral("org.bluez"), devicePath, + QDBusConnection::systemBus()); + + if (device.adapter().path() != adapterBluez5->path()) + return; + + + // read information + QBluetoothDeviceInfo deviceInfo = createDeviceInfoFromBluez5Device(device); + if (!deviceInfo.isValid()) // no point reporting an empty address + return; + + qCDebug(QT_BT_BLUEZ) << "Discovered: " << device.alias() << deviceInfo.name() << device.address() + << "Num UUIDs" << device.uUIDs().count() + << "total device" << discoveredDevices.count() << "cached" + << "RSSI" << device.rSSI() << "Class" << device.classProperty() + << "Num ManufacturerData" << device.manufacturerData().size(); + + OrgFreedesktopDBusPropertiesInterface *prop = new OrgFreedesktopDBusPropertiesInterface( + QStringLiteral("org.bluez"), devicePath, QDBusConnection::systemBus(), q); + QObject::connect(prop, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged, + q, [this](const QString &interface, const QVariantMap &changedProperties, + const QStringList &invalidatedProperties) { + this->_q_PropertiesChanged(interface, changedProperties, invalidatedProperties); + }); + + // remember what we have to cleanup + propertyMonitors.append(prop); + + for (int i = 0; i < discoveredDevices.size(); i++) { if (discoveredDevices[i].address() == deviceInfo.address()) { - if (discoveredDevices[i] == deviceInfo && lowEnergySearchTimeout > 0) { - qCDebug(QT_BT_BLUEZ) << "Duplicate: " << btAddress.toString(); + if (lowEnergySearchTimeout > 0 && discoveredDevices[i] == deviceInfo) { + qCDebug(QT_BT_BLUEZ) << "Duplicate: " << device.address(); return; } discoveredDevices.replace(i, deviceInfo); @@ -641,6 +653,10 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_PropertiesChanged(const QString & OrgBluezDevice1Interface device(QStringLiteral("org.bluez"), props->path(), QDBusConnection::systemBus()); + const auto info = createDeviceInfoFromBluez5Device(device); + if (!info.isValid()) + return; + for (int i = 0; i < discoveredDevices.size(); i++) { if (discoveredDevices[i].address().toString() == device.address()) { QBluetoothDeviceInfo::Fields updatedFields = QBluetoothDeviceInfo::Field::None; @@ -657,11 +673,35 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_PropertiesChanged(const QString & qdbus_cast< ManufacturerDataList >(changed_properties.value(QStringLiteral("ManufacturerData"))); const QList keys = changedManufacturerData.keys(); + bool wasNewValue = false; for (quint16 key : keys) { - if (discoveredDevices[i].setManufacturerData(key, changedManufacturerData.value(key).variant().toByteArray())) - updatedFields.setFlag(QBluetoothDeviceInfo::Field::ManufacturerData); + bool added = discoveredDevices[i].setManufacturerData(key, changedManufacturerData.value(key).variant().toByteArray()); + wasNewValue = (wasNewValue || added); } + + if (wasNewValue) + updatedFields.setFlag(QBluetoothDeviceInfo::Field::ManufacturerData); } + + if (lowEnergySearchTimeout > 0) { + if (discoveredDevices[i] != info) { // field other than manufacturer or rssi changed + if (discoveredDevices.at(i).name() == info.name()) { + qCDebug(QT_BT_BLUEZ) << "Almost Duplicate " << info.address() + << info.name() << "- replacing in place"; + discoveredDevices.replace(i, info); + emit q->deviceDiscovered(info); + } + } else { + if (!updatedFields.testFlag(QBluetoothDeviceInfo::Field::None)) + emit q->deviceUpdated(discoveredDevices[i], updatedFields); + } + + return; + } + + discoveredDevices.replace(i, info); + emit q_ptr->deviceDiscovered(discoveredDevices[i]); + if (!updatedFields.testFlag(QBluetoothDeviceInfo::Field::None)) emit q->deviceUpdated(discoveredDevices[i], updatedFields); return; diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h index be3a8863..a92106c4 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h @@ -183,7 +183,7 @@ private: QTimer *discoveryTimer = nullptr; QList propertyMonitors; - void deviceFoundBluez5(const QString& devicePath); + void deviceFoundBluez5(const QString &devicePath); void startBluez5(QBluetoothDeviceDiscoveryAgent::DiscoveryMethods methods); bool useExtendedDiscovery; -- cgit v1.2.3 From 2c6dcc643f29c212fca0ead123a377e96b9a17c9 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Mon, 2 Sep 2019 15:22:54 +0200 Subject: Do not make blocking dbus calls in dbus callbacks Doing so blocks the main event handler which could lead to a sluggish UI experience. Fixes: QTBUG-77390 Change-Id: Id3624d602131c04e535584a7a4740ce2f751daaf Reviewed-by: Timur Pocheptsov Reviewed-by: Thiemo van Engelen --- .../qbluetoothdevicediscoveryagent_bluez.cpp | 95 +++++++++++++--------- src/bluetooth/qbluetoothdevicediscoveryagent_p.h | 3 +- 2 files changed, 58 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp index bc3ee587..7dce9dae 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp @@ -135,6 +135,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start(QBluetoothDeviceDiscoveryAgent } discoveredDevices.clear(); + devicesProperties.clear(); if (managerBluez5) { startBluez5(methods); @@ -309,7 +310,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::startBluez5(QBluetoothDeviceDiscover if (path.path().indexOf(adapterBluez5->path()) != 0) continue; //devices whose path doesn't start with same path we skip - deviceFoundBluez5(path.path()); + deviceFoundBluez5(path.path(), jt.value()); if (!isActive()) // Can happen if stop() was called from a slot in user code. return; } @@ -404,21 +405,22 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_deviceFound(const QString &addres } // Returns invalid QBluetoothDeviceInfo in case of error -static QBluetoothDeviceInfo createDeviceInfoFromBluez5Device(const OrgBluezDevice1Interface &bluezDevice) +static QBluetoothDeviceInfo createDeviceInfoFromBluez5Device(const QVariantMap& properties) { - const QBluetoothAddress btAddress(bluezDevice.address()); + const QBluetoothAddress btAddress(properties[QStringLiteral("Address")].toString()); if (btAddress.isNull()) return QBluetoothDeviceInfo(); - const QString btName = bluezDevice.alias(); - quint32 btClass = bluezDevice.classProperty(); + const QString btName = properties[QStringLiteral("Alias")].toString(); + quint32 btClass = properties[QStringLiteral("Class")].toUInt(); QBluetoothDeviceInfo deviceInfo(btAddress, btName, btClass); - deviceInfo.setRssi(bluezDevice.rSSI()); + deviceInfo.setRssi(qvariant_cast(properties[QStringLiteral("RSSI")])); QVector uuids; bool foundLikelyLowEnergyUuid = false; - for (const auto &u: bluezDevice.uUIDs()) { + const QStringList foundUuids = qvariant_cast(properties[QStringLiteral("UUIDs")]); + for (const auto &u: foundUuids) { const QBluetoothUuid id(u); if (id.isNull()) continue; @@ -442,7 +444,7 @@ static QBluetoothDeviceInfo createDeviceInfoFromBluez5Device(const OrgBluezDevic deviceInfo.setCoreConfigurations(QBluetoothDeviceInfo::BaseRateAndLowEnergyCoreConfiguration); } - const ManufacturerDataList deviceManufacturerData = bluezDevice.manufacturerData(); + const ManufacturerDataList deviceManufacturerData = qdbus_cast(properties[QStringLiteral("ManufacturerData")]); const QList keys = deviceManufacturerData.keys(); for (quint16 key : keys) deviceInfo.setManufacturerData( @@ -451,30 +453,28 @@ static QBluetoothDeviceInfo createDeviceInfoFromBluez5Device(const OrgBluezDevic return deviceInfo; } -void QBluetoothDeviceDiscoveryAgentPrivate::deviceFoundBluez5(const QString &devicePath) +void QBluetoothDeviceDiscoveryAgentPrivate::deviceFoundBluez5(const QString &devicePath, + const QVariantMap &properties) { Q_Q(QBluetoothDeviceDiscoveryAgent); if (!q->isActive()) return; - OrgBluezDevice1Interface device(QStringLiteral("org.bluez"), devicePath, - QDBusConnection::systemBus()); - - if (device.adapter().path() != adapterBluez5->path()) - return; - + auto deviceAdapter = qvariant_cast(properties[QStringLiteral("Adapter")]); + if (deviceAdapter.path() != adapterBluez5->path()) + return; // read information - QBluetoothDeviceInfo deviceInfo = createDeviceInfoFromBluez5Device(device); + QBluetoothDeviceInfo deviceInfo = createDeviceInfoFromBluez5Device(properties); if (!deviceInfo.isValid()) // no point reporting an empty address return; - qCDebug(QT_BT_BLUEZ) << "Discovered: " << device.alias() << deviceInfo.name() << device.address() - << "Num UUIDs" << device.uUIDs().count() + qCDebug(QT_BT_BLUEZ) << "Discovered: " << deviceInfo.name() << deviceInfo.address() + << "Num UUIDs" << deviceInfo.serviceUuids().count() << "total device" << discoveredDevices.count() << "cached" - << "RSSI" << device.rSSI() << "Class" << device.classProperty() - << "Num ManufacturerData" << device.manufacturerData().size(); + << "RSSI" << deviceInfo.rssi() + << "Num ManufacturerData" << deviceInfo.manufacturerData().size(); OrgFreedesktopDBusPropertiesInterface *prop = new OrgFreedesktopDBusPropertiesInterface( QStringLiteral("org.bluez"), devicePath, QDBusConnection::systemBus(), q); @@ -487,11 +487,13 @@ void QBluetoothDeviceDiscoveryAgentPrivate::deviceFoundBluez5(const QString &dev // remember what we have to cleanup propertyMonitors.append(prop); + // Cache the properties so we do not have to access dbus every time to get a value + devicesProperties[devicePath] = properties; for (int i = 0; i < discoveredDevices.size(); i++) { if (discoveredDevices[i].address() == deviceInfo.address()) { if (lowEnergySearchTimeout > 0 && discoveredDevices[i] == deviceInfo) { - qCDebug(QT_BT_BLUEZ) << "Duplicate: " << device.address(); + qCDebug(QT_BT_BLUEZ) << "Duplicate: " << deviceInfo.address(); return; } discoveredDevices.replace(i, deviceInfo); @@ -579,7 +581,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_InterfacesAdded(const QDBusObject if (interfaces_and_properties.contains(QStringLiteral("org.bluez.Device1"))) { // device interfaces belonging to different adapter // will be filtered out by deviceFoundBluez5(); - deviceFoundBluez5(object_path.path()); + deviceFoundBluez5(object_path.path(), interfaces_and_properties[QStringLiteral("org.bluez.Device1")]); } } @@ -640,35 +642,51 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_discoveryInterrupted(const QStrin void QBluetoothDeviceDiscoveryAgentPrivate::_q_PropertiesChanged(const QString &interface, const QVariantMap &changed_properties, - const QStringList &) + const QStringList &invalidated_properties) { Q_Q(QBluetoothDeviceDiscoveryAgent); - if (interface == QStringLiteral("org.bluez.Device1") - && (changed_properties.contains(QStringLiteral("RSSI")) - || changed_properties.contains(QStringLiteral("ManufacturerData")))) { - OrgFreedesktopDBusPropertiesInterface *props = - qobject_cast(q->sender()); - if (!props) - return; + if (interface != QStringLiteral("org.bluez.Device1")) + return; - OrgBluezDevice1Interface device(QStringLiteral("org.bluez"), props->path(), - QDBusConnection::systemBus()); - const auto info = createDeviceInfoFromBluez5Device(device); - if (!info.isValid()) - return; + OrgFreedesktopDBusPropertiesInterface *props = + qobject_cast(q->sender()); + if (!props) + return; + + const QString path = props->path(); + if (!devicesProperties.contains(path)) + return; + + // Update the cached properties before checking changed_properties for RSSI and ManufacturerData + // so the cached properties are always up to date. + QVariantMap & properties = devicesProperties[path]; + for (QVariantMap::const_iterator it = changed_properties.constBegin(); + it != changed_properties.constEnd(); ++it) { + properties[it.key()] = it.value(); + } + + for (const QString & property : invalidated_properties) + properties.remove(property); + + const auto info = createDeviceInfoFromBluez5Device(properties); + if (!info.isValid()) + return; + + if (changed_properties.contains(QStringLiteral("RSSI")) + || changed_properties.contains(QStringLiteral("ManufacturerData"))) { for (int i = 0; i < discoveredDevices.size(); i++) { - if (discoveredDevices[i].address().toString() == device.address()) { + if (discoveredDevices[i].address() == info.address()) { QBluetoothDeviceInfo::Fields updatedFields = QBluetoothDeviceInfo::Field::None; if (changed_properties.contains(QStringLiteral("RSSI"))) { - qCDebug(QT_BT_BLUEZ) << "Updating RSSI for" << device.address() + qCDebug(QT_BT_BLUEZ) << "Updating RSSI for" << info.address() << changed_properties.value(QStringLiteral("RSSI")); discoveredDevices[i].setRssi( changed_properties.value(QStringLiteral("RSSI")).toInt()); updatedFields.setFlag(QBluetoothDeviceInfo::Field::RSSI); } if (changed_properties.contains(QStringLiteral("ManufacturerData"))) { - qCDebug(QT_BT_BLUEZ) << "Updating ManufacturerData for" << device.address(); + qCDebug(QT_BT_BLUEZ) << "Updating ManufacturerData for" << info.address(); ManufacturerDataList changedManufacturerData = qdbus_cast< ManufacturerDataList >(changed_properties.value(QStringLiteral("ManufacturerData"))); @@ -709,5 +727,4 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_PropertiesChanged(const QString & } } } - QT_END_NAMESPACE diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h index a92106c4..27220a09 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h @@ -183,11 +183,12 @@ private: QTimer *discoveryTimer = nullptr; QList propertyMonitors; - void deviceFoundBluez5(const QString &devicePath); + void deviceFoundBluez5(const QString &devicePath, const QVariantMap &properties); void startBluez5(QBluetoothDeviceDiscoveryAgent::DiscoveryMethods methods); bool useExtendedDiscovery; QTimer extendedDiscoveryTimer; + QMap devicesProperties; #endif #ifdef QT_WIN_BLUETOOTH -- cgit v1.2.3 From 87617df961fd5e7a1d7c3e3ceba4125ca7090f9e Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Mon, 16 Sep 2019 14:38:41 +0200 Subject: Fix \since version for createCentral() Change-Id: I8d26fc7c4b7a93c4f839683feedd76cfbc1b5979 Reviewed-by: Albert Astals Cid --- src/bluetooth/qlowenergycontroller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp index bd263812..ec140a85 100644 --- a/src/bluetooth/qlowenergycontroller.cpp +++ b/src/bluetooth/qlowenergycontroller.cpp @@ -465,7 +465,7 @@ QLowEnergyController *QLowEnergyController::createCentral(const QBluetoothDevice Note that specifying the local device to be used for the connection is only possible when using BlueZ. All other platforms do not support this feature. - \since 5.13 + \since 5.14 */ QLowEnergyController *QLowEnergyController::createCentral(const QBluetoothAddress &remoteDevice, const QBluetoothAddress &localDevice, -- cgit v1.2.3