summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-17 03:05:58 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-17 03:06:04 +0200
commit125dbf5e1e1b927330f6f20973b0d2437ad4aa47 (patch)
tree62815c855ff4060fa02bdebaf60272a5eeca886e
parent75bb24bf9efc771d8462a3ee69ace6b398f8515f (diff)
parent434f713defbbe060207fd6b690e802ad1fa6c5bb (diff)
Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"
-rw-r--r--dist/changes-5.12.42
-rw-r--r--dist/changes-5.12.538
-rw-r--r--dist/changes-5.13.136
-rw-r--r--src/bluetooth/android/localdevicebroadcastreceiver.cpp12
-rw-r--r--src/bluetooth/doc/src/bluetooth-overview.qdoc7
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp173
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_p.h3
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp6
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_android.cpp11
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_osx.mm2
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_p.h2
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_winrt.cpp2
-rw-r--r--src/bluetooth/qbluetoothtransferreply_osx.mm10
-rw-r--r--src/bluetooth/qlowenergycontroller.cpp2
-rw-r--r--src/bluetooth/qlowenergycontroller_android.cpp2
-rw-r--r--src/bluetooth/qlowenergycontroller_bluezdbus.cpp4
16 files changed, 225 insertions, 87 deletions
diff --git a/dist/changes-5.12.4 b/dist/changes-5.12.4
index cb7ef2bf..d751f704 100644
--- a/dist/changes-5.12.4
+++ b/dist/changes-5.12.4
@@ -18,7 +18,7 @@ Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
****************************************************************************
-* Qt 5.12.3 Changes *
+* Qt 5.12.4 Changes *
****************************************************************************
QtBluetooth
diff --git a/dist/changes-5.12.5 b/dist/changes-5.12.5
new file mode 100644
index 00000000..9f0b41b1
--- /dev/null
+++ b/dist/changes-5.12.5
@@ -0,0 +1,38 @@
+Qt 5.12.5 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.12.0 through 5.12.4.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.12 series is binary compatible with the 5.11.x series.
+Applications compiled for 5.11 will continue to run with 5.12.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Qt 5.12.5 Changes *
+****************************************************************************
+
+QtBluetooth
+-----------
+
+ - [QTBUG-76847] Fixed ambiguous type conversions on Apple platforms.
+
+ - [QTBUG-75089] Removed attempt to delete nullptr on WinRT when calling
+ QBluetoothDeviceDiscoveryAgent::stop().
+
+ - [QTBUG-76565] Reverted handling of PAIRING_VARIANT_PIN by
+ QBluetoothLocalDevice on Android.
+
+ - [QTBUG-62520] Improved documentation covering platform limitations on WinRT.
+
+ - Fixed QLowEnergyAdvertisingData::setManufacturerData() on Android. Previously a wrong
+ JNI signature prevented setting the data.
diff --git a/dist/changes-5.13.1 b/dist/changes-5.13.1
new file mode 100644
index 00000000..706bd31d
--- /dev/null
+++ b/dist/changes-5.13.1
@@ -0,0 +1,36 @@
+Qt 5.13.1 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.13.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.13 series is binary compatible with the 5.12.x series.
+Applications compiled for 5.12 will continue to run with 5.13.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Qt 5.13.1 Changes *
+****************************************************************************
+
+QtBluetooth
+-----------
+
+ - [QTBUG-62520] Improved stability of QBluetoothSocket::connectToService()
+ on WinRT.
+
+ - [QTBUG-62294] Added implementation for QBluetoothLocalSocket on WinRT. Note
+ that the platform only supports pairingStatus() related features.
+
+ - Improved stability of QLowEnergyController on WinRT.
+
+ - [QTBUG-75907] Reduced number of asserts in QLowEnergyController on WinRT.
+
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<jstring>("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<jint>("getIntExtra",
diff --git a/src/bluetooth/doc/src/bluetooth-overview.qdoc b/src/bluetooth/doc/src/bluetooth-overview.qdoc
index 902a13b7..33ccaa33 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.
Note that the Received Signal Strength Indicator (RSSI), as well as
the Manufacturer Specific Data advertised by Bluetooth LE devices are
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
index a7def3d0..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;
}
@@ -403,50 +404,23 @@ 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 QVariantMap& properties)
{
- 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 QBluetoothAddress btAddress(properties[QStringLiteral("Address")].toString());
+ if (btAddress.isNull())
+ return QBluetoothDeviceInfo();
- const QString btName = device.alias();
- quint32 btClass = device.classProperty();
+ const QString btName = properties[QStringLiteral("Alias")].toString();
+ quint32 btClass = properties[QStringLiteral("Class")].toUInt();
- 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);
- });
-
- // remember what we have to cleanup
- propertyMonitors.append(prop);
-
- // read information
QBluetoothDeviceInfo deviceInfo(btAddress, btName, btClass);
- deviceInfo.setRssi(device.rSSI());
+ deviceInfo.setRssi(qvariant_cast<short>(properties[QStringLiteral("RSSI")]));
QVector<QBluetoothUuid> uuids;
bool foundLikelyLowEnergyUuid = false;
- for (const auto &u: device.uUIDs()) {
+ const QStringList foundUuids = qvariant_cast<QStringList>(properties[QStringLiteral("UUIDs")]);
+ for (const auto &u: foundUuids) {
const QBluetoothUuid id(u);
if (id.isNull())
continue;
@@ -470,16 +444,56 @@ void QBluetoothDeviceDiscoveryAgentPrivate::deviceFoundBluez5(const QString& dev
deviceInfo.setCoreConfigurations(QBluetoothDeviceInfo::BaseRateAndLowEnergyCoreConfiguration);
}
- const ManufacturerDataList deviceManufacturerData = device.manufacturerData();
+ const ManufacturerDataList deviceManufacturerData = qdbus_cast<ManufacturerDataList>(properties[QStringLiteral("ManufacturerData")]);
const QList<quint16> keys = deviceManufacturerData.keys();
for (quint16 key : keys)
deviceInfo.setManufacturerData(
key, deviceManufacturerData.value(key).variant().toByteArray());
+ return deviceInfo;
+}
+
+void QBluetoothDeviceDiscoveryAgentPrivate::deviceFoundBluez5(const QString &devicePath,
+ const QVariantMap &properties)
+{
+ Q_Q(QBluetoothDeviceDiscoveryAgent);
+
+ if (!q->isActive())
+ return;
+
+ auto deviceAdapter = qvariant_cast<QDBusObjectPath>(properties[QStringLiteral("Adapter")]);
+ if (deviceAdapter.path() != adapterBluez5->path())
+ return;
+
+ // read information
+ QBluetoothDeviceInfo deviceInfo = createDeviceInfoFromBluez5Device(properties);
+ if (!deviceInfo.isValid()) // no point reporting an empty address
+ return;
+
+ qCDebug(QT_BT_BLUEZ) << "Discovered: " << deviceInfo.name() << deviceInfo.address()
+ << "Num UUIDs" << deviceInfo.serviceUuids().count()
+ << "total device" << discoveredDevices.count() << "cached"
+ << "RSSI" << deviceInfo.rssi()
+ << "Num ManufacturerData" << deviceInfo.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);
+
+ // 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 (discoveredDevices[i] == deviceInfo && lowEnergySearchTimeout > 0) {
- qCDebug(QT_BT_BLUEZ) << "Duplicate: " << btAddress.toString();
+ if (lowEnergySearchTimeout > 0 && discoveredDevices[i] == deviceInfo) {
+ qCDebug(QT_BT_BLUEZ) << "Duplicate: " << deviceInfo.address();
return;
}
discoveredDevices.replace(i, deviceInfo);
@@ -567,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")]);
}
}
@@ -628,40 +642,84 @@ 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<OrgFreedesktopDBusPropertiesInterface *>(q->sender());
- if (!props)
- return;
+ if (interface != QStringLiteral("org.bluez.Device1"))
+ return;
+
+ OrgFreedesktopDBusPropertiesInterface *props =
+ qobject_cast<OrgFreedesktopDBusPropertiesInterface *>(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"))) {
- OrgBluezDevice1Interface device(QStringLiteral("org.bluez"), props->path(),
- QDBusConnection::systemBus());
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")));
const QList<quint16> 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;
@@ -669,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 be3a8863..27220a09 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
@@ -183,11 +183,12 @@ private:
QTimer *discoveryTimer = nullptr;
QList<OrgFreedesktopDBusPropertiesInterface *> propertyMonitors;
- void deviceFoundBluez5(const QString& devicePath);
+ void deviceFoundBluez5(const QString &devicePath, const QVariantMap &properties);
void startBluez5(QBluetoothDeviceDiscoveryAgent::DiscoveryMethods methods);
bool useExtendedDiscovery;
QTimer extendedDiscoveryTimer;
+ QMap<QString, QVariantMap> devicesProperties;
#endif
#ifdef QT_WIN_BLUETOOTH
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
index 7cabe9d0..5376ad2f 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
@@ -50,7 +50,9 @@
#include <QtBluetooth/private/qtbluetoothglobal_p.h>
#include <QtBluetooth/private/qbluetoothutils_winrt_p.h>
#include <QtCore/QLoggingCategory>
+#include <QtCore/qmutex.h>
#include <QtCore/private/qeventdispatcher_winrt_p.h>
+#include <QtCore/qmutex.h>
#include <robuffer.h>
#include <wrl.h>
@@ -865,10 +867,8 @@ void QBluetoothDeviceDiscoveryAgentPrivate::stop()
disconnectAndClearWorker();
emit q->canceled();
}
- if (leScanTimer) {
+ if (leScanTimer)
leScanTimer->stop();
- worker->deleteLater();
- }
}
void QBluetoothDeviceDiscoveryAgentPrivate::registerDevice(const QBluetoothDeviceInfo &info)
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_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/qbluetoothlocaldevice_p.h b/src/bluetooth/qbluetoothlocaldevice_p.h
index 28e7ed53..d86ab22f 100644
--- a/src/bluetooth/qbluetoothlocaldevice_p.h
+++ b/src/bluetooth/qbluetoothlocaldevice_p.h
@@ -129,7 +129,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;
@@ -254,6 +253,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);
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;
}
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,
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<const jbyte*>(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);
diff --git a/src/bluetooth/qlowenergycontroller_bluezdbus.cpp b/src/bluetooth/qlowenergycontroller_bluezdbus.cpp
index 4e5f3430..2a0fafdf 100644
--- a/src/bluetooth/qlowenergycontroller_bluezdbus.cpp
+++ b/src/bluetooth/qlowenergycontroller_bluezdbus.cpp
@@ -340,7 +340,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"
@@ -362,7 +362,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"