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
4#ifndef QLOWENERGYCONNECTIONPARAMETERS_H
5#define QLOWENERGYCONNECTIONPARAMETERS_H
6
7#include <QtBluetooth/qtbluetoothglobal.h>
8#include <QtCore/qmetatype.h>
9#include <QtCore/qshareddata.h>
10
11QT_BEGIN_NAMESPACE
12
13class QLowEnergyConnectionParametersPrivate;
14
15class Q_BLUETOOTH_EXPORT QLowEnergyConnectionParameters
16{
17public:
18 QLowEnergyConnectionParameters();
19 QLowEnergyConnectionParameters(const QLowEnergyConnectionParameters &other);
20 ~QLowEnergyConnectionParameters();
21
22 QLowEnergyConnectionParameters &operator=(const QLowEnergyConnectionParameters &other);
23 friend bool operator==(const QLowEnergyConnectionParameters &a,
24 const QLowEnergyConnectionParameters &b)
25 {
26 return equals(a, b);
27 }
28 friend bool operator!=(const QLowEnergyConnectionParameters &a,
29 const QLowEnergyConnectionParameters &b)
30 {
31 return !equals(a, b);
32 }
33
34 void setIntervalRange(double minimum, double maximum);
35 double minimumInterval() const;
36 double maximumInterval() const;
37
38 void setLatency(int latency);
39 int latency() const;
40
41 void setSupervisionTimeout(int timeout);
42 int supervisionTimeout() const;
43
44 void swap(QLowEnergyConnectionParameters &other) noexcept { d.swap(other&: other.d); }
45
46private:
47 static bool equals(const QLowEnergyConnectionParameters &a,
48 const QLowEnergyConnectionParameters &b);
49 QSharedDataPointer<QLowEnergyConnectionParametersPrivate> d;
50};
51
52Q_DECLARE_SHARED(QLowEnergyConnectionParameters)
53
54QT_END_NAMESPACE
55
56QT_DECL_METATYPE_EXTERN(QLowEnergyConnectionParameters, Q_BLUETOOTH_EXPORT)
57
58#endif // Include guard
59

source code of qtconnectivity/src/bluetooth/qlowenergyconnectionparameters.h