![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QLowEnergyAdvertisingParameters class represents the parameters used for Bluetooth Low Energy advertising. \inmodule QtBluetooth. More...
#include <qlowenergyadvertisingparameters.h>
Classes | |
class | AddressInfo |
\inmodule QtBluetooth More... | |
Public Types | |
enum | Mode { AdvInd = 0x0 , AdvScanInd = 0x2 , AdvNonConnInd = 0x3 } |
Specifies in which way to advertise. More... | |
enum | FilterPolicy { IgnoreWhiteList = 0x00 , UseWhiteListForScanning = 0x01 , UseWhiteListForConnecting = 0x02 , UseWhiteListForScanningAndConnecting = 0x03 } |
Specifies the semantics of the white list. More... | |
Public Member Functions | |
QLowEnergyAdvertisingParameters () | |
Constructs a new object of this class. | |
QLowEnergyAdvertisingParameters (const QLowEnergyAdvertisingParameters &other) | |
Constructs a new object of this class that is a copy of other. | |
~QLowEnergyAdvertisingParameters () | |
Destroys this object. | |
QLowEnergyAdvertisingParameters & | operator= (const QLowEnergyAdvertisingParameters &other) |
Makes this object a copy of other and returns the new value of this object. | |
void | setMode (Mode mode) |
Sets the advertising mode to mode. | |
Mode | mode () const |
Returns the advertising mode. | |
void | setWhiteList (const QList< AddressInfo > &whiteList, FilterPolicy policy) |
Sets the white list that is potentially used for filtering scan and connection requests. | |
QList< AddressInfo > | whiteList () const |
Returns the white list used for filtering scan and connection requests. | |
FilterPolicy | filterPolicy () const |
Returns the filter policy that determines how the white list is used. | |
void | setInterval (quint16 minimum, quint16 maximum) |
Sets the advertising interval. | |
int | minimumInterval () const |
Returns the minimum advertising interval in milliseconds. | |
int | maximumInterval () const |
Returns the maximum advertising interval in milliseconds. | |
void | swap (QLowEnergyAdvertisingParameters &other) noexcept |
Swaps this object with other. | |
Friends | |
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 . | |
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 . | |
The QLowEnergyAdvertisingParameters class represents the parameters used for Bluetooth Low Energy advertising. \inmodule QtBluetooth.
When running the advertising procedure, a number of parameters can be configured, such as how fast to advertise or which clients, if any, can connect to the advertising device. These parameters are set via this class, and their values will be used when advertising is started by calling \l QLowEnergyController::startAdvertising().
Definition at line 17 of file qlowenergyadvertisingparameters.h.
Specifies the semantics of the white list.
\value IgnoreWhiteList The value of the white list is ignored, that is, no filtering takes place for either scan or connection requests when using undirected advertising. \value UseWhiteListForScanning The white list is used when handling scan requests, but is ignored for connection requests. \value UseWhiteListForConnecting The white list is used when handling connection requests, but is ignored for scan requests. \value UseWhiteListForScanningAndConnecting The white list is used for both connection and scan requests.
Enumerator | |
---|---|
IgnoreWhiteList | |
UseWhiteListForScanning | |
UseWhiteListForConnecting | |
UseWhiteListForScanningAndConnecting |
Definition at line 57 of file qlowenergyadvertisingparameters.h.
Specifies in which way to advertise.
\value AdvInd For non-directed, connectable advertising. Advertising is not directed to one specific device and a device seeing the advertisement can connect to the advertising device or send scan requests. \value AdvScanInd For non-directed, scannable advertising. Advertising is not directed to one specific device and a device seeing the advertisement can send a scan request to the advertising device, but cannot connect to it. \value AdvNonConnInd For non-directed, non-connectable advertising. Advertising is not directed to one specific device. A device seeing the advertisement cannot connect to the advertising device, nor can it send a scan request. This mode thus implies pure broadcasting.
Enumerator | |
---|---|
AdvInd | |
AdvScanInd | |
AdvNonConnInd |
Definition at line 37 of file qlowenergyadvertisingparameters.h.
QLowEnergyAdvertisingParameters::QLowEnergyAdvertisingParameters | ( | ) |
Constructs a new object of this class.
All values are initialized to their defaults according to the Bluetooth Low Energy specification.
Definition at line 132 of file qlowenergyadvertisingparameters.cpp.
QLowEnergyAdvertisingParameters::QLowEnergyAdvertisingParameters | ( | const QLowEnergyAdvertisingParameters & | other | ) |
Constructs a new object of this class that is a copy of other.
Definition at line 138 of file qlowenergyadvertisingparameters.cpp.
QLowEnergyAdvertisingParameters::~QLowEnergyAdvertisingParameters | ( | ) |
Destroys this object.
Definition at line 144 of file qlowenergyadvertisingparameters.cpp.
QLowEnergyAdvertisingParameters::FilterPolicy QLowEnergyAdvertisingParameters::filterPolicy | ( | ) | const |
Returns the filter policy that determines how the white list is used.
The default is \l QLowEnergyAdvertisingParameters::IgnoreWhiteList.
Definition at line 196 of file qlowenergyadvertisingparameters.cpp.
int QLowEnergyAdvertisingParameters::maximumInterval | ( | ) | const |
Returns the maximum advertising interval in milliseconds.
The default is 1280.
Definition at line 231 of file qlowenergyadvertisingparameters.cpp.
int QLowEnergyAdvertisingParameters::minimumInterval | ( | ) | const |
Returns the minimum advertising interval in milliseconds.
The default is 1280.
Definition at line 223 of file qlowenergyadvertisingparameters.cpp.
QLowEnergyAdvertisingParameters::Mode QLowEnergyAdvertisingParameters::mode | ( | ) | const |
Returns the advertising mode.
The default is \l QLowEnergyAdvertisingParameters::AdvInd.
Definition at line 164 of file qlowenergyadvertisingparameters.cpp.
QLowEnergyAdvertisingParameters & QLowEnergyAdvertisingParameters::operator= | ( | const QLowEnergyAdvertisingParameters & | other | ) |
Makes this object a copy of other and returns the new value of this object.
Definition at line 149 of file qlowenergyadvertisingparameters.cpp.
Sets the advertising interval.
This is a range that gives the controller an upper and a lower bound for how often to send the advertising data. Both minimum and maximum are given in milliseconds. If maximum is smaller than minimum, it will be set to the value of minimum.
Setting the advertising interval is supported on BlueZ DBus backend if its experimental status is changed in later versions of BlueZ (or run in experimental mode).
Definition at line 214 of file qlowenergyadvertisingparameters.cpp.
void QLowEnergyAdvertisingParameters::setMode | ( | QLowEnergyAdvertisingParameters::Mode | mode | ) |
Sets the advertising mode to mode.
Definition at line 156 of file qlowenergyadvertisingparameters.cpp.
void QLowEnergyAdvertisingParameters::setWhiteList | ( | const QList< AddressInfo > & | whiteList, |
FilterPolicy | policy ) |
Sets the white list that is potentially used for filtering scan and connection requests.
The whiteList parameter is the list of addresses to use for filtering, and policy specifies how exactly to use whiteList.
Whitelists are not supported on the BlueZ DBus backend as they are not supported by BlueZ.
Definition at line 176 of file qlowenergyadvertisingparameters.cpp.
|
inlinenoexcept |
Swaps this object with other.
Definition at line 74 of file qlowenergyadvertisingparameters.h.
QList< QLowEnergyAdvertisingParameters::AddressInfo > QLowEnergyAdvertisingParameters::whiteList | ( | ) | const |
Returns the white list used for filtering scan and connection requests.
By default, this list is empty.
Definition at line 187 of file qlowenergyadvertisingparameters.cpp.
|
friend |
Returns true
if a and b are not equal with respect to their public state, otherwise returns false
.
Definition at line 31 of file qlowenergyadvertisingparameters.h.
|
friend |
Returns true
if a and b are equal with respect to their public state, otherwise returns false
.
Definition at line 25 of file qlowenergyadvertisingparameters.h.