Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qlowenergyservicedata.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 QLOWENERGYSERVICEDATA_H
5#define QLOWENERGYSERVICEDATA_H
6
7#include <QtBluetooth/qtbluetoothglobal.h>
8#include <QtCore/qshareddata.h>
9
11
12class QBluetoothUuid;
16
17class Q_BLUETOOTH_EXPORT QLowEnergyServiceData
18{
19public:
23
26 {
27 return equals(a, b);
28 }
30 {
31 return !equals(a, b);
32 }
33
34 enum ServiceType { ServiceTypePrimary = 0x2800, ServiceTypeSecondary = 0x2801 };
35 ServiceType type() const;
36 void setType(ServiceType type);
37
38 QBluetoothUuid uuid() const;
39 void setUuid(const QBluetoothUuid &uuid);
40
41 QList<QLowEnergyService *> includedServices() const;
42 void setIncludedServices(const QList<QLowEnergyService *> &services);
43 void addIncludedService(QLowEnergyService *service);
44
45 QList<QLowEnergyCharacteristicData> characteristics() const;
46 void setCharacteristics(const QList<QLowEnergyCharacteristicData> &characteristics);
47 void addCharacteristic(const QLowEnergyCharacteristicData &characteristic);
48
49 bool isValid() const;
50
51 void swap(QLowEnergyServiceData &other) noexcept { d.swap(other.d); }
52
53private:
54 static bool equals(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b);
56};
57
58Q_DECLARE_SHARED(QLowEnergyServiceData)
59
61
62#endif // Include guard.
std::vector< ObjCStrongReference< CBMutableService > > services
\inmodule QtBluetooth
Definition qlist.h:74
The QLowEnergyCharacteristicData class is used to set up GATT service data. \inmodule QtBluetooth.
The QLowEnergyServiceData class is used to set up GATT service data. \inmodule QtBluetooth.
void swap(QLowEnergyServiceData &other) noexcept
Swaps this object with other.
ServiceType
The type of GATT service.
friend bool operator==(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b)
Returns true if a and b are equal with respect to their public state, otherwise returns false.
friend bool operator!=(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b)
Returns true if a and b are unequal with respect to their public state, otherwise returns false.
\inmodule QtBluetooth
\inmodule QtCore
Definition qshareddata.h:35
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum type
QSharedPointer< T > other(t)
[5]
proxy setType(QNetworkProxy::Socks5Proxy)