Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qlowenergyadvertisingdata.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
6#include <cstring>
7
9
11{
12public:
14 : manufacturerId(QLowEnergyAdvertisingData::invalidManufacturerId())
15 , discoverability(QLowEnergyAdvertisingData::DiscoverabilityNone)
17 {
18 }
19
27};
28
75{
76}
77
80 : d(other.d)
81{
82}
83
86{
87}
88
91{
92 d = other.d;
93 return *this;
94}
95
109{
110 d->localName = name;
111}
112
119{
120 return d->localName;
121}
122
128{
129 d->manufacturerId = id;
131}
132
139{
140 return d->manufacturerId;
141}
142
147{
148 return d->manufacturerData;
149}
150
156{
157 d->includePowerLevel = doInclude;
158}
159
165{
166 return d->includePowerLevel;
167}
168
176{
178}
179
185{
186 return d->discoverability;
187}
188
195{
196 d->services = services;
197}
198
204{
205 return d->services;
206}
207
219{
220 d->rawData = data;
221}
222
227{
228 return d->rawData;
229}
230
241bool QLowEnergyAdvertisingData::equals(const QLowEnergyAdvertisingData &a,
243{
244 if (a.d == b.d)
245 return true;
246 return a.discoverability() == b.discoverability()
247 && a.includePowerLevel() == b.includePowerLevel() && a.localName() == b.localName()
248 && a.manufacturerData() == b.manufacturerData()
249 && a.manufacturerId() == b.manufacturerId() && a.services() == b.services()
250 && a.rawData() == b.rawData();
251}
252
std::vector< ObjCStrongReference< CBMutableService > > services
\inmodule QtCore
Definition qbytearray.h:57
Definition qlist.h:74
QLowEnergyAdvertisingData::Discoverability discoverability
The QLowEnergyAdvertisingData class represents the data to be broadcast during Bluetooth Low Energy a...
QString localName() const
Returns the name of the local device that is to be advertised.
void setIncludePowerLevel(bool doInclude)
Specifies whether to include the device's transmit power level in the advertising data.
void setManufacturerData(quint16 id, const QByteArray &data)
Sets the manufacturer id and data.
QByteArray manufacturerData() const
Returns the manufacturer data.
QByteArray rawData() const
Returns the user-supplied raw data to be advertised.
bool includePowerLevel() const
Returns whether to include the device's transmit power level in the advertising data.
void setLocalName(const QString &name)
Specifies that name should be broadcast as the name of the device.
quint16 manufacturerId() const
Returns the manufacturer id.
void setRawData(const QByteArray &data)
Sets the data to be advertised to data.
Discoverability discoverability() const
Returns the discoverability mode of the advertising device.
~QLowEnergyAdvertisingData()
Destroys this object.
void setDiscoverability(Discoverability mode)
Sets the discoverability type of the advertising device to mode.
QList< QBluetoothUuid > services() const
Returns the list of service UUIDs to be advertised.
Discoverability
The discoverability of the advertising device as defined by the Generic Access Profile.
void setServices(const QList< QBluetoothUuid > &services)
Specifies that the service UUIDs in services should be advertised.
QLowEnergyAdvertisingData & operator=(const QLowEnergyAdvertisingData &other)
Makes this object a copy of other and returns the new value of this object.
QLowEnergyAdvertisingData()
Creates a new object of this class.
\inmodule QtCore
Definition qshareddata.h:19
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean b
GLenum mode
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint id
[7]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
unsigned short quint16
Definition qtypes.h:43
QSharedPointer< T > other(t)
[5]