From beb84e5fcdc79b3e9a613d9d5c36ac27952a5546 Mon Sep 17 00:00:00 2001 From: Nedim Hadzic Date: Wed, 27 Nov 2013 16:06:02 +0100 Subject: Removed get part in return methods. In case method name is getValue(), it was renamed to value(). Change-Id: I914e16bd0b630c0810932c52af14f091cc35bd8f Reviewed-by: Alex Blasche --- src/bluetooth/qlowenergycharacteristicinfo.cpp | 8 ++++++++ src/bluetooth/qlowenergycharacteristicinfo.h | 2 +- src/bluetooth/qlowenergycharacteristicinfo_p.cpp | 6 ------ src/bluetooth/qlowenergycontroller.cpp | 18 +++++++++--------- src/bluetooth/qlowenergyserviceinfo.cpp | 4 ++-- src/bluetooth/qlowenergyserviceinfo.h | 4 ++-- 6 files changed, 22 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/bluetooth/qlowenergycharacteristicinfo.cpp b/src/bluetooth/qlowenergycharacteristicinfo.cpp index b89ca939..232d03ca 100644 --- a/src/bluetooth/qlowenergycharacteristicinfo.cpp +++ b/src/bluetooth/qlowenergycharacteristicinfo.cpp @@ -283,4 +283,12 @@ bool QLowEnergyCharacteristicInfo::isValid() const return true; } +/*! + Returns the list of characteristic descriptors. +*/ +QList QLowEnergyCharacteristicInfo::descriptors() const +{ + return d_ptr->descriptorsList; +} + QT_END_NAMESPACE diff --git a/src/bluetooth/qlowenergycharacteristicinfo.h b/src/bluetooth/qlowenergycharacteristicinfo.h index 565d2195..0622b5d9 100644 --- a/src/bluetooth/qlowenergycharacteristicinfo.h +++ b/src/bluetooth/qlowenergycharacteristicinfo.h @@ -97,7 +97,7 @@ public: bool isNotificationCharacteristic() const; - QList getDescriptors() const; + QList descriptors() const; bool isValid() const; diff --git a/src/bluetooth/qlowenergycharacteristicinfo_p.cpp b/src/bluetooth/qlowenergycharacteristicinfo_p.cpp index e43a0c71..092a2580 100644 --- a/src/bluetooth/qlowenergycharacteristicinfo_p.cpp +++ b/src/bluetooth/qlowenergycharacteristicinfo_p.cpp @@ -53,12 +53,6 @@ QLowEnergyCharacteristicInfoPrivate::~QLowEnergyCharacteristicInfoPrivate() } -void QLowEnergyCharacteristicInfoPrivate::propertyChanged(QString valueName, QDBusVariant value) -{ - Q_UNUSED(valueName); - Q_UNUSED(value); -} - void QLowEnergyCharacteristicInfoPrivate::setValue(const QByteArray &wantedValue) { Q_UNUSED(wantedValue); diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp index 00a33325..c74a67b2 100644 --- a/src/bluetooth/qlowenergycontroller.cpp +++ b/src/bluetooth/qlowenergycontroller.cpp @@ -133,7 +133,7 @@ void QLowEnergyControllerPrivate::_q_serviceError(const QBluetoothUuid &uuid) void QLowEnergyControllerPrivate::_q_valueReceived(const QBluetoothUuid &uuid) { for (int i = 0; i < m_leServices.size(); i++) { - QList characteristics = m_leServices.at(i).getCharacteristics(); + QList characteristics = m_leServices.at(i).characteristics(); for (int j = 0; j < characteristics.size(); j++) { if (characteristics.at(j).uuid() == uuid) emit q_ptr->valueChanged(characteristics.at(j)); @@ -253,10 +253,10 @@ bool QLowEnergyController::enableNotifications(const QLowEnergyCharacteristicInf { bool enable = false; for (int i = 0; i < d_ptr->m_leServices.size(); i++) { - for (int j = 0; j < d_ptr->m_leServices.at(i).getCharacteristics().size(); j++) { - if (d_ptr->m_leServices.at(i).getCharacteristics().at(j).uuid() == characteristic.uuid()) { - connect(d_ptr->m_leServices.at(i).getCharacteristics().at(j).d_ptr.data(), SIGNAL(notifyValue(QBluetoothUuid)), this, SLOT(_q_valueReceived(QBluetoothUuid))); - enable = d_ptr->m_leServices.at(i).getCharacteristics().at(j).d_ptr->enableNotification(); + for (int j = 0; j < d_ptr->m_leServices.at(i).characteristics().size(); j++) { + if (d_ptr->m_leServices.at(i).characteristics().at(j).uuid() == characteristic.uuid()) { + connect(d_ptr->m_leServices.at(i).characteristics().at(j).d_ptr.data(), SIGNAL(notifyValue(QBluetoothUuid)), this, SLOT(_q_valueReceived(QBluetoothUuid))); + enable = d_ptr->m_leServices.at(i).characteristics().at(j).d_ptr->enableNotification(); } } } @@ -272,10 +272,10 @@ bool QLowEnergyController::enableNotifications(const QLowEnergyCharacteristicInf void QLowEnergyController::disableNotifications(const QLowEnergyCharacteristicInfo &characteristic) { for (int i = 0; i < d_ptr->m_leServices.size(); i++) { - for (int j = 0; j < d_ptr->m_leServices.at(i).getCharacteristics().size(); j++) { - if (d_ptr->m_leServices.at(i).getCharacteristics().at(j).uuid() == characteristic.uuid()){ - disconnect(d_ptr->m_leServices.at(i).getCharacteristics().at(j).d_ptr.data(), SIGNAL(notifyValue(QBluetoothUuid)), this, SLOT(_q_valueReceived(QBluetoothUuid))); - d_ptr->m_leServices.at(i).getCharacteristics().at(j).d_ptr->disableNotification(); + for (int j = 0; j < d_ptr->m_leServices.at(i).characteristics().size(); j++) { + if (d_ptr->m_leServices.at(i).characteristics().at(j).uuid() == characteristic.uuid()){ + disconnect(d_ptr->m_leServices.at(i).characteristics().at(j).d_ptr.data(), SIGNAL(notifyValue(QBluetoothUuid)), this, SLOT(_q_valueReceived(QBluetoothUuid))); + d_ptr->m_leServices.at(i).characteristics().at(j).d_ptr->disableNotification(); } } } diff --git a/src/bluetooth/qlowenergyserviceinfo.cpp b/src/bluetooth/qlowenergyserviceinfo.cpp index 137b93f4..178ca704 100644 --- a/src/bluetooth/qlowenergyserviceinfo.cpp +++ b/src/bluetooth/qlowenergyserviceinfo.cpp @@ -160,7 +160,7 @@ QBluetoothUuid QLowEnergyServiceInfo::uuid() const Returns the list of service characteristics. If service was not connected, an empty list will be returned. */ -QList QLowEnergyServiceInfo::getCharacteristics() const +QList QLowEnergyServiceInfo::characteristics() const { return d_ptr->characteristicList; } @@ -185,7 +185,7 @@ void QLowEnergyServiceInfo::setServiceType(QLowEnergyServiceInfo::ServiceType ty Returns the service type. If setServiceType is not called default service type (PrimaryService) is returned. */ -QLowEnergyServiceInfo::ServiceType QLowEnergyServiceInfo::getServiceType() const +QLowEnergyServiceInfo::ServiceType QLowEnergyServiceInfo::serviceType() const { return d_ptr->serviceType; } diff --git a/src/bluetooth/qlowenergyserviceinfo.h b/src/bluetooth/qlowenergyserviceinfo.h index 2412a742..745fb77f 100644 --- a/src/bluetooth/qlowenergyserviceinfo.h +++ b/src/bluetooth/qlowenergyserviceinfo.h @@ -88,12 +88,12 @@ public: QBluetoothUuid uuid() const; - QList getCharacteristics() const; + QList characteristics() const; QString name() const; void setServiceType(QLowEnergyServiceInfo::ServiceType type); - QLowEnergyServiceInfo::ServiceType getServiceType() const; + QLowEnergyServiceInfo::ServiceType serviceType() const; void setRandomAddress(); -- cgit v1.2.3