Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qlowenergyadvertisingparameters.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 QLOWENERGYADVERTISINGPARAMETERS_H
5#define QLOWENERGYADVERTISINGPARAMETERS_H
6
7#include <QtBluetooth/qtbluetoothglobal.h>
8#include <QtBluetooth/qbluetoothaddress.h>
9#include <QtBluetooth/qlowenergycontroller.h>
10#include <QtCore/qlist.h>
11#include <QtCore/qshareddata.h>
12
14
16
17class Q_BLUETOOTH_EXPORT QLowEnergyAdvertisingParameters
18{
19public:
23
27 {
28 return equals(a, b);
29 }
30
33 {
34 return !equals(a, b);
35 }
36
37 enum Mode { AdvInd = 0x0, AdvScanInd = 0x2, AdvNonConnInd = 0x3 };
38 void setMode(Mode mode);
39 Mode mode() const;
40
41 class Q_BLUETOOTH_EXPORT AddressInfo
42 {
43 public:
45 : address(addr), type(t) {}
46 AddressInfo() : type(QLowEnergyController::PublicAddress) {}
47
50 friend bool operator==(const AddressInfo &a, const AddressInfo &b) { return equals(a, b); }
51 friend bool operator!=(const AddressInfo &a, const AddressInfo &b) { return !equals(a, b); }
52
53 private:
54 static bool equals(const AddressInfo &a, const AddressInfo &b);
55 };
56
58 IgnoreWhiteList = 0x00,
59 UseWhiteListForScanning = 0x01,
60 UseWhiteListForConnecting = 0x02,
61 UseWhiteListForScanningAndConnecting = 0x03,
62 };
63 void setWhiteList(const QList<AddressInfo> &whiteList, FilterPolicy policy);
64 QList<AddressInfo> whiteList() const;
65 FilterPolicy filterPolicy() const;
66
67 void setInterval(quint16 minimum, quint16 maximum);
68 int minimumInterval() const;
69 int maximumInterval() const;
70
71 // TODO: own address type
72 // TODO: For ADV_DIRECT_IND: peer address + peer address type
73
74 void swap(QLowEnergyAdvertisingParameters &other) noexcept { d.swap(other.d); }
75
76private:
77 static bool equals(const QLowEnergyAdvertisingParameters &a,
80};
81
82Q_DECLARE_SHARED(QLowEnergyAdvertisingParameters)
83
85
86#endif // Include guard
\inmodule QtBluetooth
Definition qlist.h:74
friend bool operator!=(const AddressInfo &a, const AddressInfo &b)
Returns true if a and b are not equal with respect to their public state, otherwise returns false.
friend bool operator==(const AddressInfo &a, const AddressInfo &b)
Returns true if a and b are equal with respect to their public state, otherwise returns false.
AddressInfo(const QBluetoothAddress &addr, QLowEnergyController::RemoteAddressType t)
\variable QLowEnergyAdvertisingParameters::AddressInfo::address
AddressInfo()
Constructs a default constructed AddressInfo instance.
The QLowEnergyAdvertisingParameters class represents the parameters used for Bluetooth Low Energy adv...
friend bool operator==(const QLowEnergyAdvertisingParameters &a, const QLowEnergyAdvertisingParameters &b)
Returns true if a and b are equal with respect to their public state, otherwise returns false.
friend bool operator!=(const QLowEnergyAdvertisingParameters &a, const QLowEnergyAdvertisingParameters &b)
Returns true if a and b are not equal with respect to their public state, otherwise returns false.
Mode
Specifies in which way to advertise.
FilterPolicy
Specifies the semantics of the white list.
void swap(QLowEnergyAdvertisingParameters &other) noexcept
Swaps this object with other.
\inmodule QtBluetooth
RemoteAddressType
Indicates what type of Bluetooth address the remote device uses.
\inmodule QtCore
Definition qshareddata.h:35
Combined button and popup list for selecting options.
quint8 filterPolicy
GLboolean GLboolean GLboolean b
GLenum mode
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum type
GLenum const void * addr
GLdouble GLdouble t
Definition qopenglext.h:243
GLuint GLuint64EXT address
unsigned short quint16
Definition qtypes.h:43
QSharedPointer< T > other(t)
[5]
QSizePolicy policy