summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/bluetooth/btscanner/service.cpp11
-rw-r--r--examples/bluetooth/btscanner/service.h3
-rw-r--r--examples/bluetooth/lowenergyscanner/device.h1
-rw-r--r--src/bluetooth/bluetooth.pro3
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent.cpp27
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent.h2
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp66
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_p.h3
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp26
-rw-r--r--src/bluetooth/qlowenergyserviceinfo.cpp172
-rw-r--r--src/bluetooth/qlowenergyserviceinfo.h73
-rw-r--r--src/bluetooth/qlowenergyserviceinfo_p.h50
-rw-r--r--tests/auto/auto.pro1
-rw-r--r--tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp30
-rw-r--r--tests/auto/qlowenergyserviceinfo/qlowenergyserviceinfo.pro9
-rw-r--r--tests/auto/qlowenergyserviceinfo/tst_qlowenergyserviceinfo.cpp243
-rw-r--r--tests/bttestui/btlocaldevice.cpp8
-rw-r--r--tests/bttestui/btlocaldevice.h1
18 files changed, 68 insertions, 661 deletions
diff --git a/examples/bluetooth/btscanner/service.cpp b/examples/bluetooth/btscanner/service.cpp
index d24837eb..c886c901 100644
--- a/examples/bluetooth/btscanner/service.cpp
+++ b/examples/bluetooth/btscanner/service.cpp
@@ -45,7 +45,6 @@
#include <qbluetoothservicediscoveryagent.h>
#include <qbluetoothserviceinfo.h>
#include <qbluetoothlocaldevice.h>
-#include <qlowenergyserviceinfo.h>
#include <qbluetoothuuid.h>
@@ -77,8 +76,6 @@ ServiceDiscoveryDialog::ServiceDiscoveryDialog(const QString &name,
connect(discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)),
this, SLOT(addService(QBluetoothServiceInfo)));
connect(discoveryAgent, SIGNAL(finished()), ui->status, SLOT(hide()));
- connect(discoveryAgent, SIGNAL(serviceDiscovered(const QLowEnergyServiceInfo&)),
- this, SLOT(addLowEnergyService(const QLowEnergyServiceInfo&)));
discoveryAgent->start();
}
@@ -102,11 +99,3 @@ void ServiceDiscoveryDialog::addService(const QBluetoothServiceInfo &info)
ui->list->addItem(line);
}
-
-void ServiceDiscoveryDialog::addLowEnergyService(const QLowEnergyServiceInfo &gatt)
-{
- QString line = gatt.serviceName();
-
- ui->list->addItem(line);
-}
-
diff --git a/examples/bluetooth/btscanner/service.h b/examples/bluetooth/btscanner/service.h
index 2089eb87..293bc7a9 100644
--- a/examples/bluetooth/btscanner/service.h
+++ b/examples/bluetooth/btscanner/service.h
@@ -49,8 +49,6 @@
QT_FORWARD_DECLARE_CLASS(QBluetoothAddress)
QT_FORWARD_DECLARE_CLASS(QBluetoothServiceInfo)
QT_FORWARD_DECLARE_CLASS(QBluetoothServiceDiscoveryAgent)
-QT_FORWARD_DECLARE_CLASS (QLowEnergyServiceInfo)
-QT_FORWARD_DECLARE_CLASS (QLowEnergyCharacteristicInfo)
QT_USE_NAMESPACE
@@ -64,7 +62,6 @@ public:
public slots:
void addService(const QBluetoothServiceInfo&);
- void addLowEnergyService(const QLowEnergyServiceInfo&);
private:
QBluetoothServiceDiscoveryAgent *discoveryAgent;
diff --git a/examples/bluetooth/lowenergyscanner/device.h b/examples/bluetooth/lowenergyscanner/device.h
index 97a52b26..09b32599 100644
--- a/examples/bluetooth/lowenergyscanner/device.h
+++ b/examples/bluetooth/lowenergyscanner/device.h
@@ -55,7 +55,6 @@
#include "characteristicinfo.h"
QT_FORWARD_DECLARE_CLASS (QBluetoothDeviceInfo)
-QT_FORWARD_DECLARE_CLASS (QLowEnergyServiceInfo)
QT_FORWARD_DECLARE_CLASS (QBluetoothServiceInfo)
class Device: public QObject
diff --git a/src/bluetooth/bluetooth.pro b/src/bluetooth/bluetooth.pro
index 719d7ed5..af0d96f0 100644
--- a/src/bluetooth/bluetooth.pro
+++ b/src/bluetooth/bluetooth.pro
@@ -23,7 +23,6 @@ PUBLIC_HEADERS += \
qbluetoothlocaldevice.h \
qbluetoothtransfermanager.h \
qbluetoothtransferrequest.h \
- qlowenergyserviceinfo.h \
qlowenergyservice.h \
qlowenergycharacteristic.h \
qlowenergydescriptor.h \
@@ -43,7 +42,6 @@ PRIVATE_HEADERS += \
qbluetoothtransferrequest_p.h \
qprivatelinearbuffer_p.h \
qbluetoothlocaldevice_p.h \
- qlowenergyserviceinfo_p.h \
qlowenergycontroller_p.h \
qlowenergyserviceprivate_p.h
@@ -62,7 +60,6 @@ SOURCES += \
qbluetoothtransfermanager.cpp \
qbluetoothtransferrequest.cpp \
qbluetoothtransferreply.cpp \
- qlowenergyserviceinfo.cpp \
qlowenergyservice.cpp \
qlowenergycharacteristic.cpp \
qlowenergydescriptor.cpp \
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent.cpp b/src/bluetooth/qbluetoothservicediscoveryagent.cpp
index 4c752356..57c7c2b3 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent.cpp
@@ -46,7 +46,10 @@ QT_BEGIN_NAMESPACE
\brief The QBluetoothServiceDiscoveryAgent class enables you to query for
Bluetooth services.
- To query the services provided by all contactable Bluetooth devices:
+ The discovery process relies on the Bluetooth Service Discovery Process (SDP).
+ The following steps are required to query the services provided by all contactable
+ Bluetooth devices:
+
\list
\li create an instance of QBluetoothServiceDiscoveryAgent,
\li connect to either the serviceDiscovered() or finished() signals,
@@ -55,16 +58,22 @@ QT_BEGIN_NAMESPACE
\snippet doc_src_qtbluetooth.cpp service_discovery
- By default a minimal service discovery is performed. In this mode, the QBluetotohServiceInfo
- objects returned are guaranteed to contain only device and service UUID information. Depending
+ By default a minimal service discovery is performed. In this mode, the returned \l QBluetoothServiceInfo
+ objects are guaranteed to contain only device and service UUID information. Depending
on platform and device capabilities, other service information may also be available. For most
use cases this is adequate as QBluetoothSocket::connectToService() will perform additional
- discovery if required. If full service information is required, pass \l FullDiscovery as the
+ discovery if required. If the full service information is required, pass \l FullDiscovery as the
discoveryMode parameter to start().
This class may internally utilize \l QBluetoothDeviceDiscoveryAgent to find unknown devices.
- \sa QBluetoothDeviceDiscoveryAgent
+ The service discovery may find Bluetooth Low Energy services too if the target device
+ is a combination of a classic and Low Energy device. Those devices are required to advertise
+ their Low Energy services via SDP. If the target device only supports Bluetooth Low
+ Energy services, it is likely to not advertise them via SDP. The \l QLowEnergyController class
+ should be utilized to perform the service discovery on Low Energy devices.
+
+ \sa QBluetoothDeviceDiscoveryAgent, QLowEnergyController
*/
/*!
@@ -94,12 +103,12 @@ QT_BEGIN_NAMESPACE
\fn QBluetoothServiceDiscoveryAgent::serviceDiscovered(const QBluetoothServiceInfo &info)
This signal is emitted when the Bluetooth service described by \a info is discovered.
-*/
-/*!
- \fn QBluetoothServiceDiscoveryAgent::serviceDiscovered(const QLowEnergyServiceInfo &info)
+ \note The passed \l QBluetoothServiceInfo parameter may contain a Bluetooth Low Energy
+ service if the target device advertises the service via SDP. This is required from device
+ which support both, classic Bluetooth (BaseRate) and Low Energy services.
- This signal is emitted when the Bluetooth Low Energy service described by \a info is discovered.
+ \sa QBluetoothDeviceInfo::coreConfigurations()
*/
/*!
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent.h b/src/bluetooth/qbluetoothservicediscoveryagent.h
index 947dfde8..5e47ada0 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent.h
+++ b/src/bluetooth/qbluetoothservicediscoveryagent.h
@@ -41,7 +41,6 @@
#include <QtBluetooth/QBluetoothServiceInfo>
#include <QtBluetooth/QBluetoothUuid>
#include <QtBluetooth/QBluetoothDeviceDiscoveryAgent>
-#include <QtBluetooth/QLowEnergyServiceInfo>
QT_BEGIN_NAMESPACE
@@ -93,7 +92,6 @@ public Q_SLOTS:
Q_SIGNALS:
void serviceDiscovered(const QBluetoothServiceInfo &info);
- void serviceDiscovered(const QLowEnergyServiceInfo &info);
void finished();
void canceled();
void error(QBluetoothServiceDiscoveryAgent::Error error);
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
index f3b14d4d..fb956c9e 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
@@ -33,7 +33,6 @@
#include "qbluetoothservicediscoveryagent.h"
#include "qbluetoothservicediscoveryagent_p.h"
-#include "qlowenergyserviceinfo_p.h"
#include "bluez/manager_p.h"
#include "bluez/adapter_p.h"
@@ -300,8 +299,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_finishSdpScan(QBluetoothServiceD
emit q->error(error);
} else if (!xmlRecords.isEmpty() && discoveryState() != Inactive) {
foreach (const QString &record, xmlRecords) {
- bool isBtleService = false;
- const QBluetoothServiceInfo serviceInfo = parseServiceXml(record, &isBtleService);
+ const QBluetoothServiceInfo serviceInfo = parseServiceXml(record);
//apply uuidFilter
if (!uuidFilter.isEmpty()) {
@@ -436,19 +434,31 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_createdDevice(QDBusPendingCallWa
b = b.remove(QLatin1Char('{')).remove(QLatin1Char('}'));
const QBluetoothUuid uuid(b);
- qCDebug(QT_BT_BLUEZ) << "Discovered BLE service" << uuid << uuidFilter.size();
- QLowEnergyServiceInfo lowEnergyService(uuid);
- lowEnergyService.setDevice(discoveredDevices.at(0));
+ qCDebug(QT_BT_BLUEZ) << "Discovered service" << uuid << uuidFilter.size();
+ QBluetoothServiceInfo service;
+ service.setDevice(discoveredDevices.at(0));
+ bool ok = false;
+ quint16 serviceClass = uuid.toUInt16(&ok);
+ if (ok)
+ service.setServiceName(QBluetoothUuid::serviceClassToString(
+ static_cast<QBluetoothUuid::ServiceClassUuid>(serviceClass)));
+
+ QBluetoothServiceInfo::Sequence classId;
+ classId << QVariant::fromValue(uuid);
+ service.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId);
+
+ QBluetoothServiceInfo::Sequence protocolDescriptorList;
+ protocolDescriptorList << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap));
+ service.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList);
+
if (uuidFilter.isEmpty())
- emit q->serviceDiscovered(lowEnergyService);
+ emit q->serviceDiscovered(service);
else {
for (int j = 0; j < uuidFilter.size(); j++) {
if (uuidFilter.at(j) == uuid)
- emit q->serviceDiscovered(lowEnergyService);
-
+ emit q->serviceDiscovered(service);
}
}
-
}
if (singleDevice && deviceReply.isError()) {
@@ -503,14 +513,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_discoveredServices(QDBusPendingC
foreach (const QString &record, reply.value()) {
- bool isBtleService = false;
- QBluetoothServiceInfo serviceInfo = parseServiceXml(record, &isBtleService);
-
- if (isBtleService) {
- qCDebug(QT_BT_BLUEZ) << "Discovered BLE services" << discoveredDevices.at(0).address().toString()
- << serviceInfo.serviceName() << serviceInfo.serviceUuid() << serviceInfo.serviceClassUuids();
- continue;
- }
+ QBluetoothServiceInfo serviceInfo = parseServiceXml(record);
if (!serviceInfo.isValid())
continue;
@@ -554,7 +557,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_discoveredServices(QDBusPendingC
}
QBluetoothServiceInfo QBluetoothServiceDiscoveryAgentPrivate::parseServiceXml(
- const QString& xmlRecord, bool *isBtleService)
+ const QString& xmlRecord)
{
QXmlStreamReader xml(xmlRecord);
@@ -570,25 +573,7 @@ QBluetoothServiceInfo QBluetoothServiceDiscoveryAgentPrivate::parseServiceXml(
xml.attributes().value(QLatin1String("id")).toString().toUShort(0, 0);
if (xml.readNextStartElement()) {
- QVariant value = readAttributeValue(xml);
- if (isBtleService) {
- if (attributeId == 1) {// Attribute with id 1 contains UUID of the service
- const QBluetoothServiceInfo::Sequence seq =
- value.value<QBluetoothServiceInfo::Sequence>();
- for (int i = 0; i < seq.count(); i++) {
- const QBluetoothUuid uuid = seq.at(i).value<QBluetoothUuid>();
- if ((uuid.data1 & 0x1800) == 0x1800) {// We are taking into consideration that LE services starts at 0x1800
- //TODO don't emit in the middle of nowhere
- Q_Q(QBluetoothServiceDiscoveryAgent);
- QLowEnergyServiceInfo leService(uuid);
- leService.setDevice(discoveredDevices.at(0));
- *isBtleService = true;
- emit q->serviceDiscovered(leService);
- break;
- }
- }
- }
- }
+ const QVariant value = readAttributeValue(xml);
serviceInfo.setAttribute(attributeId, value);
}
}
@@ -655,7 +640,6 @@ void QBluetoothServiceDiscoveryAgentPrivate::performMinimalServiceDiscovery(cons
if (!uuidFilter.isEmpty() && !uuidFilter.contains(uuid))
continue;
- // TODO deal with BTLE services under Bluez 5 -> right now they are normal services
QBluetoothServiceInfo serviceInfo;
serviceInfo.setDevice(discoveredDevices.at(0));
@@ -672,6 +656,10 @@ void QBluetoothServiceDiscoveryAgentPrivate::performMinimalServiceDiscovery(cons
serviceInfo.setServiceName(QBluetoothUuid::serviceClassToString(clsId));
}
+ QBluetoothServiceInfo::Sequence protocolDescriptorList;
+ protocolDescriptorList << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap));
+ serviceInfo.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList);
+
//don't include the service if we already discovered it before
if (!isDuplicatedService(serviceInfo)) {
discoveredServices << serviceInfo;
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_p.h b/src/bluetooth/qbluetoothservicediscoveryagent_p.h
index b027033e..ea985627 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_p.h
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_p.h
@@ -49,7 +49,6 @@
#include "qbluetoothdeviceinfo.h"
#include "qbluetoothserviceinfo.h"
#include "qbluetoothservicediscoveryagent.h"
-#include "qlowenergyserviceinfo.h"
#include <QStack>
#include <QStringList>
@@ -151,7 +150,7 @@ private:
void runSdpScan(const QBluetoothAddress &remoteAddress,
const QBluetoothAddress localAddress);
QVariant readAttributeValue(QXmlStreamReader &xml);
- QBluetoothServiceInfo parseServiceXml(const QString& xml, bool *isBtleService);
+ QBluetoothServiceInfo parseServiceXml(const QString& xml);
void performMinimalServiceDiscovery(const QBluetoothAddress &deviceAddress);
#endif
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp
index 04c25fdc..4ed62c25 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp
@@ -37,8 +37,6 @@
#include "qbluetoothdeviceinfo.h"
#include "qbluetoothdevicediscoveryagent.h"
-#include "qlowenergyserviceinfo_p.h"
-
#include <QStringList>
#include "qbluetoothuuid.h"
#include <stdio.h>
@@ -345,9 +343,29 @@ void QBluetoothServiceDiscoveryAgentPrivate::remoteDevicesChanged(int fd)
leUuid = QBluetoothUuid(lowEnergyUuid.toUShort(0,0));
}
- QLowEnergyServiceInfo lowEnergyService(leUuid);
+ //Check if the UUID is in the uuidFilter
+ if (!uuidFilter.isEmpty() && !uuidFilter.contains(leUuid))
+ continue;
+
+ QBluetoothServiceInfo lowEnergyService;
lowEnergyService.setDevice(discoveredDevices.at(0));
- qCDebug(QT_BT_QNX) << "Adding Low Energy service" << lowEnergyService.serviceUuid();
+
+ bool ok = false;
+ quint16 serviceClass = leUuid.toUInt16(&ok);
+ if (ok)
+ lowEnergyService.setServiceName(QBluetoothUuid::serviceClassToString(
+ static_cast<QBluetoothUuid::ServiceClassUuid>(serviceClass)));
+
+ QBluetoothServiceInfo::Sequence classId;
+ classId << QVariant::fromValue(leUuid);
+ lowEnergyService.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId);
+
+ QBluetoothServiceInfo::Sequence protocolDescriptorList;
+ protocolDescriptorList << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap));
+ service.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList);
+
+ qCDebug(QT_BT_QNX) << "Adding Low Energy service" << leUuid;
+
q_ptr->serviceDiscovered(lowEnergyService);
}
diff --git a/src/bluetooth/qlowenergyserviceinfo.cpp b/src/bluetooth/qlowenergyserviceinfo.cpp
deleted file mode 100644
index e5956e25..00000000
--- a/src/bluetooth/qlowenergyserviceinfo.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2013 BlackBerry Limited all rights reserved
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qlowenergyserviceinfo.h"
-#include "qlowenergyserviceinfo_p.h"
-#include <QtCore/QCoreApplication>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QLowEnergyServiceInfo
- \inmodule QtBluetooth
- \brief The QLowEnergyServiceInfo class stores information about the Bluetooth
- Low Energy service.
- \since 5.4
-
- QLowEnergyServiceInfo provides information about a Bluetooth Low Energy
- service's name, device, UUID, connection status, service type, handle
- and characteristics. A Bluetooth Low Energy device can have one or more
- low energy services. Each low energy service contains one or more
- characteristics. The class is used with the QLowEnergyController
- class. It is necessary to connect to the service first in order
- to get the all service information and characteristics.
-*/
-
-/*!
- \enum QLowEnergyServiceInfo::ServiceType
-
- This enum describes the type of the service. One LE device can have one or more primary services.
-
- \value PrimaryService The primary service. The primary service can have one or
- more included services.
- \value IncludedService The included service by primary services.
-*/
-
-/*!
- Construct a new QLowEnergyServiceInfo.
-*/
-QLowEnergyServiceInfo::QLowEnergyServiceInfo():
- d_ptr(QSharedPointer<QLowEnergyServiceInfoPrivate>(new QLowEnergyServiceInfoPrivate))
-{
-
-}
-
-/*!
- Construct a new QLowEnergyServiceInfo object with the given \a uuid.
-
- Based on uuid, corresponsing service name is given.
-*/
-QLowEnergyServiceInfo::QLowEnergyServiceInfo(const QBluetoothUuid &uuid):
- d_ptr(QSharedPointer<QLowEnergyServiceInfoPrivate>(new QLowEnergyServiceInfoPrivate))
-{
- d_ptr->uuid = QBluetoothUuid(uuid);
-}
-
-/*!
- Construct a new QLowEnergyServiceInfo that is a copy of \a other.
-
- The two copies continue to share the same underlying data which does not detach
- upon write.
-*/
-QLowEnergyServiceInfo::QLowEnergyServiceInfo(const QLowEnergyServiceInfo &other):
- d_ptr(other.d_ptr)
-{
-
-}
-
-/*!
- Destroys the QLowEnergyServiceInfo object.
-*/
-QLowEnergyServiceInfo::~QLowEnergyServiceInfo()
-{
-
-}
-
-/*!
- Returns the gatt service uuid.
-*/
-QBluetoothUuid QLowEnergyServiceInfo::serviceUuid() const
-{
- return d_ptr->uuid;
-}
-
-/*!
- Returns the service name.
-*/
-QString QLowEnergyServiceInfo::serviceName() const
-{
- bool ok = false;
- quint16 clsId = d_ptr->uuid.toUInt16(&ok);
- if (ok) {
- QBluetoothUuid::ServiceClassUuid id
- = static_cast<QBluetoothUuid::ServiceClassUuid>(clsId);
- return QBluetoothUuid::serviceClassToString(id);
- }
- return qApp ?
- qApp->translate("QBluetoothServiceDiscoveryAgent", "Unknown Service") :
- QStringLiteral("Unknown Service");
-}
-
-/*!
- Returns a copy of \a other and assigns it to this QLowEnergyServiceInfo object.
- The two copies continue to share the same service and registration details.
-*/
-QLowEnergyServiceInfo &QLowEnergyServiceInfo::operator=(const QLowEnergyServiceInfo &other)
-{
- d_ptr = other.d_ptr;
- return *this;
-}
-
-/*!
- Returns the address of the Bluetooth device that provides this service.
-*/
-QBluetoothDeviceInfo QLowEnergyServiceInfo::device() const
-{
- return d_ptr->deviceInfo;
-}
-
-/*!
- Sets the Bluetooth device that provides this service to \a device.
-*/
-void QLowEnergyServiceInfo::setDevice(const QBluetoothDeviceInfo &device)
-{
- d_ptr->deviceInfo = device;
-}
-
-/*!
- Returns true if the QLowEnergyServiceInfo object is valid, otherwise returns false.
-*/
-bool QLowEnergyServiceInfo::isValid() const
-{
- if (d_ptr->uuid == QBluetoothUuid())
- return false;
- if (!d_ptr->deviceInfo.isValid())
- return false;
- return true;
-}
-
-QT_END_NAMESPACE
-
-
diff --git a/src/bluetooth/qlowenergyserviceinfo.h b/src/bluetooth/qlowenergyserviceinfo.h
deleted file mode 100644
index cfe1e4d6..00000000
--- a/src/bluetooth/qlowenergyserviceinfo.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2013 BlackBerry Limited all rights reserved
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QLOWENERGYSERVICEINFO_H
-#define QLOWENERGYSERVICEINFO_H
-#include <QtCore/QSharedPointer>
-#include <QtBluetooth/QBluetoothAddress>
-#include <QtBluetooth/QBluetoothDeviceInfo>
-#include <QtBluetooth/QBluetoothUuid>
-
-QT_BEGIN_NAMESPACE
-
-class QLowEnergyServiceInfoPrivate;
-
-class Q_BLUETOOTH_EXPORT QLowEnergyServiceInfo
-{
-public:
- QLowEnergyServiceInfo();
- QLowEnergyServiceInfo(const QBluetoothUuid &uuid);
- QLowEnergyServiceInfo(const QLowEnergyServiceInfo &other);
-
- ~QLowEnergyServiceInfo();
-
- QLowEnergyServiceInfo &operator=(const QLowEnergyServiceInfo &other);
-
- void setDevice(const QBluetoothDeviceInfo &info);
- QBluetoothDeviceInfo device() const;
-
- QBluetoothUuid serviceUuid() const;
-
- QString serviceName() const;
-
- bool isValid() const;
-
-protected:
- QSharedPointer<QLowEnergyServiceInfoPrivate> d_ptr;
-
-};
-
-QT_END_NAMESPACE
-
-#endif // QLOWENERGYSERVICEINFO_H
diff --git a/src/bluetooth/qlowenergyserviceinfo_p.h b/src/bluetooth/qlowenergyserviceinfo_p.h
deleted file mode 100644
index ad372339..00000000
--- a/src/bluetooth/qlowenergyserviceinfo_p.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2013 BlackBerry Limited all rights reserved
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QLOWENERGYSERVICEINFO_P_H
-#define QLOWENERGYSERVICEINFO_P_H
-#include "qlowenergyserviceinfo.h"
-
-QT_BEGIN_NAMESPACE
-
-class QLowEnergyServiceInfoPrivate
-{
-public:
- QBluetoothUuid uuid;
- QBluetoothDeviceInfo deviceInfo;
-};
-
-QT_END_NAMESPACE
-
-#endif // QLOWENERGYSERVICEINFO_P_H
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 8966e5d9..a5e66030 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -19,7 +19,6 @@ qtHaveModule(bluetooth) {
qbluetoothserver \
qlowenergycharacteristic \
qlowenergydescriptor \
- qlowenergyserviceinfo \
qlowenergycontroller
}
diff --git a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
index 253ca50a..5e832f2c 100644
--- a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
+++ b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
@@ -43,13 +43,11 @@
#include <qbluetoothlocaldevice.h>
#include <qbluetoothserver.h>
#include <qbluetoothserviceinfo.h>
-#include <qlowenergyserviceinfo.h>
QT_USE_NAMESPACE
Q_DECLARE_METATYPE(QBluetoothDeviceInfo)
Q_DECLARE_METATYPE(QBluetoothServiceDiscoveryAgent::Error)
-Q_DECLARE_METATYPE(QLowEnergyServiceInfo)
// Maximum time to for bluetooth device scan
const int MaxScanTime = 5 * 60 * 1000; // 5 minutes in ms
@@ -65,7 +63,6 @@ public:
public slots:
void deviceDiscoveryDebug(const QBluetoothDeviceInfo &info);
void serviceDiscoveryDebug(const QBluetoothServiceInfo &info);
- void leServiceDiscoveryDebug(const QLowEnergyServiceInfo &info);
void serviceError(const QBluetoothServiceDiscoveryAgent::Error err);
private slots:
@@ -95,7 +92,6 @@ tst_QBluetoothServiceDiscoveryAgent::tst_QBluetoothServiceDiscoveryAgent()
qRegisterMetaType<QBluetoothDeviceInfo>("QBluetoothDeviceInfo");
qRegisterMetaType<QBluetoothServiceInfo>("QBluetoothServiceInfo");
- qRegisterMetaType<QLowEnergyServiceInfo>("QLowEnergyServiceInfo");
qRegisterMetaType<QList<QBluetoothUuid> >("QList<QBluetoothUuid>");
qRegisterMetaType<QBluetoothServiceDiscoveryAgent::Error>("QBluetoothServiceDiscoveryAgent::Error");
qRegisterMetaType<QBluetoothDeviceDiscoveryAgent::Error>("QBluetoothDeviceDiscoveryAgent::Error");
@@ -176,14 +172,6 @@ void tst_QBluetoothServiceDiscoveryAgent::serviceDiscoveryDebug(const QBluetooth
qDebug() << "\tRFCOMM server channel:" << info.serverChannel();
}
-void tst_QBluetoothServiceDiscoveryAgent::leServiceDiscoveryDebug(const QLowEnergyServiceInfo &info)
-{
- qDebug() << "Discovered LE service on"
- << info.device().name() << info.device().address().toString();
- qDebug() << "\tService name:" << info.serviceName();
- qDebug() << "\tUUID:" << info.serviceUuid();
-}
-
static void dumpAttributeVariant(const QVariant &var, const QString indent)
{
if (!var.isValid()) {
@@ -387,11 +375,8 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscovery()
QSignalSpy finishedSpy(&discoveryAgent, SIGNAL(finished()));
QSignalSpy errorSpy(&discoveryAgent, SIGNAL(error(QBluetoothServiceDiscoveryAgent::Error)));
QSignalSpy discoveredSpy(&discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)));
- QSignalSpy leDiscoveredSpy(&discoveryAgent, SIGNAL(serviceDiscovered(QLowEnergyServiceInfo)));
// connect(&discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)),
// this, SLOT(serviceDiscoveryDebug(QBluetoothServiceInfo)));
-// connect(&discoveryAgent, SIGNAL(serviceDiscovered(QLowEnergyServiceInfo)),
-// this, SLOT(leServiceDiscoveryDebug(QLowEnergyServiceInfo)));
connect(&discoveryAgent, SIGNAL(error(QBluetoothServiceDiscoveryAgent::Error)),
this, SLOT(serviceError(QBluetoothServiceDiscoveryAgent::Error)));
@@ -457,21 +442,6 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscovery()
}
- while (!leDiscoveredSpy.isEmpty()) {
- const QVariant v = leDiscoveredSpy.takeFirst().at(0);
- if (v.userType() == qMetaTypeId<QLowEnergyServiceInfo>())
- {
- const QLowEnergyServiceInfo info =
- *reinterpret_cast<const QLowEnergyServiceInfo*>(v.constData());
-
- QVERIFY(info.isValid());
- QVERIFY(info.device().coreConfigurations() & QBluetoothDeviceInfo::LowEnergyCoreConfiguration);
- } else {
- QFAIL("Unknown type returned by service discovery");
- }
-
- }
-
QVERIFY(discoveryAgent.discoveredServices().count() != 0);
discoveryAgent.clear();
QVERIFY(discoveryAgent.discoveredServices().count() == 0);
diff --git a/tests/auto/qlowenergyserviceinfo/qlowenergyserviceinfo.pro b/tests/auto/qlowenergyserviceinfo/qlowenergyserviceinfo.pro
deleted file mode 100644
index 1dd24a97..00000000
--- a/tests/auto/qlowenergyserviceinfo/qlowenergyserviceinfo.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-SOURCES += tst_qlowenergyserviceinfo.cpp
-TARGET = tst_qlowenergyserviceinfo
-CONFIG += testcase
-
-QT = core bluetooth testlib
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-blackberry {
- LIBS += -lbtapi
-}
diff --git a/tests/auto/qlowenergyserviceinfo/tst_qlowenergyserviceinfo.cpp b/tests/auto/qlowenergyserviceinfo/tst_qlowenergyserviceinfo.cpp
deleted file mode 100644
index 23ea6dd2..00000000
--- a/tests/auto/qlowenergyserviceinfo/tst_qlowenergyserviceinfo.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2013 BlackBerry Limited all rights reserved
-** Contact: http://www.qt-project.org/legal
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-#include <QUuid>
-
-#include <QDebug>
-
-#include <qbluetoothdeviceinfo.h>
-#include <qlowenergyserviceinfo.h>
-#include <qbluetoothaddress.h>
-#include <qbluetoothlocaldevice.h>
-#include <qbluetoothuuid.h>
-
-QT_USE_NAMESPACE
-
-Q_DECLARE_METATYPE(QUuid)
-Q_DECLARE_METATYPE(QBluetoothDeviceInfo::CoreConfiguration)
-Q_DECLARE_METATYPE(QLowEnergyServiceInfo)
-Q_DECLARE_METATYPE(QBluetoothUuid::ServiceClassUuid)
-
-class tst_QLowEnergyServiceInfo : public QObject
-{
- Q_OBJECT
-
-public:
- tst_QLowEnergyServiceInfo();
- ~tst_QLowEnergyServiceInfo();
-
-private slots:
- void initTestCase();
- void tst_construction();
- void tst_assignment_data();
- void tst_assignment();
-};
-
-tst_QLowEnergyServiceInfo::tst_QLowEnergyServiceInfo()
-{
-}
-
-tst_QLowEnergyServiceInfo::~tst_QLowEnergyServiceInfo()
-{
-}
-
-void tst_QLowEnergyServiceInfo::initTestCase()
-{
- // start Bluetooth if not started
- QBluetoothLocalDevice *device = new QBluetoothLocalDevice();
- device->powerOn();
- delete device;
-}
-
-void tst_QLowEnergyServiceInfo::tst_construction()
-{
- const QBluetoothUuid serviceUuid(QBluetoothUuid::HeartRate);
- const QBluetoothUuid alternateServiceUuid(QBluetoothUuid::BatteryService);
- const QBluetoothDeviceInfo deviceInfo(QBluetoothAddress("001122334455"), "Test Device", 0);
- const QBluetoothDeviceInfo alternatedeviceInfo(QBluetoothAddress("554433221100"), "Test Device2", 0);
-
- {
- QLowEnergyServiceInfo serviceInfo;
-
- QVERIFY(!serviceInfo.isValid());
- QCOMPARE(serviceInfo.serviceName(), QStringLiteral("Unknown Service"));
- QCOMPARE(serviceInfo.serviceUuid().toString(), QBluetoothUuid().toString());
- QCOMPARE(serviceInfo.device(), QBluetoothDeviceInfo());
- }
-
- {
- QLowEnergyServiceInfo serviceInfo(serviceUuid);
- serviceInfo.setDevice(deviceInfo);
-
- QVERIFY(serviceInfo.isValid());
-
- QCOMPARE(serviceInfo.serviceUuid().toString(), serviceUuid.toString());
- QCOMPARE(serviceInfo.device().address(), deviceInfo.address());
-
- QLowEnergyServiceInfo copyInfo(serviceInfo);
-
- QVERIFY(copyInfo.isValid());
-
- QCOMPARE(copyInfo.serviceUuid().toString(), serviceUuid.toString());
- QCOMPARE(copyInfo.device().address(), deviceInfo.address());
-
-
- copyInfo = QLowEnergyServiceInfo(alternateServiceUuid);
- copyInfo.setDevice(alternatedeviceInfo);
- QCOMPARE(copyInfo.serviceUuid(), alternateServiceUuid);
-
- QCOMPARE(copyInfo.device().address(), alternatedeviceInfo.address());
-
- }
-}
-
-void tst_QLowEnergyServiceInfo::tst_assignment_data()
-{
- QTest::addColumn<QBluetoothAddress>("address");
- QTest::addColumn<QString>("name");
- QTest::addColumn<quint32>("classOfDevice");
- QTest::addColumn<QBluetoothUuid>("serviceClassUuid");
- QTest::addColumn<QBluetoothDeviceInfo::CoreConfiguration>("coreConfiguration");
-
- // bits 12-8 Major
- // bits 7-2 Minor
- // bits 1-0 0
-
- QTest::newRow("0x000000 COD") << QBluetoothAddress("000000000000") << "My Bluetooth Device"
- << quint32(0x000000)
- << QBluetoothUuid(QBluetoothUuid::GenericAccess)
- << QBluetoothDeviceInfo::BaseRateAndLowEnergyCoreConfiguration;
- QTest::newRow("0x000100 COD") << QBluetoothAddress("000000000000") << "My Bluetooth Device"
- << quint32(0x000100)
- << QBluetoothUuid(QBluetoothUuid::GenericAttribute)
- << QBluetoothDeviceInfo::BaseRateAndLowEnergyCoreConfiguration;
- QTest::newRow("0x000104 COD") << QBluetoothAddress("000000000000") << "My Bluetooth Device"
- << quint32(0x000104)
- << QBluetoothUuid(QBluetoothUuid::HeartRate)
- << QBluetoothDeviceInfo::BaseRateAndLowEnergyCoreConfiguration;
- QTest::newRow("0x000118 COD") << QBluetoothAddress("000000000000") << "My Bluetooth Device"
- << quint32(0x000118)
- << QBluetoothUuid(QBluetoothUuid::CyclingSpeedAndCadence)
- << QBluetoothDeviceInfo::BaseRateAndLowEnergyCoreConfiguration;
- QTest::newRow("0x000200 COD") << QBluetoothAddress("000000000000") << "My Bluetooth Device"
- << quint32(0x000200)
- << QBluetoothUuid(QBluetoothUuid::CyclingPower)
- << QBluetoothDeviceInfo::LowEnergyCoreConfiguration;
- QTest::newRow("0x000204 COD") << QBluetoothAddress("000000000000") << "My Bluetooth Device"
- << quint32(0x000204)
- << QBluetoothUuid(QBluetoothUuid::ScanParameters)
- << QBluetoothDeviceInfo::LowEnergyCoreConfiguration;
- QTest::newRow("0x000214 COD") << QBluetoothAddress("000000000000") << "My Bluetooth Device"
- << quint32(0x000214)
- << QBluetoothUuid(QBluetoothUuid::DeviceInformation)
- << QBluetoothDeviceInfo::LowEnergyCoreConfiguration;
- QTest::newRow("0x000300 COD") << QBluetoothAddress("000000000000") << "My Bluetooth Device"
- << quint32(0x000300)
- << QBluetoothUuid(QBluetoothUuid::CurrentTimeService)
- << QBluetoothDeviceInfo::LowEnergyCoreConfiguration;
- QTest::newRow("0x000320 COD") << QBluetoothAddress("000000000000") << "My Bluetooth Device"
- << quint32(0x000320)
- << QBluetoothUuid(QBluetoothUuid::LocationAndNavigation)
- << QBluetoothDeviceInfo::LowEnergyCoreConfiguration;
-}
-
-void tst_QLowEnergyServiceInfo::tst_assignment()
-{
- QFETCH(QBluetoothAddress, address);
- QFETCH(QString, name);
- QFETCH(quint32, classOfDevice);
- QFETCH(QBluetoothUuid, serviceClassUuid);
- QFETCH(QBluetoothDeviceInfo::CoreConfiguration, coreConfiguration);
-
- QBluetoothDeviceInfo deviceInfo(address, name, classOfDevice);
- deviceInfo.setCoreConfigurations(coreConfiguration);
- QCOMPARE(deviceInfo.coreConfigurations(), coreConfiguration);
-
- QLowEnergyServiceInfo serviceInfo(serviceClassUuid);
- serviceInfo.setDevice(deviceInfo);
- QCOMPARE(serviceInfo.device(), deviceInfo);
-
- QVERIFY(serviceInfo.isValid());
-
- {
- QLowEnergyServiceInfo copyInfo = serviceInfo;
-
- QVERIFY(copyInfo.isValid());
-
- QCOMPARE(copyInfo.device().address(), address);
- QCOMPARE(copyInfo.serviceUuid(), serviceClassUuid);
- QCOMPARE(copyInfo.device().coreConfigurations(), coreConfiguration);
- QCOMPARE(copyInfo.device(), deviceInfo);
- }
-
- {
- QLowEnergyServiceInfo copyInfo;
-
- QVERIFY(!copyInfo.isValid());
-
- copyInfo = serviceInfo;
-
- QVERIFY(copyInfo.isValid());
-
- QCOMPARE(copyInfo.device().address(), address);
- QCOMPARE(copyInfo.serviceUuid(), serviceClassUuid);
- QCOMPARE(copyInfo.device().coreConfigurations(), coreConfiguration);
- }
-
- {
- QLowEnergyServiceInfo copyInfo1;
- QLowEnergyServiceInfo copyInfo2;
-
- QVERIFY(!copyInfo1.isValid());
- QVERIFY(!copyInfo2.isValid());
-
- copyInfo1 = copyInfo2 = serviceInfo;
-
- QVERIFY(copyInfo1.isValid());
- QVERIFY(copyInfo2.isValid());
-
- QCOMPARE(copyInfo1.device().address(), address);
- QCOMPARE(copyInfo2.device().address(), address);
- QCOMPARE(copyInfo1.serviceUuid(), serviceClassUuid);
- QCOMPARE(copyInfo2.serviceUuid(), serviceClassUuid);
- QCOMPARE(copyInfo1.device().coreConfigurations(), coreConfiguration);
- QCOMPARE(copyInfo2.device().coreConfigurations(), coreConfiguration);
- QCOMPARE(copyInfo1.device(), deviceInfo);
- QCOMPARE(copyInfo2.device(), deviceInfo);
- }
-}
-
-QTEST_MAIN(tst_QLowEnergyServiceInfo)
-
-#include "tst_qlowenergyserviceinfo.moc"
diff --git a/tests/bttestui/btlocaldevice.cpp b/tests/bttestui/btlocaldevice.cpp
index 247c00e6..fcc0494a 100644
--- a/tests/bttestui/btlocaldevice.cpp
+++ b/tests/bttestui/btlocaldevice.cpp
@@ -75,8 +75,6 @@ BtLocalDevice::BtLocalDevice(QObject *parent) :
serviceAgent = new QBluetoothServiceDiscoveryAgent(this);
connect(serviceAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)),
this, SLOT(serviceDiscovered(QBluetoothServiceInfo)));
- connect(serviceAgent, SIGNAL(serviceDiscovered(QLowEnergyServiceInfo)),
- this, SLOT(leServiceDiscovered(QLowEnergyServiceInfo)));
connect(serviceAgent, SIGNAL(finished()),
this, SLOT(serviceDiscoveryFinished()));
connect(serviceAgent, SIGNAL(canceled()),
@@ -325,12 +323,6 @@ void BtLocalDevice::serviceDiscovered(const QBluetoothServiceInfo &info)
}
}
-void BtLocalDevice::leServiceDiscovered(const QLowEnergyServiceInfo &info)
-{
- qDebug() << "$$ Found new BTLE service" << info.device().address().toString()
- << info.serviceUuid() << info.serviceName();
-}
-
void BtLocalDevice::serviceDiscoveryFinished()
{
qDebug() << "###### Service Discovery Finished";
diff --git a/tests/bttestui/btlocaldevice.h b/tests/bttestui/btlocaldevice.h
index 53e4797b..5112d142 100644
--- a/tests/bttestui/btlocaldevice.h
+++ b/tests/bttestui/btlocaldevice.h
@@ -82,7 +82,6 @@ public slots:
void startTargettedServiceDiscovery();
void stopServiceDiscovery();
void serviceDiscovered(const QBluetoothServiceInfo &info);
- void leServiceDiscovered(const QLowEnergyServiceInfo &leInfo);
void serviceDiscoveryFinished();
void serviceDiscoveryCanceled();
void serviceDiscoveryError(QBluetoothServiceDiscoveryAgent::Error error);