PySide6.QtBluetooth.QLowEnergyConnectionParameters¶
- class QLowEnergyConnectionParameters¶
The
QLowEnergyConnectionParameters
class is used when requesting or reporting an update of the parameters of a Bluetooth LE connection. More…Synopsis¶
Methods¶
def
__init__()
def
latency()
def
__ne__()
def
__eq__()
def
setLatency()
def
swap()
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¶
The connection parameters influence how often a master and a slave device synchronize with each other. In general, a lower connection interval and latency means faster communication, but also higher power consumption. How these criteria should be weighed against each other is highly dependent on the concrete use case.
Android only indirectly permits the adjustment of this parameter set. The platform separates the connection parameters into three categories (hight, low & balanced priority). Each category implies a predefined set of values for
minimumInterval()
,maximumInterval()
andlatency()
. Additionally, the value ranges of each category can vary from one Android device to the next. Qt uses theminimumInterval()
to determine the target category as follows:Android priority
interval < 30
CONNECTION_PRIORITY_HIGH
30 <= interval <= 100
CONNECTION_PRIORITY_BALANCED
interval > 100
CONNECTION_PRIORITY_LOW_POWER
The
supervisionTimeout()
cannot be changed on Android and is therefore ignored.See also
- __init__()¶
Constructs a new object of this class. All values are initialized to valid defaults.
- __init__(other)
- Parameters:
other –
QLowEnergyConnectionParameters
Constructs a new object of this class that is a copy of
other
.- latency()¶
- Return type:
int
Returns the slave latency of the connection.
See also
- maximumInterval()¶
- Return type:
float
Returns the maximum connection interval in milliseconds. The default is 4000.
Note
If this object was emitted via
connectionUpdated()
, then this value is the same asminimumInterval()
and refers to the actual connection interval.See also
- minimumInterval()¶
- Return type:
float
Returns the minimum connection interval in milliseconds. The default is 7.5.
Note
If this object was emitted via
connectionUpdated()
, then this value is the same asmaximumInterval()
and refers to the actual connection interval.See also
- __ne__(b)¶
- Parameters:
- Return type:
bool
Returns
true
ifp1
andp2
are not equal with respect to their public state, otherwise returnsfalse
.- __eq__(b)¶
- Parameters:
- Return type:
bool
Returns
true
ifp1
andp2
are equal with respect to their public state, otherwise returnsfalse
.- setIntervalRange(minimum, maximum)¶
- Parameters:
minimum – float
maximum – float
Sets the range in which the connection interval should be. The actual value will be decided by the controller. Both
minimum
andmaximum
are given in milliseconds. Ifmaximum
is smaller thanminimum
, it will be set to the value ofminimum
. The smallest possible connection interval is 7.5 milliseconds, the largest one is 4000 milliseconds.See also
- setLatency(latency)¶
- Parameters:
latency – int
Sets the slave latency of the connection (that is, the number of connection events that a slave device is allowed to ignore) to
latency
. The minimum value is 0, the maximum is 499.See also
- setSupervisionTimeout(timeout)¶
- Parameters:
timeout – int
Sets the link supervision timeout to
timeout
milliseconds. There are several constraints on this value: It must be in the range [100,32000] and it must be larger than (1 +latency()
) * 2 *maximumInterval()
.On Android, this timeout is not adjustable and therefore ignored.
See also
- supervisionTimeout()¶
- Return type:
int
Returns the link supervision timeout of the connection in milliseconds.
See also
- swap(other)¶
- Parameters:
other –
QLowEnergyConnectionParameters
Swaps this object with
other
.