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
qlowenergyconnectionparameters.cpp
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
5
7
9
11{
12public:
14 : minInterval(7.5)
15 , maxInterval(4000)
16 , latency(0)
17 , timeout(32000)
18 {
19 }
20
25};
26
78
84
89
96
105void QLowEnergyConnectionParameters::setIntervalRange(double minimum, double maximum)
106{
107 d->minInterval = minimum;
108 d->maxInterval = qMax(minimum, maximum);
109}
110
119{
120 return d->minInterval;
121}
122
131{
132 return d->maxInterval;
133}
134
141{
142 d->latency = latency;
143}
144
150{
151 return d->latency;
152}
153
167
176
187bool QLowEnergyConnectionParameters::equals(const QLowEnergyConnectionParameters &a,
189{
190 if (a.d == b.d)
191 return true;
192 return a.minimumInterval() == b.minimumInterval() && a.maximumInterval() == b.maximumInterval()
193 && a.latency() == b.latency() && a.supervisionTimeout() == b.supervisionTimeout();
194}
195
The QLowEnergyConnectionParameters class is used when requesting or reporting an update of the parame...
int supervisionTimeout() const
Returns the link supervision timeout of the connection in milliseconds.
int latency() const
Returns the slave latency of the connection.
void setSupervisionTimeout(int timeout)
Sets the link supervision timeout to timeout milliseconds.
void setLatency(int latency)
Sets the slave latency of the connection (that is, the number of connection events that a slave devic...
double maximumInterval() const
Returns the maximum connection interval in milliseconds.
void setIntervalRange(double minimum, double maximum)
Sets the range in which the connection interval should be.
double minimumInterval() const
Returns the minimum connection interval in milliseconds.
QLowEnergyConnectionParameters & operator=(const QLowEnergyConnectionParameters &other)
Makes this object a copy of other and returns the new value of this object.
QLowEnergyConnectionParameters()
Constructs a new object of this class.
\inmodule QtCore
Definition qshareddata.h:19
Combined button and popup list for selecting options.
quint16 maxInterval
quint16 minInterval
#define QT_IMPL_METATYPE_EXTERN(TYPE)
Definition qmetatype.h:1390
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLbitfield GLuint64 timeout
[4]
QSharedPointer< T > other(t)
[5]