- class QLowEnergyAdvertisingParameters¶
The
QLowEnergyAdvertisingParameters
class represents the parameters used for Bluetooth Low Energy advertising. More…Synopsis¶
Methods¶
def
__init__()
def
filterPolicy()
def
mode()
def
__ne__()
def
__eq__()
def
setInterval()
def
setMode()
def
setWhiteList()
def
swap()
def
whiteList()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
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
startAdvertising()
.- class Mode¶
Specifies in which way to advertise.
Constant
Description
QLowEnergyAdvertisingParameters.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.
QLowEnergyAdvertisingParameters.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.
QLowEnergyAdvertisingParameters.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.
- class FilterPolicy¶
Specifies the semantics of the white list.
Constant
Description
QLowEnergyAdvertisingParameters.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.
QLowEnergyAdvertisingParameters.UseWhiteListForScanning
The white list is used when handling scan requests, but is ignored for connection requests.
QLowEnergyAdvertisingParameters.UseWhiteListForConnecting
The white list is used when handling connection requests, but is ignored for scan requests.
QLowEnergyAdvertisingParameters.UseWhiteListForScanningAndConnecting
The white list is used for both connection and scan requests.
See also
- __init__()¶
Constructs a new object of this class. All values are initialized to their defaults according to the Bluetooth Low Energy specification.
- __init__(other)
- Parameters:
other –
QLowEnergyAdvertisingParameters
Constructs a new object of this class that is a copy of
other
.- filterPolicy()¶
- Return type:
Returns the filter policy that determines how the white list is used. The default is
IgnoreWhiteList
.- maximumInterval()¶
- Return type:
int
Returns the maximum advertising interval in milliseconds. The default is 1280.
- minimumInterval()¶
- Return type:
int
Returns the minimum advertising interval in milliseconds. The default is 1280.
Returns the advertising mode. The default is
AdvInd
.See also
- __ne__(b)¶
- Parameters:
- Return type:
bool
Returns
true
ifa
andb
are not equal with respect to their public state, otherwise returnsfalse
.- __eq__(b)¶
- Parameters:
- Return type:
bool
Returns
true
ifa
andb
are equal with respect to their public state, otherwise returnsfalse
.- setInterval(minimum, maximum)¶
- Parameters:
minimum – int
maximum – int
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
andmaximum
are given in milliseconds. Ifmaximum
is smaller thanminimum
, it will be set to the value ofminimum
.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).
Sets the advertising mode to
mode
.See also
- setWhiteList(whiteList, policy)¶
- Parameters:
whiteList – .list of QLowEnergyAdvertisingParameters.AddressInfo
policy –
FilterPolicy
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, andpolicy
specifies how exactly to usewhiteList
.Whitelists are not supported on the BlueZ DBus backend as they are not supported by BlueZ.
See also
- swap(other)¶
- Parameters:
other –
QLowEnergyAdvertisingParameters
Swaps this object with
other
.- whiteList()¶
- Return type:
.list of QLowEnergyAdvertisingParameters.AddressInfo
Returns the white list used for filtering scan and connection requests. By default, this list is empty.
See also