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
qlowenergyadvertisingdata.h
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
4#ifndef QLOWENERGYADVERTISINGDATA_H
5#define QLOWENERGYADVERTISINGDATA_H
6
7#include <QtBluetooth/qtbluetoothglobal.h>
8#include <QtBluetooth/qbluetoothuuid.h>
9#include <QtCore/qshareddata.h>
10
12
14
15class Q_BLUETOOTH_EXPORT QLowEnergyAdvertisingData
16{
17public:
21
24 {
25 return equals(a, b);
26 }
28 {
29 return !equals(a, b);
30 }
31
32 void setLocalName(const QString &name);
33 QString localName() const;
34
35 static quint16 invalidManufacturerId() { return 0xffff; }
36 void setManufacturerData(quint16 id, const QByteArray &data);
37 quint16 manufacturerId() const;
38 QByteArray manufacturerData() const;
39
40 void setIncludePowerLevel(bool doInclude);
41 bool includePowerLevel() const;
42
44 DiscoverabilityNone, DiscoverabilityLimited, DiscoverabilityGeneral
45 };
46 void setDiscoverability(Discoverability mode);
47 Discoverability discoverability() const;
48
49 void setServices(const QList<QBluetoothUuid> &services);
50 QList<QBluetoothUuid> services() const;
51
52 // TODO: BR/EDR capability flag?
53
54 void setRawData(const QByteArray &data);
55 QByteArray rawData() const;
56
57 void swap(QLowEnergyAdvertisingData &other) noexcept { d.swap(other.d); }
58
59private:
60 static bool equals(const QLowEnergyAdvertisingData &a, const QLowEnergyAdvertisingData &b);
61 QSharedDataPointer<QLowEnergyAdvertisingDataPrivate> d;
62};
63
64Q_DECLARE_SHARED(QLowEnergyAdvertisingData)
65
67
68#endif // Include guard
std::vector< ObjCStrongReference< CBMutableService > > services
\inmodule QtCore
Definition qbytearray.h:57
The QLowEnergyAdvertisingData class represents the data to be broadcast during Bluetooth Low Energy a...
void swap(QLowEnergyAdvertisingData &other) noexcept
Swaps this object with other.
Discoverability
The discoverability of the advertising device as defined by the Generic Access Profile.
friend bool operator!=(const QLowEnergyAdvertisingData &a, const QLowEnergyAdvertisingData &b)
Returns true if data1 and data2 are not equal with respect to their public state, otherwise returns f...
friend bool operator==(const QLowEnergyAdvertisingData &a, const QLowEnergyAdvertisingData &b)
Returns true if data1 and data2 are equal with respect to their public state, otherwise returns false...
static quint16 invalidManufacturerId()
Returns an invalid manufacturer id.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean b
GLenum mode
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
unsigned short quint16
Definition qtypes.h:48
QSharedPointer< T > other(t)
[5]