summaryrefslogtreecommitdiffstats
path: root/src/bluetooth
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-05-06 09:16:02 +0200
committerLiang Qi <liang.qi@qt.io>2016-05-06 09:16:02 +0200
commitcaded2edf69e8a60897653ace1e10b72199c7427 (patch)
tree1b28cd7578195ca3d7e14c83ccf181adbe2476ec /src/bluetooth
parent9677182c07b22f5f1f4fdff3f1fce6a28f76b662 (diff)
parent54c9cd9e28bc6f0a2fa5118cfdbe922d71db6623 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: examples/nfc/corkboard/corkboard.pro Change-Id: I5d1ea0a8e21a1b55dbf744c2f4b469bc51f05c7a
Diffstat (limited to 'src/bluetooth')
-rw-r--r--src/bluetooth/bluetooth.pro6
-rw-r--r--src/bluetooth/dummy/dummy.pri2
-rw-r--r--src/bluetooth/dummy/dummy_helper.cpp53
-rw-r--r--src/bluetooth/dummy/dummy_helper_p.h56
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent.cpp2
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp3
-rw-r--r--src/bluetooth/qbluetoothlocaldevice.cpp4
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_p.cpp2
-rw-r--r--src/bluetooth/qbluetoothserver_p.cpp2
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent.cpp7
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_p.cpp2
-rw-r--r--src/bluetooth/qbluetoothserviceinfo.cpp54
-rw-r--r--src/bluetooth/qbluetoothserviceinfo_p.cpp2
-rw-r--r--src/bluetooth/qbluetoothsocket.cpp12
-rw-r--r--src/bluetooth/qbluetoothsocket_p.cpp2
-rw-r--r--src/bluetooth/qbluetoothtransfermanager.cpp6
-rw-r--r--src/bluetooth/qbluetoothuuid.cpp9
-rw-r--r--src/bluetooth/qlowenergycontroller_p.cpp2
18 files changed, 192 insertions, 34 deletions
diff --git a/src/bluetooth/bluetooth.pro b/src/bluetooth/bluetooth.pro
index a5d6aebe..a614516f 100644
--- a/src/bluetooth/bluetooth.pro
+++ b/src/bluetooth/bluetooth.pro
@@ -120,7 +120,8 @@ config_bluez:qtHaveModule(dbus) {
ANDROID_PERMISSIONS = \
android.permission.BLUETOOTH \
- android.permission.BLUETOOTH_ADMIN
+ android.permission.BLUETOOTH_ADMIN \
+ android.permission.ACCESS_COARSE_LOCATION # since Android 6.0 (API lvl 23)
ANDROID_BUNDLED_JAR_DEPENDENCIES = \
jar/QtAndroidBluetooth-bundled.jar:org.qtproject.qt5.android.bluetooth.QtBluetoothBroadcastReceiver
ANDROID_JAR_DEPENDENCIES = \
@@ -199,7 +200,8 @@ config_bluez:qtHaveModule(dbus) {
SOURCES -= qlowenergycontroller.cpp
} else {
message("Unsupported Bluetooth platform, will not build a working QtBluetooth library.")
- message("Either no Qt D-Bus found or no BlueZ headers.")
+ message("Either no Qt D-Bus found or no BlueZ headers available.")
+ include(dummy/dummy.pri)
SOURCES += \
qbluetoothdevicediscoveryagent_p.cpp \
qbluetoothlocaldevice_p.cpp \
diff --git a/src/bluetooth/dummy/dummy.pri b/src/bluetooth/dummy/dummy.pri
new file mode 100644
index 00000000..49aa076c
--- /dev/null
+++ b/src/bluetooth/dummy/dummy.pri
@@ -0,0 +1,2 @@
+HEADERS += dummy/dummy_helper_p.h
+SOURCES += dummy/dummy_helper.cpp
diff --git a/src/bluetooth/dummy/dummy_helper.cpp b/src/bluetooth/dummy/dummy_helper.cpp
new file mode 100644
index 00000000..fc78ea2f
--- /dev/null
+++ b/src/bluetooth/dummy/dummy_helper.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtBluetooth module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QGlobalStatic>
+#include <QtCore/QLoggingCategory>
+
+#include "dummy_helper_p.h"
+
+QT_BEGIN_NAMESPACE
+
+Q_DECLARE_LOGGING_CATEGORY(QT_BT)
+
+Q_GLOBAL_STATIC_WITH_ARGS(bool, dummyWarningPrinted, (false))
+
+void printDummyWarning()
+{
+ if (!*dummyWarningPrinted()) {
+ qCWarning(QT_BT) << "Dummy backend running. Qt Bluetooth module is non-functional.";
+ *dummyWarningPrinted() = true;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/bluetooth/dummy/dummy_helper_p.h b/src/bluetooth/dummy/dummy_helper_p.h
new file mode 100644
index 00000000..f548ac36
--- /dev/null
+++ b/src/bluetooth/dummy/dummy_helper_p.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtBluetooth module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DUMMY_HELPER_H
+#define DUMMY_HELPER_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "QtCore/qglobal.h"
+
+QT_BEGIN_NAMESPACE
+
+void printDummyWarning();
+
+QT_END_NAMESPACE
+
+#endif // DUMMY_HELPER_H
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
index 6558a8f7..b6faee75 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
@@ -70,6 +70,8 @@ QT_BEGIN_NAMESPACE
of devices. However not every platform can detect both types of devices.
On platforms with this limitation (for example iOS only suports Low Energy discovery),
the discovery process will limit the search to the type which is supported.
+
+ \note Since Android 6.0 the ability to detect devices requires ACCESS_COARSE_LOCATION.
*/
/*!
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
index a232482f..09076d6d 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
@@ -42,6 +42,8 @@
#include "qbluetoothaddress.h"
#include "qbluetoothuuid.h"
+#include "dummy/dummy_helper_p.h"
+
#define QT_DEVICEDISCOVERY_DEBUG
QT_BEGIN_NAMESPACE
@@ -54,6 +56,7 @@ QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(
q_ptr(parent)
{
Q_UNUSED(deviceAdapter);
+ printDummyWarning();
}
QBluetoothDeviceDiscoveryAgentPrivate::~QBluetoothDeviceDiscoveryAgentPrivate()
diff --git a/src/bluetooth/qbluetoothlocaldevice.cpp b/src/bluetooth/qbluetoothlocaldevice.cpp
index 85177cf3..b2e2adcf 100644
--- a/src/bluetooth/qbluetoothlocaldevice.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice.cpp
@@ -175,6 +175,10 @@ bool QBluetoothLocalDevice::isValid() const
\fn QBluetoothLocalDevice::address() const
Returns the MAC address of this Bluetooth device.
+
+ \note On Android, this function always returns the constant
+ value \c {02:00:00:00:00:00} as local address starting with Android 6.0.
+ The programmatic access to the device's local MAC address was removed.
*/
/*!
diff --git a/src/bluetooth/qbluetoothlocaldevice_p.cpp b/src/bluetooth/qbluetoothlocaldevice_p.cpp
index b54027ef..efeeee5d 100644
--- a/src/bluetooth/qbluetoothlocaldevice_p.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice_p.cpp
@@ -41,6 +41,7 @@
#include "qbluetoothaddress.h"
#include "qbluetoothlocaldevice_p.h"
+#include "dummy/dummy_helper_p.h"
QT_BEGIN_NAMESPACE
@@ -48,6 +49,7 @@ QBluetoothLocalDevice::QBluetoothLocalDevice(QObject *parent) :
QObject(parent),
d_ptr(0)
{
+ printDummyWarning();
registerQBluetoothLocalDeviceMetaType();
}
diff --git a/src/bluetooth/qbluetoothserver_p.cpp b/src/bluetooth/qbluetoothserver_p.cpp
index 43d7fe9f..e12598fa 100644
--- a/src/bluetooth/qbluetoothserver_p.cpp
+++ b/src/bluetooth/qbluetoothserver_p.cpp
@@ -40,12 +40,14 @@
#include "qbluetoothserver.h"
#include "qbluetoothserver_p.h"
#include "qbluetoothsocket.h"
+#include "dummy/dummy_helper_p.h"
QT_BEGIN_NAMESPACE
QBluetoothServerPrivate::QBluetoothServerPrivate(QBluetoothServiceInfo::Protocol sType)
: maxPendingConnections(1), serverType(sType), m_lastError(QBluetoothServer::NoError)
{
+ printDummyWarning();
if (sType == QBluetoothServiceInfo::RfcommProtocol)
socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
else
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent.cpp b/src/bluetooth/qbluetoothservicediscoveryagent.cpp
index a3df47de..fa1aba9d 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent.cpp
@@ -217,7 +217,9 @@ QList<QBluetoothServiceInfo> QBluetoothServiceDiscoveryAgent::discoveredServices
}
/*!
Sets the UUID filter to \a uuids. Only services matching the UUIDs in \a uuids will be
- returned.
+ returned. The matching applies to the service's
+ \l {QBluetoothServiceInfo::ServiceId}{ServiceId} and \l {QBluetoothServiceInfo::ServiceClassIds} {ServiceClassIds}
+ attributes.
An empty UUID list is equivalent to a list containing only QBluetoothUuid::PublicBrowseGroup.
@@ -234,6 +236,9 @@ void QBluetoothServiceDiscoveryAgent::setUuidFilter(const QList<QBluetoothUuid>
This is an overloaded member function, provided for convenience.
Sets the UUID filter to a list containing the single element \a uuid.
+ The matching applies to the service's \l {QBluetoothServiceInfo::ServiceId}{ServiceId}
+ and \l {QBluetoothServiceInfo::ServiceClassIds} {ServiceClassIds}
+ attributes.
\sa uuidFilter()
*/
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp
index f7e09957..fe3fd75f 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp
@@ -39,6 +39,7 @@
#include "qbluetoothservicediscoveryagent.h"
#include "qbluetoothservicediscoveryagent_p.h"
+#include "dummy/dummy_helper_p.h"
QT_BEGIN_NAMESPACE
@@ -47,6 +48,7 @@ QBluetoothServiceDiscoveryAgentPrivate::QBluetoothServiceDiscoveryAgentPrivate(c
deviceDiscoveryAgent(0), mode(QBluetoothServiceDiscoveryAgent::MinimalDiscovery),
singleDevice(false)
{
+ printDummyWarning();
Q_UNUSED(deviceAdapter);
}
diff --git a/src/bluetooth/qbluetoothserviceinfo.cpp b/src/bluetooth/qbluetoothserviceinfo.cpp
index 4ff028b7..d2920d78 100644
--- a/src/bluetooth/qbluetoothserviceinfo.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo.cpp
@@ -543,81 +543,89 @@ QBluetoothServiceInfo &QBluetoothServiceInfo::operator=(const QBluetoothServiceI
return *this;
}
-static void dumpAttributeVariant(const QVariant &var, const QString indent)
+static void dumpAttributeVariant(QDebug dbg, const QVariant &var, const QString& indent)
{
switch (int(var.type())) {
case QMetaType::Void:
- qDebug("%sEmpty", indent.toLocal8Bit().constData());
+ dbg << QString::asprintf("%sEmpty\n", indent.toUtf8().constData());
break;
case QMetaType::UChar:
- qDebug("%suchar %u", indent.toLocal8Bit().constData(), var.toUInt());
+ dbg << QString::asprintf("%suchar %u\n", indent.toUtf8().constData(), var.toUInt());
break;
case QMetaType::UShort:
- qDebug("%sushort %u", indent.toLocal8Bit().constData(), var.toUInt());
+ dbg << QString::asprintf("%sushort %u\n", indent.toUtf8().constData(), var.toUInt());
break;
case QMetaType::UInt:
- qDebug("%suint %u", indent.toLocal8Bit().constData(), var.toUInt());
+ dbg << QString::asprintf("%suint %u\n", indent.toUtf8().constData(), var.toUInt());
break;
case QMetaType::Char:
- qDebug("%schar %d", indent.toLocal8Bit().constData(), var.toInt());
+ dbg << QString::asprintf("%schar %d\n", indent.toUtf8().constData(), var.toInt());
break;
case QMetaType::Short:
- qDebug("%sshort %d", indent.toLocal8Bit().constData(), var.toInt());
+ dbg << QString::asprintf("%sshort %d\n", indent.toUtf8().constData(), var.toInt());
break;
case QMetaType::Int:
- qDebug("%sint %d", indent.toLocal8Bit().constData(), var.toInt());
+ dbg << QString::asprintf("%sint %d\n", indent.toUtf8().constData(), var.toInt());
break;
case QMetaType::QString:
- qDebug("%sstring %s", indent.toLocal8Bit().constData(), var.toString().toLocal8Bit().constData());
+ dbg << QString::asprintf("%sstring %s\n", indent.toUtf8().constData(),
+ var.toString().toUtf8().constData());
break;
case QMetaType::Bool:
- qDebug("%sbool %d", indent.toLocal8Bit().constData(), var.toBool());
+ dbg << QString::asprintf("%sbool %d\n", indent.toUtf8().constData(), var.toBool());
break;
case QMetaType::QUrl:
- qDebug("%surl %s", indent.toLocal8Bit().constData(), var.toUrl().toString().toLocal8Bit().constData());
+ dbg << QString::asprintf("%surl %s\n", indent.toUtf8().constData(),
+ var.toUrl().toString().toUtf8().constData());
break;
case QVariant::UserType:
if (var.userType() == qMetaTypeId<QBluetoothUuid>()) {
QBluetoothUuid uuid = var.value<QBluetoothUuid>();
switch (uuid.minimumSize()) {
case 0:
- qDebug("%suuid NULL", indent.toLocal8Bit().constData());
+ dbg << QString::asprintf("%suuid NULL\n", indent.toUtf8().constData());
break;
case 2:
- qDebug("%suuid %04x", indent.toLocal8Bit().constData(), uuid.toUInt16());
+ dbg << QString::asprintf("%suuid2 %04x\n", indent.toUtf8().constData(),
+ uuid.toUInt16());
break;
case 4:
- qDebug("%suuid %08x", indent.toLocal8Bit().constData(), uuid.toUInt32());
+ dbg << QString::asprintf("%suuid %08x\n", indent.toUtf8().constData(),
+ uuid.toUInt32());
break;
case 16:
- qDebug("%suuid %s", indent.toLocal8Bit().constData(), QByteArray(reinterpret_cast<const char *>(uuid.toUInt128().data), 16).toHex().constData());
+ dbg << QString::asprintf("%suuid %s\n",
+ indent.toUtf8().constData(),
+ QByteArray(reinterpret_cast<const char *>(uuid.toUInt128().data), 16).toHex().constData());
break;
default:
- qDebug("%suuid ???", indent.toLocal8Bit().constData());
- ;
+ dbg << QString::asprintf("%suuid ???\n", indent.toUtf8().constData());
}
} else if (var.userType() == qMetaTypeId<QBluetoothServiceInfo::Sequence>()) {
- qDebug("%sSequence", indent.toLocal8Bit().constData());
+ dbg << QString::asprintf("%sSequence\n", indent.toUtf8().constData());
const QBluetoothServiceInfo::Sequence *sequence = static_cast<const QBluetoothServiceInfo::Sequence *>(var.data());
foreach (const QVariant &v, *sequence)
- dumpAttributeVariant(v, indent + QLatin1Char('\t'));
+ dumpAttributeVariant(dbg, v, indent + QLatin1Char('\t'));
} else if (var.userType() == qMetaTypeId<QBluetoothServiceInfo::Alternative>()) {
- qDebug("%sAlternative", indent.toLocal8Bit().constData());
+ dbg << QString::asprintf("%sAlternative\n", indent.toUtf8().constData());
const QBluetoothServiceInfo::Alternative *alternative = static_cast<const QBluetoothServiceInfo::Alternative *>(var.data());
foreach (const QVariant &v, *alternative)
- dumpAttributeVariant(v, indent + QLatin1Char('\t'));
+ dumpAttributeVariant(dbg, v, indent + QLatin1Char('\t'));
}
break;
default:
- qDebug("%sunknown variant type %d", indent.toLocal8Bit().constData(), var.userType());
+ dbg << QString::asprintf("%sunknown variant type %d\n", indent.toUtf8().constData(),
+ var.userType());
}
}
QDebug operator<<(QDebug dbg, const QBluetoothServiceInfo &info)
{
+ QDebugStateSaver saver(dbg);
+ dbg.noquote() << "\n";
foreach (quint16 id, info.attributes()) {
- dumpAttributeVariant(info.attribute(id), QString::fromLatin1("(%1)\t").arg(id));
+ dumpAttributeVariant(dbg, info.attribute(id), QString::fromLatin1("(%1)\t").arg(id));
}
return dbg;
}
diff --git a/src/bluetooth/qbluetoothserviceinfo_p.cpp b/src/bluetooth/qbluetoothserviceinfo_p.cpp
index 716876be..00e38ba2 100644
--- a/src/bluetooth/qbluetoothserviceinfo_p.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo_p.cpp
@@ -39,11 +39,13 @@
#include "qbluetoothserviceinfo.h"
#include "qbluetoothserviceinfo_p.h"
+#include "dummy/dummy_helper_p.h"
QT_BEGIN_NAMESPACE
QBluetoothServiceInfoPrivate::QBluetoothServiceInfoPrivate()
{
+ printDummyWarning();
}
QBluetoothServiceInfoPrivate::~QBluetoothServiceInfoPrivate()
diff --git a/src/bluetooth/qbluetoothsocket.cpp b/src/bluetooth/qbluetoothsocket.cpp
index bb8e6512..8504ebd9 100644
--- a/src/bluetooth/qbluetoothsocket.cpp
+++ b/src/bluetooth/qbluetoothsocket.cpp
@@ -354,7 +354,8 @@ void QBluetoothSocket::connectToService(const QBluetoothServiceInfo &service, Op
d->connectToService(service.device().address(), service.serverChannel(), openMode);
} else {
// try doing service discovery to see if we can find the socket
- if(service.serviceUuid().isNull()){
+ if (service.serviceUuid().isNull()
+ && !service.serviceClassUuids().contains(QBluetoothUuid::SerialPort)) {
qCWarning(QT_BT) << "No port, no PSM, and no UUID provided, unable to connect";
return;
}
@@ -599,7 +600,7 @@ void QBluetoothSocket::doDeviceDiscovery(const QBluetoothServiceInfo &service, O
Q_D(QBluetoothSocket);
setSocketState(QBluetoothSocket::ServiceLookupState);
- qCDebug(QT_BT) << "Starting discovery";
+ qCDebug(QT_BT) << "Starting Bluetooth Socket discovery";
if(d->discoveryAgent) {
d->discoveryAgent->stop();
@@ -616,11 +617,12 @@ void QBluetoothSocket::doDeviceDiscovery(const QBluetoothServiceInfo &service, O
d->openMode = openMode;
+ QList<QBluetoothUuid> filterUuids = service.serviceClassUuids();
if(!service.serviceUuid().isNull())
- d->discoveryAgent->setUuidFilter(service.serviceUuid());
+ filterUuids.append(service.serviceUuid());
- if(!service.serviceClassUuids().isEmpty())
- d->discoveryAgent->setUuidFilter(service.serviceClassUuids());
+ if (!filterUuids.isEmpty())
+ d->discoveryAgent->setUuidFilter(filterUuids);
// we have to ID the service somehow
Q_ASSERT(!d->discoveryAgent->uuidFilter().isEmpty());
diff --git a/src/bluetooth/qbluetoothsocket_p.cpp b/src/bluetooth/qbluetoothsocket_p.cpp
index c05846c3..f61f3d87 100644
--- a/src/bluetooth/qbluetoothsocket_p.cpp
+++ b/src/bluetooth/qbluetoothsocket_p.cpp
@@ -39,6 +39,7 @@
#include "qbluetoothsocket.h"
#include "qbluetoothsocket_p.h"
+#include "dummy/dummy_helper_p.h"
QT_BEGIN_NAMESPACE
@@ -49,6 +50,7 @@ QBluetoothSocketPrivate::QBluetoothSocketPrivate()
socketError(QBluetoothSocket::NoSocketError),
secFlags(QBluetooth::NoSecurity)
{
+ printDummyWarning();
}
QBluetoothSocketPrivate::~QBluetoothSocketPrivate()
diff --git a/src/bluetooth/qbluetoothtransfermanager.cpp b/src/bluetooth/qbluetoothtransfermanager.cpp
index 34d972f0..f4720564 100644
--- a/src/bluetooth/qbluetoothtransfermanager.cpp
+++ b/src/bluetooth/qbluetoothtransfermanager.cpp
@@ -44,6 +44,8 @@
#include "qbluetoothtransferreply_bluez_p.h"
#elif QT_OSX_BLUETOOTH
#include "qbluetoothtransferreply_osx_p.h"
+#else
+#include "dummy/dummy_helper_p.h"
#endif
QT_BEGIN_NAMESPACE
@@ -117,6 +119,10 @@ QBluetoothTransferReply *QBluetoothTransferManager::put(const QBluetoothTransfer
connect(reply, SIGNAL(finished(QBluetoothTransferReply*)), this, SIGNAL(finished(QBluetoothTransferReply*)));
return reply;
#else
+ // Android and iOS have no implementation
+#if !defined(QT_ANDROID_BLUETOOTH) && !defined(QT_IOS_BLUETOOTH)
+ printDummyWarning();
+#endif
Q_UNUSED(request);
Q_UNUSED(data);
return 0;
diff --git a/src/bluetooth/qbluetoothuuid.cpp b/src/bluetooth/qbluetoothuuid.cpp
index 3d9ab504..bc00aa95 100644
--- a/src/bluetooth/qbluetoothuuid.cpp
+++ b/src/bluetooth/qbluetoothuuid.cpp
@@ -608,9 +608,12 @@ QT_WARNING_POP
}
/*!
- Constructs a new Bluetooth UUID from the \a uuid string.
-
- The string must be in the form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
+ Creates a QBluetoothUuid object from the string \a uuid,
+ which must be formatted as five hex fields separated by '-',
+ e.g., "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where 'x' is a hex digit.
+ The curly braces shown here are optional, but it is normal to include them.
+ If the conversion fails, a null UUID is created. See \l QUuid::toString() for an
+ explanation of how the five hex fields map to the public data members in QUuid.
*/
QBluetoothUuid::QBluetoothUuid(const QString &uuid)
: QUuid(uuid)
diff --git a/src/bluetooth/qlowenergycontroller_p.cpp b/src/bluetooth/qlowenergycontroller_p.cpp
index 6d42984e..149b6adf 100644
--- a/src/bluetooth/qlowenergycontroller_p.cpp
+++ b/src/bluetooth/qlowenergycontroller_p.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qlowenergycontroller_p.h"
+#include "dummy/dummy_helper_p.h"
QT_BEGIN_NAMESPACE
@@ -47,6 +48,7 @@ QLowEnergyControllerPrivate::QLowEnergyControllerPrivate()
error(QLowEnergyController::NoError),
lastLocalHandle(0)
{
+ printDummyWarning();
registerQLowEnergyControllerMetaType();
}