diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-01-12 12:22:11 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-01-18 07:46:35 +0000 |
commit | e94fe90e7d2e1df9bd7d1d014fb468e5e73da834 (patch) | |
tree | 440a4e0359661b6cc4ac2e95455475ff0d64ebcd /src/bluetooth/qlowenergyconnectionparameters.h | |
parent | 1046db1a91f264db6714975daa27f56a457a6778 (diff) |
Bluetooth LE: Add connection update functionality.
Implemented for BlueZ only.
Change-Id: I358a98bbc7499d5ce5437fb0d4672fde46c3b831
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qlowenergyconnectionparameters.h')
-rw-r--r-- | src/bluetooth/qlowenergyconnectionparameters.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergyconnectionparameters.h b/src/bluetooth/qlowenergyconnectionparameters.h new file mode 100644 index 00000000..a7022dd2 --- /dev/null +++ b/src/bluetooth/qlowenergyconnectionparameters.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtBluetooth module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QLOWENERGYCONNECTIONPARAMETERS_H +#define QLOWENERGYCONNECTIONPARAMETERS_H + +#include <QtBluetooth/qbluetoothglobal.h> +#include <QtCore/qmetatype.h> +#include <QtCore/qshareddata.h> + +QT_BEGIN_NAMESPACE + +class QLowEnergyConnectionParametersPrivate; + +class Q_BLUETOOTH_EXPORT QLowEnergyConnectionParameters +{ + friend Q_BLUETOOTH_EXPORT bool operator==(const QLowEnergyConnectionParameters &p1, + const QLowEnergyConnectionParameters &p2); +public: + QLowEnergyConnectionParameters(); + QLowEnergyConnectionParameters(const QLowEnergyConnectionParameters &other); + ~QLowEnergyConnectionParameters(); + + QLowEnergyConnectionParameters &operator=(const QLowEnergyConnectionParameters &other); + + void setIntervalRange(double minimum, double maximum); + double minimumInterval() const; + double maximumInterval() const; + + void setLatency(int latency); + int latency() const; + + void setSupervisionTimeout(int timeout); + int supervisionTimeout() const; + + void swap(QLowEnergyConnectionParameters &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + +private: + QSharedDataPointer<QLowEnergyConnectionParametersPrivate> d; +}; + +Q_BLUETOOTH_EXPORT bool operator==(const QLowEnergyConnectionParameters &p1, + const QLowEnergyConnectionParameters &p2); +inline bool operator!=(const QLowEnergyConnectionParameters &p1, + const QLowEnergyConnectionParameters &p2) +{ + return !(p1 == p2); +} + +Q_DECLARE_SHARED(QLowEnergyConnectionParameters) + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QLowEnergyConnectionParameters) + +#endif // Include guard |