diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/qlowenergycharacteristicinfo.cpp | 8 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycharacteristicinfo.h | 2 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycharacteristicinfo_p.cpp | 6 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycontroller.cpp | 18 | ||||
-rw-r--r-- | src/bluetooth/qlowenergyserviceinfo.cpp | 4 | ||||
-rw-r--r-- | src/bluetooth/qlowenergyserviceinfo.h | 4 |
6 files changed, 22 insertions, 20 deletions
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<QLowEnergyDescriptorInfo> 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<QLowEnergyDescriptorInfo> getDescriptors() const; + QList<QLowEnergyDescriptorInfo> 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<QLowEnergyCharacteristicInfo> characteristics = m_leServices.at(i).getCharacteristics(); + QList<QLowEnergyCharacteristicInfo> 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<QLowEnergyCharacteristicInfo> QLowEnergyServiceInfo::getCharacteristics() const +QList<QLowEnergyCharacteristicInfo> 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<QLowEnergyCharacteristicInfo> getCharacteristics() const; + QList<QLowEnergyCharacteristicInfo> characteristics() const; QString name() const; void setServiceType(QLowEnergyServiceInfo::ServiceType type); - QLowEnergyServiceInfo::ServiceType getServiceType() const; + QLowEnergyServiceInfo::ServiceType serviceType() const; void setRandomAddress(); |