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
QLowEnergyAdvertisingParameters Class Reference

The QLowEnergyAdvertisingParameters class represents the parameters used for Bluetooth Low Energy advertising. \inmodule QtBluetooth. More...

#include <qlowenergyadvertisingparameters.h>

+ Collaboration diagram for QLowEnergyAdvertisingParameters:

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.
 
QLowEnergyAdvertisingParametersoperator= (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< AddressInfowhiteList () 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.
 

Detailed Description

The QLowEnergyAdvertisingParameters class represents the parameters used for Bluetooth Low Energy advertising. \inmodule QtBluetooth.

Since
5.7

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().

See also
QLowEnergyAdvertisingData
QLowEnergyController::startAdvertising()

Definition at line 17 of file qlowenergyadvertisingparameters.h.

Member Enumeration Documentation

◆ FilterPolicy

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.

See also
QLowEnergyAdvertisingParameters::whiteList()
Enumerator
IgnoreWhiteList 
UseWhiteListForScanning 
UseWhiteListForConnecting 
UseWhiteListForScanningAndConnecting 

Definition at line 57 of file qlowenergyadvertisingparameters.h.

◆ Mode

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.

Constructor & Destructor Documentation

◆ QLowEnergyAdvertisingParameters() [1/2]

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() [2/2]

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::~QLowEnergyAdvertisingParameters ( )

Destroys this object.

Definition at line 144 of file qlowenergyadvertisingparameters.cpp.

Member Function Documentation

◆ filterPolicy()

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.

References QLowEnergyAdvertisingParametersPrivate::filterPolicy.

◆ maximumInterval()

int QLowEnergyAdvertisingParameters::maximumInterval ( ) const

Returns the maximum advertising interval in milliseconds.

The default is 1280.

Definition at line 231 of file qlowenergyadvertisingparameters.cpp.

References QLowEnergyAdvertisingParametersPrivate::maxInterval.

◆ minimumInterval()

int QLowEnergyAdvertisingParameters::minimumInterval ( ) const

Returns the minimum advertising interval in milliseconds.

The default is 1280.

Definition at line 223 of file qlowenergyadvertisingparameters.cpp.

References QLowEnergyAdvertisingParametersPrivate::minInterval.

◆ mode()

QLowEnergyAdvertisingParameters::Mode QLowEnergyAdvertisingParameters::mode ( ) const

Returns the advertising mode.

The default is \l QLowEnergyAdvertisingParameters::AdvInd.

Definition at line 164 of file qlowenergyadvertisingparameters.cpp.

References QLowEnergyAdvertisingParametersPrivate::mode.

Referenced by setMode().

+ Here is the caller graph for this function:

◆ operator=()

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.

References other().

+ Here is the call graph for this function:

◆ setInterval()

void QLowEnergyAdvertisingParameters::setInterval ( quint16 minimum,
quint16 maximum )

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.

Note
There are limits for the minimum and maximum interval; the exact values depend on the mode. If they are exceeded, the lowest or highest possible value will be used, respectively.

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.

References QLowEnergyAdvertisingParametersPrivate::maxInterval, QLowEnergyAdvertisingParametersPrivate::minInterval, and qMax().

+ Here is the call graph for this function:

◆ setMode()

void QLowEnergyAdvertisingParameters::setMode ( QLowEnergyAdvertisingParameters::Mode mode)

Sets the advertising mode to mode.

Definition at line 156 of file qlowenergyadvertisingparameters.cpp.

References QLowEnergyAdvertisingParametersPrivate::mode, and mode().

+ Here is the call graph for this function:

◆ setWhiteList()

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.

References QLowEnergyAdvertisingParametersPrivate::filterPolicy, policy, QLowEnergyAdvertisingParametersPrivate::whiteList, and whiteList().

+ Here is the call graph for this function:

◆ swap()

void QLowEnergyAdvertisingParameters::swap ( QLowEnergyAdvertisingParameters & other)
inlinenoexcept

Swaps this object with other.

Definition at line 74 of file qlowenergyadvertisingparameters.h.

References d, and other().

+ Here is the call graph for this function:

◆ whiteList()

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.

References QLowEnergyAdvertisingParametersPrivate::whiteList.

Referenced by setWhiteList().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool QLowEnergyAdvertisingParameters::operator!= ( const QLowEnergyAdvertisingParameters & a,
const QLowEnergyAdvertisingParameters & b )
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.

◆ operator==

bool QLowEnergyAdvertisingParameters::operator== ( const QLowEnergyAdvertisingParameters & a,
const QLowEnergyAdvertisingParameters & b )
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.


The documentation for this class was generated from the following files: