Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
10QT_BEGIN_NAMESPACE
11
12class QBluetoothUuid;
13class QLowEnergyCharacteristicData;
14class QLowEnergyService;
15struct QLowEnergyServiceDataPrivate;
16
17class Q_BLUETOOTH_EXPORT QLowEnergyServiceData
18{
19public:
20 QLowEnergyServiceData();
21 QLowEnergyServiceData(const QLowEnergyServiceData &other);
22 ~QLowEnergyServiceData();
23
24 QLowEnergyServiceData &operator=(const QLowEnergyServiceData &other);
25 friend bool operator==(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b)
26 {
27 return equals(a, b);
28 }
29 friend bool operator!=(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b)
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);
55 QSharedDataPointer<QLowEnergyServiceDataPrivate> d;
56};
57
59
60QT_END_NAMESPACE
61
62#endif // Include guard.
#define QT_BT_MAC_AUTORELEASEPOOL
Definition btutility_p.h:78
The QLowEnergyAdvertisingParameters class represents the parameters used for Bluetooth Low Energy adv...
The QLowEnergyCharacteristicData class is used to set up GATT service data. \inmodule QtBluetooth.
The QLowEnergyDescriptorData class is used to create GATT service data. \inmodule QtBluetooth.
The QLowEnergyServiceData class is used to set up GATT service data. \inmodule QtBluetooth.
quint16 QLowEnergyHandle
Definition qbluetooth.h:42
UpdateRequest()=default
QLowEnergyHandle charHandle
UpdateRequest(QLowEnergyHandle handle, const ObjCStrongReference< NSData > &val)
ObjCStrongReference< NSData > value