diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-11-07 13:09:10 +0100 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-11-12 09:24:02 +0100 |
commit | be5883540fe61123da3fb39dd39cfd34eec442b8 (patch) | |
tree | 8f49f72be6a7cd1e2ffbf8e441e2a3a7244bee24 /src/bluetooth/qlowenergycontroller_osx_p.h | |
parent | d2c2e502dcee44d06eb0b0ad392571d7bc3021bf (diff) |
QLowEnergyController - version for OS X and iOS
QLowEnergyController/Private for OS X and iOS.
This patch contains dummy empty classes required.
While LE controller is not fully implemented, I have to
disable (marking as insignificant) auto test on this class,
otherwise changing the (empty) class to pass the test adds more problem.
Change-Id: I54f764f7f6468b1acf58e80555ae454922de9f3b
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_osx_p.h')
-rw-r--r-- | src/bluetooth/qlowenergycontroller_osx_p.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergycontroller_osx_p.h b/src/bluetooth/qlowenergycontroller_osx_p.h new file mode 100644 index 00000000..6d48f591 --- /dev/null +++ b/src/bluetooth/qlowenergycontroller_osx_p.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Javier S. Pedro <maemo@javispedro.com> +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QLOWENERGYCONTROLLER_OSX_P_H +#define QLOWENERGYCONTROLLER_OSX_P_H + +#include "qlowenergycontroller_p.h" +#include "qlowenergycontroller.h" +#include "osx/osxbtutility_p.h" +#include "qbluetoothaddress.h" +#include "qbluetoothuuid.h" + +#include <QtCore/qglobal.h> +#include <QtCore/qstring.h> +#include <QtCore/qmap.h> + +QT_BEGIN_NAMESPACE + +// The suffix OSX is not the very right, it's also iOS. +class QLowEnergyControllerPrivateOSX : public QLowEnergyControllerPrivate +{ + friend class QLowEnergyController; +public: + QLowEnergyControllerPrivateOSX(QLowEnergyController *q); + QLowEnergyControllerPrivateOSX(QLowEnergyController *q, + const QBluetoothDeviceInfo &uuid); + ~QLowEnergyControllerPrivateOSX(); + + bool isValid() const; + +private: + void connectToDevice(); + void discoverServices(); + void discoverServiceDetails(const QBluetoothUuid &serviceUuid); + + QLowEnergyController *q_ptr; + QBluetoothUuid deviceUuid; + + QString errorString; + QLowEnergyController::Error lastError; + + QBluetoothAddress localAddress; + QBluetoothAddress remoteAddress; + + QLowEnergyController::ControllerState controllerState; + QLowEnergyController::RemoteAddressType addressType; + + typedef QMap<QBluetoothUuid, QSharedPointer<QLowEnergyServicePrivate> > ServiceMap; + typedef ServiceMap::const_iterator ConstServiceIterator; + typedef ServiceMap::iterator ServiceIterator; + ServiceMap discoveredServices; +}; + +QT_END_NAMESPACE + +#endif |