summaryrefslogtreecommitdiffstats
path: root/tests/bttestui
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-03-07 12:40:46 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-07 13:55:26 +0100
commitb4e70ef769c5e8716607e6ebb99c425cd9907d2a (patch)
treeec6c91970d77029182e0ac02e3e1d13983ce51a2 /tests/bttestui
parentdc29213a7510baef9cda83dc6c520f3f50eff65f (diff)
Improve BtTestUI device and service discovery output
This was recently used to debug Androids buggy discovery code. Change-Id: I6c3eca85a650d6fbb853d2cfc8ee73b434b5e7a9 Reviewed-by: Nedim Hadzic <nedimhadzija@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'tests/bttestui')
-rw-r--r--tests/bttestui/btlocaldevice.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/bttestui/btlocaldevice.cpp b/tests/bttestui/btlocaldevice.cpp
index 22a89275..3a9b52b5 100644
--- a/tests/bttestui/btlocaldevice.cpp
+++ b/tests/bttestui/btlocaldevice.cpp
@@ -271,9 +271,11 @@ void BtLocalDevice::stopServiceDiscovery()
void BtLocalDevice::serviceDiscovered(const QBluetoothServiceInfo &info)
{
-
+ QString classIds;
+ foreach (const QBluetoothUuid uuid, info.serviceClassUuids())
+ classIds += uuid.toString() + QLatin1Char(' ');
qDebug() << "$$ Found new service" << info.device().address().toString()
- << info.serviceUuid() << info.serviceName() << info.serviceDescription();
+ << info.serviceUuid() << info.serviceName() << classIds;
if (info.serviceUuid() == QBluetoothUuid(QString(TEST_SERVICE_UUID))
|| info.serviceClassUuids().contains(QBluetoothUuid(QString(TEST_SERVICE_UUID))))
@@ -314,6 +316,15 @@ void BtLocalDevice::serviceDiscoveryError(QBluetoothServiceDiscoveryAgent::Error
void BtLocalDevice::dumpServiceDiscovery()
{
+ if (deviceAgent) {
+ qDebug() << "Device Discovery active:" << deviceAgent->isActive();
+ qDebug() << "Error:" << deviceAgent->error() << deviceAgent->errorString();
+ QList<QBluetoothDeviceInfo> list = deviceAgent->discoveredDevices();
+ qDebug() << "Discovered Devices:" << list.count();
+
+ foreach (const QBluetoothDeviceInfo &info, list)
+ qDebug() << info.name() << info.address().toString();
+ }
if (serviceAgent) {
qDebug() << "Service Discovery active:" << serviceAgent->isActive();
qDebug() << "Error:" << serviceAgent->error() << serviceAgent->errorString();