summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/bluetooth/btscanner/service.cpp2
-rw-r--r--examples/bluetooth/heartlistener/heartrate.cpp12
-rw-r--r--examples/bluetooth/lowenergyscanner/device.cpp6
-rw-r--r--examples/bluetooth/lowenergyscanner/serviceinfo.cpp4
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp2
-rw-r--r--src/bluetooth/qlowenergycharacteristicinfo.cpp11
-rw-r--r--src/bluetooth/qlowenergycharacteristicinfo.h2
-rw-r--r--src/bluetooth/qlowenergycontroller.cpp33
-rw-r--r--src/bluetooth/qlowenergycontroller.h1
-rw-r--r--src/bluetooth/qlowenergycontroller_p.h1
-rw-r--r--src/bluetooth/qlowenergyserviceinfo.cpp12
-rw-r--r--src/bluetooth/qlowenergyserviceinfo.h6
-rw-r--r--tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp11
-rw-r--r--tests/auto/qlowenergycharacteristicinfo/tst_qlowenergycharacteristicinfo.cpp4
-rw-r--r--tests/auto/qlowenergyserviceinfo/tst_qlowenergyserviceinfo.cpp22
-rw-r--r--tests/bttestui/btlocaldevice.cpp2
16 files changed, 59 insertions, 72 deletions
diff --git a/examples/bluetooth/btscanner/service.cpp b/examples/bluetooth/btscanner/service.cpp
index c1db7cce..5e0f7da9 100644
--- a/examples/bluetooth/btscanner/service.cpp
+++ b/examples/bluetooth/btscanner/service.cpp
@@ -106,7 +106,7 @@ void ServiceDiscoveryDialog::addService(const QBluetoothServiceInfo &info)
void ServiceDiscoveryDialog::addLowEnergyService(const QLowEnergyServiceInfo &gatt)
{
- QString line = gatt.name();
+ QString line = gatt.serviceName();
ui->list->addItem(line);
}
diff --git a/examples/bluetooth/heartlistener/heartrate.cpp b/examples/bluetooth/heartlistener/heartrate.cpp
index a80f0c0c..1a4e3d47 100644
--- a/examples/bluetooth/heartlistener/heartrate.cpp
+++ b/examples/bluetooth/heartlistener/heartrate.cpp
@@ -155,7 +155,7 @@ void HeartRate::connectToService(const QString &address)
void HeartRate::addLowEnergyService(const QLowEnergyServiceInfo &gatt)
{
- if (gatt.uuid() == QBluetoothUuid::HeartRate) {
+ if (gatt.serviceUuid() == QBluetoothUuid::HeartRate) {
setMessage("Heart Rate service discovered. Waiting for service scan to be done...");
m_heartRateService = QLowEnergyServiceInfo(gatt);
foundHeartRateService = true;
@@ -185,7 +185,7 @@ void HeartRate::startConnection()
void HeartRate::serviceConnected(const QLowEnergyServiceInfo &leService)
{
setMessage("Connected to service. Waiting for updates");
- if (leService.uuid() == QBluetoothUuid::HeartRate) {
+ if (leService.serviceUuid() == QBluetoothUuid::HeartRate) {
for ( int i = 0; i<leService.characteristics().size(); i++) {
if (leService.characteristics().at(i).uuid() == QBluetoothUuid::HeartRateMeasurement) {
m_start = QDateTime::currentDateTime();
@@ -257,12 +257,14 @@ int HeartRate::hR() const
//! [Error handling]
void HeartRate::errorReceived(const QLowEnergyServiceInfo &leService)
{
- setMessage(QStringLiteral("Error: ") + leService.errorString());
+ qWarning() << "Error: " << leService.serviceUuid() << m_leInfo->errorString();
+ setMessage(QStringLiteral("Error: ") + m_leInfo->errorString());
}
void HeartRate::errorReceivedCharacteristic(const QLowEnergyCharacteristicInfo &leCharacteristic)
{
- setMessage(QStringLiteral("Error: ") + leCharacteristic.errorString());
+ qWarning() << "Error: " << leCharacteristic.uuid() << m_leInfo->errorString();
+ setMessage(QStringLiteral("Error: ") + m_leInfo->errorString());
}
//! [Error handling]
@@ -352,7 +354,7 @@ float HeartRate::caloriesCalculation()
void HeartRate::serviceDisconnected(const QLowEnergyServiceInfo &service)
{
setMessage("Heart Rate service disconnected");
- qWarning() << "Service disconnected: " << service.uuid();
+ qWarning() << "Service disconnected: " << service.serviceUuid();
}
int HeartRate::numDevices() const
diff --git a/examples/bluetooth/lowenergyscanner/device.cpp b/examples/bluetooth/lowenergyscanner/device.cpp
index 50d51631..00a0ae39 100644
--- a/examples/bluetooth/lowenergyscanner/device.cpp
+++ b/examples/bluetooth/lowenergyscanner/device.cpp
@@ -176,7 +176,7 @@ void Device::connectToService(const QString &uuid)
for (int i = 0; i < m_services.size(); i++) {
ServiceInfo *service = (ServiceInfo*)m_services.at(i);
a = QLowEnergyServiceInfo(service->getLeService());
- if (a.uuid() == u)
+ if (a.serviceUuid() == u)
info->connectToService(a);
}
}
@@ -195,8 +195,8 @@ void Device::serviceConnected(const QLowEnergyServiceInfo &service)
void Device::errorReceived(const QLowEnergyServiceInfo &service)
{
- qDebug() << "Error: " << service.errorString();
- setUpdate(service.errorString());
+ qDebug() << "Error: " << info->errorString() << service.serviceUuid();
+ setUpdate(info->errorString());
}
void Device::setUpdate(QString message)
diff --git a/examples/bluetooth/lowenergyscanner/serviceinfo.cpp b/examples/bluetooth/lowenergyscanner/serviceinfo.cpp
index 471fb40a..d1223bdc 100644
--- a/examples/bluetooth/lowenergyscanner/serviceinfo.cpp
+++ b/examples/bluetooth/lowenergyscanner/serviceinfo.cpp
@@ -59,10 +59,10 @@ QLowEnergyServiceInfo ServiceInfo::getLeService() const
QString ServiceInfo::getName()
{
- return m_serviceLe.name();
+ return m_serviceLe.serviceName();
}
QString ServiceInfo::getUuid()
{
- return m_serviceLe.uuid().toString().remove(QLatin1Char('{')).remove(QLatin1Char('}'));
+ return m_serviceLe.serviceUuid().toString().remove(QLatin1Char('{')).remove(QLatin1Char('}'));
}
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp
index 056cb4de..4ef40497 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp
@@ -364,7 +364,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::remoteDevicesChanged(int fd)
QLowEnergyServiceInfo lowEnergyService(leUuid);
lowEnergyService.setDevice(discoveredDevices.at(0));
- qCDebug(QT_BT_QNX) << "Adding Low Energy service" << lowEnergyService.uuid();
+ qCDebug(QT_BT_QNX) << "Adding Low Energy service" << lowEnergyService.serviceUuid();
q_ptr->serviceDiscovered(lowEnergyService);
}
diff --git a/src/bluetooth/qlowenergycharacteristicinfo.cpp b/src/bluetooth/qlowenergycharacteristicinfo.cpp
index 128f9f97..948499a4 100644
--- a/src/bluetooth/qlowenergycharacteristicinfo.cpp
+++ b/src/bluetooth/qlowenergycharacteristicinfo.cpp
@@ -305,15 +305,4 @@ QList<QLowEnergyDescriptorInfo> QLowEnergyCharacteristicInfo::descriptors() cons
return d_ptr->descriptorsList;
}
-/*!
- Returns an error string if error occurred. An error is emitted in the
- QLowEnergyController class.
-
- \sa QLowEnergyController::error(const QLowEnergyCharacteristicInfo &)
-*/
-QString QLowEnergyCharacteristicInfo::errorString() const
-{
- return d_ptr->errorString;
-}
-
QT_END_NAMESPACE
diff --git a/src/bluetooth/qlowenergycharacteristicinfo.h b/src/bluetooth/qlowenergycharacteristicinfo.h
index c3121253..e2285c63 100644
--- a/src/bluetooth/qlowenergycharacteristicinfo.h
+++ b/src/bluetooth/qlowenergycharacteristicinfo.h
@@ -101,8 +101,6 @@ public:
bool isValid() const;
- QString errorString() const;
-
protected:
QSharedPointer<QLowEnergyCharacteristicInfoPrivate> d_ptr;
diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp
index 2dbd1a87..e2ca99cc 100644
--- a/src/bluetooth/qlowenergycontroller.cpp
+++ b/src/bluetooth/qlowenergycontroller.cpp
@@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE
This signal is emitted when the service error occurs.
- \sa QLowEnergyServiceInfo::errorString()
+ \sa errorString()
*/
/*!
@@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE
This signal is emitted when the characteristic error occurs.
- \sa QLowEnergyCharacteristicInfo::errorString()
+ \sa errorString()
*/
/*!
@@ -123,7 +123,7 @@ QLowEnergyControllerPrivate::~QLowEnergyControllerPrivate()
void QLowEnergyControllerPrivate::_q_serviceConnected(const QBluetoothUuid &uuid)
{
for (int i = 0; i < m_leServices.size(); i++) {
- if (((QLowEnergyServiceInfo)m_leServices.at(i)).uuid() == uuid)
+ if (((QLowEnergyServiceInfo)m_leServices.at(i)).serviceUuid() == uuid)
emit q_ptr->connected((QLowEnergyServiceInfo)m_leServices.at(i));
}
@@ -132,8 +132,11 @@ void QLowEnergyControllerPrivate::_q_serviceConnected(const QBluetoothUuid &uuid
void QLowEnergyControllerPrivate::_q_serviceError(const QBluetoothUuid &uuid)
{
for (int i = 0; i < m_leServices.size(); i++) {
- if (((QLowEnergyServiceInfo)m_leServices.at(i)).uuid() == uuid)
- emit q_ptr->error((QLowEnergyServiceInfo)m_leServices.at(i));
+ if (((QLowEnergyServiceInfo)m_leServices.at(i)).serviceUuid() == uuid) {
+ QLowEnergyServiceInfo service((QLowEnergyServiceInfo)m_leServices.at(i));
+ errorString = service.d_ptr->errorString;
+ emit q_ptr->error(service);
+ }
}
}
@@ -142,8 +145,10 @@ void QLowEnergyControllerPrivate::_q_characteristicError(const QBluetoothUuid &u
for (int i = 0; i < m_leServices.size(); i++) {
QList<QLowEnergyCharacteristicInfo> characteristics = m_leServices.at(i).characteristics();
for (int j = 0; j < characteristics.size(); j++) {
- if (characteristics.at(j).uuid() == uuid)
+ if (characteristics.at(j).uuid() == uuid) {
+ errorString = characteristics.at(j).d_ptr->errorString;
emit q_ptr->error(characteristics.at(j));
+ }
}
}
}
@@ -165,7 +170,7 @@ void QLowEnergyControllerPrivate::_q_valueReceived(const QBluetoothUuid &uuid)
void QLowEnergyControllerPrivate::_q_serviceDisconnected(const QBluetoothUuid &uuid)
{
for (int i = 0; i < m_leServices.size(); i++) {
- if (((QLowEnergyServiceInfo)m_leServices.at(i)).uuid() == uuid) {
+ if (((QLowEnergyServiceInfo)m_leServices.at(i)).serviceUuid() == uuid) {
QObject::disconnect(((QLowEnergyServiceInfo)m_leServices.at(i)).d_ptr.data(), SIGNAL(connectedToService(QBluetoothUuid)), q_ptr, SLOT(_q_serviceConnected(QBluetoothUuid)));
QObject::disconnect(((QLowEnergyServiceInfo)m_leServices.at(i)).d_ptr.data(), SIGNAL(error(QBluetoothUuid)), q_ptr, SLOT(_q_serviceError(QBluetoothUuid)));
QObject::disconnect(((QLowEnergyServiceInfo)m_leServices.at(i)).d_ptr.data(), SIGNAL(disconnectedFromService(QBluetoothUuid)), q_ptr, SLOT(_q_serviceDisconnected(QBluetoothUuid)));
@@ -179,7 +184,7 @@ void QLowEnergyControllerPrivate::connectService(const QLowEnergyServiceInfo &se
bool in = false;
if (service.isValid()) {
for (int i = 0; i < m_leServices.size(); i++) {
- if (((QLowEnergyServiceInfo)m_leServices.at(i)).uuid() == service.uuid() && !((QLowEnergyServiceInfo)m_leServices.at(i)).isConnected()) {
+ if (((QLowEnergyServiceInfo)m_leServices.at(i)).serviceUuid() == service.serviceUuid() && !((QLowEnergyServiceInfo)m_leServices.at(i)).isConnected()) {
in = true;
QObject::connect(m_leServices.at(i).d_ptr.data(), SIGNAL(connectedToService(QBluetoothUuid)), q_ptr, SLOT(_q_serviceConnected(QBluetoothUuid)));
QObject::connect(((QLowEnergyServiceInfo)m_leServices.at(i)).d_ptr.data(), SIGNAL(error(QBluetoothUuid)), q_ptr, SLOT(_q_serviceError(QBluetoothUuid)));
@@ -202,7 +207,7 @@ void QLowEnergyControllerPrivate::disconnectService(const QLowEnergyServiceInfo
{
if (service.isValid()) {
for (int i = 0; i < m_leServices.size(); i++) {
- if (((QLowEnergyServiceInfo)m_leServices.at(i)).uuid() == service.uuid() && service.isConnected()) {
+ if (((QLowEnergyServiceInfo)m_leServices.at(i)).serviceUuid() == service.serviceUuid() && service.isConnected()) {
((QLowEnergyServiceInfo)m_leServices.at(i)).d_ptr->unregisterServiceWatcher();
break;
}
@@ -301,4 +306,14 @@ void QLowEnergyController::disableNotifications(const QLowEnergyCharacteristicIn
}
}
}
+
+/*!
+ Returns a human-readable description of the last error that occurred.
+
+ \sa error(const QLowEnergyServiceInfo &), error(const QLowEnergyCharacteristicInfo &)
+*/
+QString QLowEnergyController::errorString() const
+{
+ return d_ptr->errorString;
+}
QT_END_NAMESPACE
diff --git a/src/bluetooth/qlowenergycontroller.h b/src/bluetooth/qlowenergycontroller.h
index 16f1bc55..842a2e7e 100644
--- a/src/bluetooth/qlowenergycontroller.h
+++ b/src/bluetooth/qlowenergycontroller.h
@@ -64,6 +64,7 @@ public:
void disconnectFromService(const QLowEnergyServiceInfo &leService = QLowEnergyServiceInfo());
bool enableNotifications(const QLowEnergyCharacteristicInfo &characteristic);
void disableNotifications(const QLowEnergyCharacteristicInfo &characteristic);
+ QString errorString() const;
Q_SIGNALS:
void connected(const QLowEnergyServiceInfo &);
diff --git a/src/bluetooth/qlowenergycontroller_p.h b/src/bluetooth/qlowenergycontroller_p.h
index b19f7024..1d68f4b7 100644
--- a/src/bluetooth/qlowenergycontroller_p.h
+++ b/src/bluetooth/qlowenergycontroller_p.h
@@ -61,6 +61,7 @@ public:
void _q_serviceDisconnected(const QBluetoothUuid &uuid);
QList<QLowEnergyServiceInfo> m_leServices;
+ QString errorString;
private:
QLowEnergyController *q_ptr;
diff --git a/src/bluetooth/qlowenergyserviceinfo.cpp b/src/bluetooth/qlowenergyserviceinfo.cpp
index 618bd9c7..ca6df923 100644
--- a/src/bluetooth/qlowenergyserviceinfo.cpp
+++ b/src/bluetooth/qlowenergyserviceinfo.cpp
@@ -166,7 +166,7 @@ QLowEnergyServiceInfo::~QLowEnergyServiceInfo()
/*!
Returns the gatt service uuid.
*/
-QBluetoothUuid QLowEnergyServiceInfo::uuid() const
+QBluetoothUuid QLowEnergyServiceInfo::serviceUuid() const
{
return d_ptr->uuid;
}
@@ -183,7 +183,7 @@ QList<QLowEnergyCharacteristicInfo> QLowEnergyServiceInfo::characteristics() con
/*!
Returns the service name.
*/
-QString QLowEnergyServiceInfo::name() const
+QString QLowEnergyServiceInfo::serviceName() const
{
return d_ptr->serviceName;
}
@@ -234,14 +234,6 @@ void QLowEnergyServiceInfo::setRandomAddress()
}
/*!
- Returns an error string if error occurred.
- */
-QString QLowEnergyServiceInfo::errorString() const
-{
- return d_ptr->errorString;
-}
-
-/*!
Returns the address of the Bluetooth device that provides this service.
*/
QBluetoothDeviceInfo QLowEnergyServiceInfo::device() const
diff --git a/src/bluetooth/qlowenergyserviceinfo.h b/src/bluetooth/qlowenergyserviceinfo.h
index 08c5fde4..14321aeb 100644
--- a/src/bluetooth/qlowenergyserviceinfo.h
+++ b/src/bluetooth/qlowenergyserviceinfo.h
@@ -84,11 +84,11 @@ public:
void setDevice(const QBluetoothDeviceInfo &info);
QBluetoothDeviceInfo device() const;
- QBluetoothUuid uuid() const;
+ QBluetoothUuid serviceUuid() const;
QList<QLowEnergyCharacteristicInfo> characteristics() const;
- QString name() const;
+ QString serviceName() const;
void setServiceType(QLowEnergyServiceInfo::ServiceType type);
QLowEnergyServiceInfo::ServiceType serviceType() const;
@@ -97,8 +97,6 @@ public:
bool isConnected() const;
- QString errorString() const;
-
bool isValid() const;
protected:
diff --git a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
index cd5b1166..2355f4d5 100644
--- a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
+++ b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
@@ -190,8 +190,8 @@ void tst_QBluetoothServiceDiscoveryAgent::leServiceDiscoveryDebug(const QLowEner
{
qDebug() << "Discovered LE service on"
<< info.device().name() << info.device().address().toString();
- qDebug() << "\tService name:" << info.name();
- qDebug() << "\tUUID:" << info.uuid();
+ qDebug() << "\tService name:" << info.serviceName();
+ qDebug() << "\tUUID:" << info.serviceUuid();
}
static void dumpAttributeVariant(const QVariant &var, const QString indent)
@@ -504,9 +504,9 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscovery()
*reinterpret_cast<const QLowEnergyServiceInfo*>(v.constData());
QVERIFY(info.isValid());
- QCOMPARE(info.errorString(), QString());
+ QCOMPARE(leController.errorString(), QString());
QVERIFY((info.characteristics().size() > 0));
- qDebug() << "LE Service Connected: " << info.name() << info.uuid();
+ qDebug() << "LE Service Connected: " << info.serviceName() << info.serviceUuid();
leTestCounter++;
for (int i = 0; i < info.characteristics().size(); i++)
QVERIFY(info.characteristics().at(i).isValid());
@@ -531,8 +531,7 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscovery()
*reinterpret_cast<const QLowEnergyServiceInfo*>(v.constData());
QVERIFY(info.isValid());
- QCOMPARE(info.errorString(), QString());
- qDebug() << "LE Service Disconnected: " << info.name() << info.uuid();
+ qDebug() << "LE Service Disconnected: " << info.serviceName() << info.serviceUuid();
} else {
QFAIL("Unknown type returned by service discovery");
}
diff --git a/tests/auto/qlowenergycharacteristicinfo/tst_qlowenergycharacteristicinfo.cpp b/tests/auto/qlowenergycharacteristicinfo/tst_qlowenergycharacteristicinfo.cpp
index fa585ffd..fc8095bf 100644
--- a/tests/auto/qlowenergycharacteristicinfo/tst_qlowenergycharacteristicinfo.cpp
+++ b/tests/auto/qlowenergycharacteristicinfo/tst_qlowenergycharacteristicinfo.cpp
@@ -103,7 +103,6 @@ void tst_QLowEnergyCharacteristicInfo::tst_construction()
QCOMPARE(characteristicInfo.name(), QString(""));
QCOMPARE(characteristicInfo.isNotificationCharacteristic(), false);
QCOMPARE(characteristicInfo.descriptors().count(), 0);
- QCOMPARE(characteristicInfo.errorString(), QString(""));
}
{
@@ -118,7 +117,6 @@ void tst_QLowEnergyCharacteristicInfo::tst_construction()
QCOMPARE(characteristicInfo.name(), QString(""));
QCOMPARE(characteristicInfo.isNotificationCharacteristic(), false);
QCOMPARE(characteristicInfo.descriptors().count(), 0);
- QCOMPARE(characteristicInfo.errorString(), QString(""));
QLowEnergyCharacteristicInfo copyInfo(characteristicInfo);
@@ -136,9 +134,7 @@ void tst_QLowEnergyCharacteristicInfo::tst_construction()
QCOMPARE(copyInfo.name(), QString(""));
QCOMPARE(copyInfo.isNotificationCharacteristic(), false);
QCOMPARE(copyInfo.descriptors().count(), 0);
- QCOMPARE(copyInfo.errorString(), QString(""));
copyInfo.writeValue("test");
- QVERIFY(copyInfo.errorString().size() > 0);
}
}
diff --git a/tests/auto/qlowenergyserviceinfo/tst_qlowenergyserviceinfo.cpp b/tests/auto/qlowenergyserviceinfo/tst_qlowenergyserviceinfo.cpp
index 96db5a63..fc3ba25d 100644
--- a/tests/auto/qlowenergyserviceinfo/tst_qlowenergyserviceinfo.cpp
+++ b/tests/auto/qlowenergyserviceinfo/tst_qlowenergyserviceinfo.cpp
@@ -100,12 +100,11 @@ void tst_QLowEnergyServiceInfo::tst_construction()
QLowEnergyServiceInfo serviceInfo;
QVERIFY(!serviceInfo.isValid());
- QCOMPARE(serviceInfo.name(), QString());
- QCOMPARE(serviceInfo.uuid().toString(), QBluetoothUuid().toString());
+ QCOMPARE(serviceInfo.serviceName(), QString());
+ QCOMPARE(serviceInfo.serviceUuid().toString(), QBluetoothUuid().toString());
QCOMPARE(serviceInfo.serviceType(), QLowEnergyServiceInfo::PrimaryService);
QCOMPARE(serviceInfo.isConnected(), false);
QCOMPARE(serviceInfo.characteristics().size(), 0);
- QCOMPARE(serviceInfo.errorString(), QString(""));
QCOMPARE(serviceInfo.device(), QBluetoothDeviceInfo());
}
@@ -115,20 +114,20 @@ void tst_QLowEnergyServiceInfo::tst_construction()
QVERIFY(serviceInfo.isValid());
- QCOMPARE(serviceInfo.uuid().toString(), serviceUuid.toString());
+ QCOMPARE(serviceInfo.serviceUuid().toString(), serviceUuid.toString());
QCOMPARE(serviceInfo.device().address(), deviceInfo.address());
QLowEnergyServiceInfo copyInfo(serviceInfo);
QVERIFY(copyInfo.isValid());
- QCOMPARE(copyInfo.uuid().toString(), serviceUuid.toString());
+ QCOMPARE(copyInfo.serviceUuid().toString(), serviceUuid.toString());
QCOMPARE(copyInfo.device().address(), deviceInfo.address());
copyInfo = QLowEnergyServiceInfo(alternateServiceUuid);
copyInfo.setDevice(alternatedeviceInfo);
- QCOMPARE(copyInfo.uuid(), alternateServiceUuid);
+ QCOMPARE(copyInfo.serviceUuid(), alternateServiceUuid);
QCOMPARE(copyInfo.device().address(), alternatedeviceInfo.address());
@@ -220,12 +219,11 @@ void tst_QLowEnergyServiceInfo::tst_assignment()
QVERIFY(copyInfo.isValid());
QCOMPARE(copyInfo.device().address(), address);
- QCOMPARE(copyInfo.uuid(), serviceClassUuid);
+ QCOMPARE(copyInfo.serviceUuid(), serviceClassUuid);
QCOMPARE(copyInfo.device().coreConfiguration(), coreConfiguration);
QCOMPARE(copyInfo.serviceType(), serviceType);
QCOMPARE(copyInfo.isConnected(), false);
QCOMPARE(copyInfo.characteristics().size(), 0);
- QCOMPARE(copyInfo.errorString(), QString(""));
QCOMPARE(copyInfo.device(), deviceInfo);
}
@@ -239,7 +237,7 @@ void tst_QLowEnergyServiceInfo::tst_assignment()
QVERIFY(copyInfo.isValid());
QCOMPARE(copyInfo.device().address(), address);
- QCOMPARE(copyInfo.uuid(), serviceClassUuid);
+ QCOMPARE(copyInfo.serviceUuid(), serviceClassUuid);
QCOMPARE(copyInfo.device().coreConfiguration(), coreConfiguration);
QCOMPARE(copyInfo.serviceType(), serviceType);
}
@@ -259,8 +257,8 @@ void tst_QLowEnergyServiceInfo::tst_assignment()
QCOMPARE(copyInfo1.device().address(), address);
QCOMPARE(copyInfo2.device().address(), address);
- QCOMPARE(copyInfo1.uuid(), serviceClassUuid);
- QCOMPARE(copyInfo2.uuid(), serviceClassUuid);
+ QCOMPARE(copyInfo1.serviceUuid(), serviceClassUuid);
+ QCOMPARE(copyInfo2.serviceUuid(), serviceClassUuid);
QCOMPARE(copyInfo1.serviceType(), serviceType);
QCOMPARE(copyInfo2.serviceType(), serviceType);
QCOMPARE(copyInfo1.device().coreConfiguration(), coreConfiguration);
@@ -269,8 +267,6 @@ void tst_QLowEnergyServiceInfo::tst_assignment()
QCOMPARE(copyInfo2.isConnected(), false);
QCOMPARE(copyInfo1.characteristics().size(), 0);
QCOMPARE(copyInfo2.characteristics().size(), 0);
- QCOMPARE(copyInfo1.errorString(), QString(""));
- QCOMPARE(copyInfo2.errorString(), QString(""));
QCOMPARE(copyInfo1.device(), deviceInfo);
QCOMPARE(copyInfo2.device(), deviceInfo);
}
diff --git a/tests/bttestui/btlocaldevice.cpp b/tests/bttestui/btlocaldevice.cpp
index 60df26d5..fc3a6104 100644
--- a/tests/bttestui/btlocaldevice.cpp
+++ b/tests/bttestui/btlocaldevice.cpp
@@ -303,7 +303,7 @@ void BtLocalDevice::serviceDiscovered(const QBluetoothServiceInfo &info)
void BtLocalDevice::leServiceDiscovered(const QLowEnergyServiceInfo &info)
{
qDebug() << "$$ Found new BTLE service" << info.device().address().toString()
- << info.uuid() << info.name();
+ << info.serviceUuid() << info.serviceName();
}
void BtLocalDevice::serviceDiscoveryFinished()