Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qlowenergyservicedata.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
7
8#include <QtCore/qloggingcategory.h>
9
11
13
15{
17
20 QList<QLowEnergyService *> includedServices;
21 QList<QLowEnergyCharacteristicData> characteristics;
22};
23
24
51
56
61
68
74
80
83{
84 return d->uuid;
85}
86
89{
90 d->uuid = uuid;
91}
92
94QList<QLowEnergyService *> QLowEnergyServiceData::includedServices() const
95{
96 return d->includedServices;
97}
98
105void QLowEnergyServiceData::setIncludedServices(const QList<QLowEnergyService *> &services)
106{
108}
109
122
124QList<QLowEnergyCharacteristicData> QLowEnergyServiceData::characteristics() const
125{
126 return d->characteristics;
127}
128
134void QLowEnergyServiceData::setCharacteristics(const QList<QLowEnergyCharacteristicData> &characteristics)
135{
139}
140
146{
147 if (characteristic.isValid())
148 d->characteristics << characteristic;
149 else
150 qCWarning(QT_BT) << "not adding invalid characteristic to service";
151}
152
155{
156 return !uuid().isNull();
157}
158
185bool QLowEnergyServiceData::equals(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b)
186{
187 return a.d == b.d || (
188 a.type() == b.type()
189 && a.uuid() == b.uuid()
190 && a.includedServices() == b.includedServices()
191 && a.characteristics() == b.characteristics());
192}
193
std::vector< ObjCStrongReference< CBMutableService > > services
\inmodule QtBluetooth
void clear()
Definition qlist.h:434
The QLowEnergyCharacteristicData class is used to set up GATT service data. \inmodule QtBluetooth.
bool isValid() const
Returns true if and only if this characteristic is valid, that is, it has a non-null UUID.
The QLowEnergyServiceData class is used to set up GATT service data. \inmodule QtBluetooth.
void setType(ServiceType type)
Sets the type of this service to type.
QList< QLowEnergyCharacteristicData > characteristics() const
Returns the list of characteristics.
void setIncludedServices(const QList< QLowEnergyService * > &services)
Sets the list of included services to services.
void setCharacteristics(const QList< QLowEnergyCharacteristicData > &characteristics)
Sets the list of characteristics to characteristics.
void addCharacteristic(const QLowEnergyCharacteristicData &characteristic)
Adds characteristic to the list of characteristics, if it is valid.
~QLowEnergyServiceData()
Destroys this object.
QList< QLowEnergyService * > includedServices() const
Returns the list of included services.
QLowEnergyServiceData()
Creates a new invalid object of this class.
ServiceType
The type of GATT service.
bool isValid() const
Returns true if this service is has a non-null UUID.
void addIncludedService(QLowEnergyService *service)
Adds service to the list of included services.
ServiceType type() const
Returns the type of this service.
QBluetoothUuid uuid() const
Returns the UUID of this service.
QLowEnergyServiceData & operator=(const QLowEnergyServiceData &other)
Makes this object a copy of other and returns the new value of this object.
void setUuid(const QBluetoothUuid &uuid)
Sets the UUID of this service to uuid.
\inmodule QtBluetooth
\inmodule QtCore
Definition qshareddata.h:19
bool isNull() const noexcept
Returns true if this is the null UUID {00000000-0000-0000-0000-000000000000}; otherwise returns false...
Definition quuid.cpp:818
Combined button and popup list for selecting options.
#define qCWarning(category,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum type
QSharedPointer< T > other(t)
[5]
QList< QLowEnergyService * > includedServices
QLowEnergyServiceData::ServiceType type
QList< QLowEnergyCharacteristicData > characteristics