summaryrefslogtreecommitdiffstats
path: root/tests/bttestui
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bttestui')
-rw-r--r--tests/bttestui/btlocaldevice.cpp16
-rw-r--r--tests/bttestui/btlocaldevice.h1
2 files changed, 13 insertions, 4 deletions
diff --git a/tests/bttestui/btlocaldevice.cpp b/tests/bttestui/btlocaldevice.cpp
index 3a9b52b5..148ba1aa 100644
--- a/tests/bttestui/btlocaldevice.cpp
+++ b/tests/bttestui/btlocaldevice.cpp
@@ -80,6 +80,8 @@ 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()),
@@ -271,11 +273,11 @@ void BtLocalDevice::stopServiceDiscovery()
void BtLocalDevice::serviceDiscovered(const QBluetoothServiceInfo &info)
{
- QString classIds;
- foreach (const QBluetoothUuid uuid, info.serviceClassUuids())
- classIds += uuid.toString() + QLatin1Char(' ');
+ QStringList classIds;
+ foreach (const QBluetoothUuid &uuid, info.serviceClassUuids())
+ classIds.append(uuid.toString());
qDebug() << "$$ Found new service" << info.device().address().toString()
- << info.serviceUuid() << info.serviceName() << classIds;
+ << info.serviceUuid() << info.serviceName() << info.serviceDescription() << classIds;
if (info.serviceUuid() == QBluetoothUuid(QString(TEST_SERVICE_UUID))
|| info.serviceClassUuids().contains(QBluetoothUuid(QString(TEST_SERVICE_UUID))))
@@ -296,6 +298,12 @@ 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 759599b7..a9571ecc 100644
--- a/tests/bttestui/btlocaldevice.h
+++ b/tests/bttestui/btlocaldevice.h
@@ -89,6 +89,7 @@ public slots:
void startServiceDiscovery(bool isMinimalDiscovery);
void stopServiceDiscovery();
void serviceDiscovered(const QBluetoothServiceInfo &info);
+ void leServiceDiscovered(const QLowEnergyServiceInfo &leInfo);
void serviceDiscoveryFinished();
void serviceDiscoveryCanceled();
void serviceDiscoveryError(QBluetoothServiceDiscoveryAgent::Error error);