summaryrefslogtreecommitdiffstats
path: root/src/bluetooth
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-09-08 09:52:00 +0200
committerAlex Blasche <alexander.blasche@digia.com>2014-09-08 09:52:00 +0200
commit9078fe8cf48a278dac66dea607af6dd410c1b740 (patch)
tree79b183103417b8771e2a74950c7c328252dc9447 /src/bluetooth
parent4fc7f500adbb4316a0f92424364876ec714eeb8e (diff)
parent5ec215a6cf1046846c0f5f0dd948502fdff45ff4 (diff)
Merge branch '5.4' into wip/win
Conflicts: src/bluetooth/qbluetooth.cpp src/bluetooth/qbluetoothdevicediscoveryagent.h src/bluetooth/qbluetoothdevicediscoveryagent_p.h src/bluetooth/qbluetoothlocaldevice_p.h Change-Id: I87958a39605af9c2d45bbc63dc61771c5fa1cc76
Diffstat (limited to 'src/bluetooth')
-rw-r--r--src/bluetooth/android/androidbroadcastreceiver.cpp28
-rw-r--r--src/bluetooth/android/androidbroadcastreceiver_p.h40
-rw-r--r--src/bluetooth/android/devicediscoverybroadcastreceiver.cpp28
-rw-r--r--src/bluetooth/android/devicediscoverybroadcastreceiver_p.h39
-rw-r--r--src/bluetooth/android/inputstreamthread.cpp28
-rw-r--r--src/bluetooth/android/inputstreamthread_p.h39
-rw-r--r--src/bluetooth/android/jni_android.cpp28
-rw-r--r--src/bluetooth/android/jni_android_p.h39
-rw-r--r--src/bluetooth/android/localdevicebroadcastreceiver.cpp28
-rw-r--r--src/bluetooth/android/localdevicebroadcastreceiver_p.h39
-rw-r--r--src/bluetooth/android/serveracceptancethread.cpp28
-rw-r--r--src/bluetooth/android/serveracceptancethread_p.h39
-rw-r--r--src/bluetooth/android/servicediscoverybroadcastreceiver.cpp28
-rw-r--r--src/bluetooth/android/servicediscoverybroadcastreceiver_p.h39
-rw-r--r--src/bluetooth/bluetooth.pro3
-rw-r--r--src/bluetooth/bluez/bluez5_helper.cpp28
-rw-r--r--src/bluetooth/bluez/bluez5_helper_p.h28
-rw-r--r--src/bluetooth/bluez/bluez_data_p.h40
-rw-r--r--src/bluetooth/bluez/servicemap.cpp30
-rw-r--r--src/bluetooth/bluez/servicemap_p.h41
-rw-r--r--src/bluetooth/doc/images/peripheral-structure.pngbin0 -> 74765 bytes
-rw-r--r--src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp79
-rw-r--r--src/bluetooth/doc/src/bluetooth-index.qdoc15
-rw-r--r--src/bluetooth/doc/src/bluetooth-le-overview.qdoc254
-rw-r--r--src/bluetooth/doc/src/bluetooth-overview.qdoc65
-rw-r--r--src/bluetooth/gatoattclient.cpp617
-rw-r--r--src/bluetooth/gatoattclient.h143
-rw-r--r--src/bluetooth/gatoperipheral.cpp874
-rw-r--r--src/bluetooth/gatoperipheral.h119
-rw-r--r--src/bluetooth/gatoperipheral_p.h116
-rw-r--r--src/bluetooth/qbluetooth.cpp28
-rw-r--r--src/bluetooth/qbluetooth.h30
-rw-r--r--src/bluetooth/qbluetoothaddress.cpp30
-rw-r--r--src/bluetooth/qbluetoothaddress.h30
-rw-r--r--src/bluetooth/qbluetoothaddress_p.h41
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent.cpp30
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent.h28
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp28
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp30
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp45
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_p.h39
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp28
-rw-r--r--src/bluetooth/qbluetoothdeviceinfo.cpp30
-rw-r--r--src/bluetooth/qbluetoothdeviceinfo.h30
-rw-r--r--src/bluetooth/qbluetoothdeviceinfo_p.h41
-rw-r--r--src/bluetooth/qbluetoothglobal.h30
-rw-r--r--src/bluetooth/qbluetoothhostinfo.cpp30
-rw-r--r--src/bluetooth/qbluetoothhostinfo.h30
-rw-r--r--src/bluetooth/qbluetoothhostinfo_p.h41
-rw-r--r--src/bluetooth/qbluetoothlocaldevice.cpp30
-rw-r--r--src/bluetooth/qbluetoothlocaldevice.h30
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_android.cpp28
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_bluez.cpp28
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_p.cpp30
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_p.h39
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_qnx.cpp28
-rw-r--r--src/bluetooth/qbluetoothserver.cpp32
-rw-r--r--src/bluetooth/qbluetoothserver.h30
-rw-r--r--src/bluetooth/qbluetoothserver_android.cpp28
-rw-r--r--src/bluetooth/qbluetoothserver_bluez.cpp30
-rw-r--r--src/bluetooth/qbluetoothserver_p.cpp30
-rw-r--r--src/bluetooth/qbluetoothserver_p.h41
-rw-r--r--src/bluetooth/qbluetoothserver_qnx.cpp28
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent.cpp55
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent.h32
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_android.cpp36
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp145
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_p.cpp30
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_p.h42
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp69
-rw-r--r--src/bluetooth/qbluetoothserviceinfo.cpp30
-rw-r--r--src/bluetooth/qbluetoothserviceinfo.h30
-rw-r--r--src/bluetooth/qbluetoothserviceinfo_android.cpp28
-rw-r--r--src/bluetooth/qbluetoothserviceinfo_bluez.cpp30
-rw-r--r--src/bluetooth/qbluetoothserviceinfo_p.cpp30
-rw-r--r--src/bluetooth/qbluetoothserviceinfo_p.h41
-rw-r--r--src/bluetooth/qbluetoothserviceinfo_qnx.cpp28
-rw-r--r--src/bluetooth/qbluetoothsocket.cpp32
-rw-r--r--src/bluetooth/qbluetoothsocket.h32
-rw-r--r--src/bluetooth/qbluetoothsocket_android.cpp174
-rw-r--r--src/bluetooth/qbluetoothsocket_bluez.cpp52
-rw-r--r--src/bluetooth/qbluetoothsocket_p.cpp38
-rw-r--r--src/bluetooth/qbluetoothsocket_p.h71
-rw-r--r--src/bluetooth/qbluetoothsocket_qnx.cpp42
-rw-r--r--src/bluetooth/qbluetoothtransfermanager.cpp30
-rw-r--r--src/bluetooth/qbluetoothtransfermanager.h30
-rw-r--r--src/bluetooth/qbluetoothtransferreply.cpp30
-rw-r--r--src/bluetooth/qbluetoothtransferreply.h30
-rw-r--r--src/bluetooth/qbluetoothtransferreply_bluez.cpp30
-rw-r--r--src/bluetooth/qbluetoothtransferreply_bluez_p.h41
-rw-r--r--src/bluetooth/qbluetoothtransferreply_p.h41
-rw-r--r--src/bluetooth/qbluetoothtransferreply_qnx.cpp30
-rw-r--r--src/bluetooth/qbluetoothtransferreply_qnx_p.h39
-rw-r--r--src/bluetooth/qbluetoothtransferrequest.cpp30
-rw-r--r--src/bluetooth/qbluetoothtransferrequest.h30
-rw-r--r--src/bluetooth/qbluetoothtransferrequest_p.h41
-rw-r--r--src/bluetooth/qbluetoothuuid.cpp45
-rw-r--r--src/bluetooth/qbluetoothuuid.h28
-rw-r--r--src/bluetooth/qlowenergycharacteristic.cpp125
-rw-r--r--src/bluetooth/qlowenergycharacteristic.h28
-rw-r--r--src/bluetooth/qlowenergycontroller.cpp280
-rw-r--r--src/bluetooth/qlowenergycontroller.h39
-rw-r--r--src/bluetooth/qlowenergycontroller_bluez.cpp75
-rw-r--r--src/bluetooth/qlowenergycontroller_p.cpp42
-rw-r--r--src/bluetooth/qlowenergycontroller_p.h32
-rw-r--r--src/bluetooth/qlowenergydescriptor.cpp90
-rw-r--r--src/bluetooth/qlowenergydescriptor.h28
-rw-r--r--src/bluetooth/qlowenergyservice.cpp384
-rw-r--r--src/bluetooth/qlowenergyservice.h49
-rw-r--r--src/bluetooth/qlowenergyserviceinfo.cpp180
-rw-r--r--src/bluetooth/qlowenergyserviceinfo.h81
-rw-r--r--src/bluetooth/qlowenergyserviceinfo_p.h58
-rw-r--r--src/bluetooth/qlowenergyserviceprivate.cpp28
-rw-r--r--src/bluetooth/qlowenergyserviceprivate_p.h32
-rw-r--r--src/bluetooth/qnx/ppshelpers.cpp28
-rw-r--r--src/bluetooth/qnx/ppshelpers_p.h28
-rw-r--r--src/bluetooth/qprivatelinearbuffer_p.h41
117 files changed, 2730 insertions, 4433 deletions
diff --git a/src/bluetooth/android/androidbroadcastreceiver.cpp b/src/bluetooth/android/androidbroadcastreceiver.cpp
index c17502ba..2ddf56c5 100644
--- a/src/bluetooth/android/androidbroadcastreceiver.cpp
+++ b/src/bluetooth/android/androidbroadcastreceiver.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/android/androidbroadcastreceiver_p.h b/src/bluetooth/android/androidbroadcastreceiver_p.h
index 58c2b40b..347cd968 100644
--- a/src/bluetooth/android/androidbroadcastreceiver_p.h
+++ b/src/bluetooth/android/androidbroadcastreceiver_p.h
@@ -6,42 +6,46 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef JNIBROADCASTRECEIVER_H
#define JNIBROADCASTRECEIVER_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <jni.h>
#include <QtCore/QObject>
#include <android/log.h>
diff --git a/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp b/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp
index ca62f013..ee594c5c 100644
--- a/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp
+++ b/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/android/devicediscoverybroadcastreceiver_p.h b/src/bluetooth/android/devicediscoverybroadcastreceiver_p.h
index 6c08b22e..4ed7027d 100644
--- a/src/bluetooth/android/devicediscoverybroadcastreceiver_p.h
+++ b/src/bluetooth/android/devicediscoverybroadcastreceiver_p.h
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,6 +35,17 @@
#ifndef DEVICEDISCOVERYBROADCASTRECEIVER_H
#define DEVICEDISCOVERYBROADCASTRECEIVER_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "android/androidbroadcastreceiver_p.h"
#include <QtBluetooth/QBluetoothDeviceDiscoveryAgent>
diff --git a/src/bluetooth/android/inputstreamthread.cpp b/src/bluetooth/android/inputstreamthread.cpp
index 7f5029d9..98c245a7 100644
--- a/src/bluetooth/android/inputstreamthread.cpp
+++ b/src/bluetooth/android/inputstreamthread.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/android/inputstreamthread_p.h b/src/bluetooth/android/inputstreamthread_p.h
index 8b565cff..e7f7597e 100644
--- a/src/bluetooth/android/inputstreamthread_p.h
+++ b/src/bluetooth/android/inputstreamthread_p.h
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,6 +35,17 @@
#ifndef INPUTSTREAMTHREAD_H
#define INPUTSTREAMTHREAD_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QMutex>
#include <QtAndroidExtras/QAndroidJniObject>
diff --git a/src/bluetooth/android/jni_android.cpp b/src/bluetooth/android/jni_android.cpp
index b7221867..faeb411a 100644
--- a/src/bluetooth/android/jni_android.cpp
+++ b/src/bluetooth/android/jni_android.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/android/jni_android_p.h b/src/bluetooth/android/jni_android_p.h
index 9cddd2f9..0a90cfea 100644
--- a/src/bluetooth/android/jni_android_p.h
+++ b/src/bluetooth/android/jni_android_p.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef JNI_ANDROID_P_H
#define JNI_ANDROID_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtAndroidExtras/QAndroidJniEnvironment>
#include <QtAndroidExtras/QAndroidJniObject>
diff --git a/src/bluetooth/android/localdevicebroadcastreceiver.cpp b/src/bluetooth/android/localdevicebroadcastreceiver.cpp
index 5b7e4a38..c54c5e32 100644
--- a/src/bluetooth/android/localdevicebroadcastreceiver.cpp
+++ b/src/bluetooth/android/localdevicebroadcastreceiver.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/android/localdevicebroadcastreceiver_p.h b/src/bluetooth/android/localdevicebroadcastreceiver_p.h
index 4059b3bb..190ae631 100644
--- a/src/bluetooth/android/localdevicebroadcastreceiver_p.h
+++ b/src/bluetooth/android/localdevicebroadcastreceiver_p.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,6 +35,17 @@
#include <QtBluetooth/QBluetoothAddress>
#include <QtBluetooth/QBluetoothLocalDevice>
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#ifndef LOCALDEVICEBROADCASTRECEIVER_H
#define LOCALDEVICEBROADCASTRECEIVER_H
diff --git a/src/bluetooth/android/serveracceptancethread.cpp b/src/bluetooth/android/serveracceptancethread.cpp
index d46fff7c..cc639135 100644
--- a/src/bluetooth/android/serveracceptancethread.cpp
+++ b/src/bluetooth/android/serveracceptancethread.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/android/serveracceptancethread_p.h b/src/bluetooth/android/serveracceptancethread_p.h
index 18142d64..1adda433 100644
--- a/src/bluetooth/android/serveracceptancethread_p.h
+++ b/src/bluetooth/android/serveracceptancethread_p.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef SERVERACCEPTANCETHREAD_H
#define SERVERACCEPTANCETHREAD_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QMutex>
#include <QtAndroidExtras/QAndroidJniObject>
#include <QtBluetooth/QBluetoothServer>
diff --git a/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp b/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp
index 87564ce6..5ca9d59b 100644
--- a/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp
+++ b/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/android/servicediscoverybroadcastreceiver_p.h b/src/bluetooth/android/servicediscoverybroadcastreceiver_p.h
index e75095e8..273af121 100644
--- a/src/bluetooth/android/servicediscoverybroadcastreceiver_p.h
+++ b/src/bluetooth/android/servicediscoverybroadcastreceiver_p.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef SERVICEDISCOVERYBROADCASTRECEIVER_H
#define SERVICEDISCOVERYBROADCASTRECEIVER_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "android/androidbroadcastreceiver_p.h"
#include <QtCore/QList>
#include <QtBluetooth/QBluetoothDeviceDiscoveryAgent>
diff --git a/src/bluetooth/bluetooth.pro b/src/bluetooth/bluetooth.pro
index 98b4cce3..78d95a9c 100644
--- a/src/bluetooth/bluetooth.pro
+++ b/src/bluetooth/bluetooth.pro
@@ -23,7 +23,6 @@ PUBLIC_HEADERS += \
qbluetoothlocaldevice.h \
qbluetoothtransfermanager.h \
qbluetoothtransferrequest.h \
- qlowenergyserviceinfo.h \
qlowenergyservice.h \
qlowenergycharacteristic.h \
qlowenergydescriptor.h \
@@ -43,7 +42,6 @@ PRIVATE_HEADERS += \
qbluetoothtransferrequest_p.h \
qprivatelinearbuffer_p.h \
qbluetoothlocaldevice_p.h \
- qlowenergyserviceinfo_p.h \
qlowenergycontroller_p.h \
qlowenergyserviceprivate_p.h
@@ -62,7 +60,6 @@ SOURCES += \
qbluetoothtransfermanager.cpp \
qbluetoothtransferrequest.cpp \
qbluetoothtransferreply.cpp \
- qlowenergyserviceinfo.cpp \
qlowenergyservice.cpp \
qlowenergycharacteristic.cpp \
qlowenergydescriptor.cpp \
diff --git a/src/bluetooth/bluez/bluez5_helper.cpp b/src/bluetooth/bluez/bluez5_helper.cpp
index 4e810d55..eebeae9d 100644
--- a/src/bluetooth/bluez/bluez5_helper.cpp
+++ b/src/bluetooth/bluez/bluez5_helper.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/bluez/bluez5_helper_p.h b/src/bluetooth/bluez/bluez5_helper_p.h
index 4bec440e..7935877c 100644
--- a/src/bluetooth/bluez/bluez5_helper_p.h
+++ b/src/bluetooth/bluez/bluez5_helper_p.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/bluez/bluez_data_p.h b/src/bluetooth/bluez/bluez_data_p.h
index 70b80ec3..743f09dc 100644
--- a/src/bluetooth/bluez/bluez_data_p.h
+++ b/src/bluetooth/bluez/bluez_data_p.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef BLUEZ_DATA_P_H
#define BLUEZ_DATA_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#include <sys/socket.h>
#include <QtBluetooth/QBluetoothUuid>
@@ -66,6 +69,7 @@
#define L2CAP_LM_SECURE 0x0020
#define BDADDR_LE_PUBLIC 0x01
+#define BDADDR_LE_RANDOM 0x02
/* Byte order conversions */
#if __BYTE_ORDER == __LITTLE_ENDIAN
diff --git a/src/bluetooth/bluez/servicemap.cpp b/src/bluetooth/bluez/servicemap.cpp
index bb2c9978..411eb6d8 100644
--- a/src/bluetooth/bluez/servicemap.cpp
+++ b/src/bluetooth/bluez/servicemap.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/bluez/servicemap_p.h b/src/bluetooth/bluez/servicemap_p.h
index 3e7f17ba..6ae3afb3 100644
--- a/src/bluetooth/bluez/servicemap_p.h
+++ b/src/bluetooth/bluez/servicemap_p.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef SERVICEMAP_P_H
#define SERVICEMAP_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtDBus/QDBusArgument>
diff --git a/src/bluetooth/doc/images/peripheral-structure.png b/src/bluetooth/doc/images/peripheral-structure.png
new file mode 100644
index 00000000..a42c74da
--- /dev/null
+++ b/src/bluetooth/doc/images/peripheral-structure.png
Binary files differ
diff --git a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp
index c0c0f61a..70e1f629 100644
--- a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp
+++ b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp
@@ -51,6 +51,10 @@
#include <QtBluetooth/QBluetoothTransferRequest>
#include <QtBluetooth/QBluetoothTransferReply>
+#include <QtBluetooth/QLowEnergyController>
+#include <QtBluetooth/QLowEnergyService>
+#include <QtBluetooth/QLowEnergyCharacteristic>
+
//! [namespace]
QT_USE_NAMESPACE
//! [namespace]
@@ -64,11 +68,14 @@ public:
void startDeviceDiscovery();
void startServiceDiscovery();
void objectPush();
+ void btleSharedData();
+ void enableCharNotifications();
public slots:
void deviceDiscovered(const QBluetoothDeviceInfo &device);
void serviceDiscovered(const QBluetoothServiceInfo &service);
void transferFinished(QBluetoothTransferReply* reply);
+ void characteristicChanged(const QLowEnergyCharacteristic& ,const QByteArray&);
};
void MyClass::localDevice() {
@@ -166,6 +173,78 @@ void MyClass::transferFinished(QBluetoothTransferReply* /*reply*/)
{
}
+void MyClass::characteristicChanged(const QLowEnergyCharacteristic &, const QByteArray &)
+{
+}
+
+void MyClass::btleSharedData()
+{
+ QBluetoothAddress remoteDevice;
+
+//! [data_share_qlowenergyservice]
+ QLowEnergyService *first, *second;
+ QLowEnergyController control(remoteDevice);
+ control.connectToDevice();
+
+ // waiting for connection
+
+ first = control.createServiceObject(QBluetoothUuid::BatteryService);
+ second = control.createServiceObject(QBluetoothUuid::BatteryService);
+ Q_ASSERT(first->state() == QLowEnergyService::DiscoveryRequired);
+ Q_ASSERT(first->state() == second->state());
+
+ first->discoverDetails();
+
+ Q_ASSERT(first->state() == QLowEnergyService::DiscoveringServices);
+ Q_ASSERT(first->state() == second->state());
+//! [data_share_qlowenergyservice]
+}
+
+void MyClass::enableCharNotifications()
+{
+ QBluetoothAddress remoteDevice;
+ QLowEnergyService *service;
+ QLowEnergyController *control = new QLowEnergyController(remoteDevice, this);
+ control->connectToDevice();
+
+
+ service = control->createServiceObject(QBluetoothUuid::BatteryService, this);
+ if (!service)
+ return;
+
+ service->discoverDetails();
+
+ //... wait until discovered
+
+//! [enable_btle_notifications]
+ //PreCondition: service details already discovered
+ QLowEnergyCharacteristic batteryLevel = service->characteristic(
+ QBluetoothUuid::BatteryLevel);
+ if (!batteryLevel.isValid())
+ return;
+
+ QLowEnergyDescriptor notification = batteryLevel.descriptor(
+ QBluetoothUuid::ClientCharacteristicConfiguration);
+ if (!notification.isValid())
+ return;
+
+ // establish hook into notifications
+ connect(service, SIGNAL(characteristicChanged(QLowEnergyCharacteristic,QByteArray)),
+ this, SLOT(characteristicChanged(QLowEnergyCharacteristic,QByteArray)));
+
+ // enable notification
+ service->writeDescriptor(notification, QByteArray::fromHex("0100"));
+
+ // disable notification
+ //service->writeDescriptor(notification, QByteArray::fromHex("0000"));
+
+ // wait until descriptorWritten() signal is emitted
+ // to confirm successful write
+//! [enable_btle_notifications]
+}
+
+
+
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
diff --git a/src/bluetooth/doc/src/bluetooth-index.qdoc b/src/bluetooth/doc/src/bluetooth-index.qdoc
index afdf2600..9e691613 100644
--- a/src/bluetooth/doc/src/bluetooth-index.qdoc
+++ b/src/bluetooth/doc/src/bluetooth-index.qdoc
@@ -35,7 +35,9 @@ The Bluetooth API provides connectivity between Bluetooth enabled devices.
Currently the API is supported on \l{Qt for Android}{Android},
\l{Qt for BlackBerry}{BlackBerry 10} and
-\l{Qt for Linux/X11}{Linux} (\l{http://www.bluez.org}{Bluez 4.x}).
+\l{Qt for Linux/X11}{Linux} (\l{http://www.bluez.org}{BlueZ 4.x/5.x}).
+
+
\section1 Overview
@@ -45,6 +47,12 @@ for transferring data between devices. Bluetooth connectivity is based on
basic device management, such as scanning for devices, gathering information
about them, and exchanging data between them.
+This Qt release contains a Technology Preview of the new Qt Bluetooth
+Low Energy API. Further details can be found in the
+\l {Bluetooth Low Energy Overview}{Bluetooth Low Energy Overview} section.
+The Tech Preview supports BlueZ 4 & 5 based Linux systems. Support for
+further platforms is being planned.
+
\section1 Getting started
To use the C++ library in your application, add the following configuration
@@ -61,7 +69,8 @@ import statement in your \c .qml file:
\section2 Guides
\list
- \li \l {Qt Bluetooth Overview}
+ \li \l {Qt Bluetooth Overview}{Classic Bluetooth Overview}
+ \li \l {Bluetooth Low Energy Overview} (Tech Preview)
\endlist
\section2 Reference
@@ -77,8 +86,8 @@ import statement in your \c .qml file:
\li \l {scanner}{QML Bluetooth Scanner}
\li \l {picturetransfer}{QML Bluetooth Picture Push}
\li \l {pingpong}{QML Bluetooth PingPong}
+ \li \l {heartlistener}{Bluetooth Low Energy Heart Listener}
\li \l {lowenergyscanner}{Bluetooth Low Energy Scanner}
- \li \l {heartlistener}{Heart Listener}
\endlist
\li C++
\list
diff --git a/src/bluetooth/doc/src/bluetooth-le-overview.qdoc b/src/bluetooth/doc/src/bluetooth-le-overview.qdoc
new file mode 100644
index 00000000..958e623d
--- /dev/null
+++ b/src/bluetooth/doc/src/bluetooth-le-overview.qdoc
@@ -0,0 +1,254 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt local connectivty modules.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\ingroup technology-apis
+\title Bluetooth Low Energy Overview
+\page qtbluetooth-le-overview.html
+\brief The Qt Bluetooth Low Energy API enables communication between Bluetooth
+Low Energy devices.
+
+\tableofcontents
+
+ \section1 Technology Preview
+
+ The Qt Bluetooth Low Energy API has been introduced in Qt 5.4.
+ The API is considered to be a preview of the technology and currently only works
+ on BlueZ 4 & 5 based Linux systems. Support for further platforms, for example Android,
+ is currently being worked on and will be added by later Qt releases. In addition,
+ Qt only supports the central role. For more details on this limitation see below.
+
+ While the API is not yet frozen it is close to its final stage.
+ We would like to encourage you to send us feedback and bug reports related to
+ this new feature.
+
+ \section1 What Is Bluetooth Low Energy
+
+ Bluetooth Low Energy, also known as Bluetooth Smart, is a wireless computer
+ network technology, which was officially introduced in 2011. It works on the same
+ 2.4 GHz frequency as ”classic” Bluetooth. The main difference is, as stated by its technology name,
+ low energy consumption. It provides an opportunity for Bluetooth Low Energy devices to
+ operate for months, even years, on coin-cell batteries. The technology was introduced by
+ \l {https://www.bluetooth.org/en-us/specification/adopted-specifications}{Bluetooth v4.0}.
+ Devices which support this technology are called Bluetooth Smart Ready Devices.
+ The key features of the technology are:
+
+ \list
+ \li Ultra-low peak, average and idle mode power consumption
+ \li Ability to run for years on standard, coin-cell batteries
+ \li Low cost
+ \li Multi-vendor interoperability
+ \li Enhanced range
+ \endlist
+
+ Bluetooth Low Energy uses a client-server architecture. The server (also
+ known as peripheral) offers services such as temperature or heart rate
+ and advertises them. The client (known as central
+ device) connects to the server and reads the values advertised by the server.
+ An example might be an apartment with Bluetooth Smart Ready sensors such
+ as a thermostat, humidity or pressure sensor. Those sensors are peripheral
+ devices advertising the environment values of the apartment. At the same time
+ a mobile phone or computer might connect to those sensors, retrieve their
+ values and present them as part of a larger environment control application
+ to the user.
+
+ \section1 Basic Service Structure
+
+ Bluetooth Low Energy is based on two protocols: ATT (Attribute Protocol)
+ and GATT (Generic Attribute Profile). They specify the communication layers
+ used by every Bluetooth Smart Ready device.
+
+ \section2 ATT Protocol
+
+ The basic building block of ATT is an \e attribute. Each attribute consists of
+ three elements:
+
+ \list
+ \li a value - the payload or desirable piece of information
+ \li a UUID - the type of attribute (used by GATT)
+ \li a 16-bit handle - a unique identifier for the attribute
+ \endlist
+
+ The server stores the attributes and the client uses the ATT protocol to
+ read and write values on the server.
+
+ \section2 GATT Profile
+
+ GATT defines grouping for a set of attributes by applying a meaning to predefined
+ UUIDs. The table below shows an example service exposing a heart rate
+ on a particular day. The actual values are stored inside the two characteristics:
+
+ \table
+ \header
+ \li Handle
+ \li UUID
+ \li Value
+ \li Description
+ \row
+ \li 0x0001
+ \li 0x2800
+ \li UUID 0x180D
+ \li Begin Heart Rate service
+ \row
+ \li 0x0002
+ \li 0x2803
+ \li UUID 0x2A37, Value handle: 0x0003
+ \li Characteristic of type \e {Heart Rate Measurement (HRM)}
+ \row
+ \li 0x0003
+ \li 0x2A37
+ \li 65 bpm
+ \li Heart rate value
+ \row
+ \li 0x0004
+ \li 0x2803
+ \li UUID 0x2A08, Value handle: 0x0006
+ \li Characteristic of type Date Time
+ \row
+ \li 0x0005
+ \li 0x2A08
+ \li 18/08/2014 11:00
+ \li Date and Time of the measurement
+ \row
+ \li 0x0006
+ \li 0x2800
+ \li UUID xxxxxx
+ \li Begin next service
+ \row
+ \li ...
+ \li ...
+ \li ...
+ \li ...
+ \endtable
+
+ GATT specifies that the above used UUID \c 0x2800 marks the begin of a service definition.
+ Every attribute following \c 0x2800 is part of the service until the next \c 0x2800 or the
+ end is encountered. In similar ways the well known UUID \c 0x2803 states that a characteristic
+ is to be found and each of the characteristics has a type defining the nature of the value.
+ The example above uses the UUIDs \c 0x2A08 (Date Time) and \c 0x2A37 (Heart Rate Measurement).
+ Each of the above UUIDs is defined by the \l {https://bluetooth.org}{Bluetooth Special Interest Group}.
+ and can be found in the
+ \l{https://developer.bluetooth.org/gatt/Pages/default.aspx}{GATT specification}. While it
+ is advisable to use pre-defined UUIDs where available it is entirely possible to use new and not
+ yet used UUIDs for characteristic and service types.
+
+ In general, each service may consist of one or more characteristics. A characteristic
+ contains data and can be further described by descriptors, which provide additional
+ information or means of manipulating the characteristic. All services, characteristics and
+ descriptors are recognized by their 128-bit UUID. Finally, it is possible to include
+ services inside of services (see picture below).
+
+ \image peripheral-structure.png
+
+ \section1 Using Qt Bluetooth Low Energy API
+
+ This section describes how to use the Bluetooth Low Energy API provided by Qt. Currently the API
+ permits creating connections to peripheral devices, discovering their services, as well as reading
+ and writing data stored on the device. The example code below is taken from the
+ \l {heartlistener}{Heart Listener} example.
+
+ \note As of Qt 5.4 the Qt Bluetooth Low Energy API is in tech preview mode and supports Linux
+ with BlueZ 4 & 5. Only the last versions of Bluez 4.x (v 4.101 confirmed to work) and Linux kernels
+ from version 3.5 onwards support this feature.
+
+ \section2 Establishing a Connection
+
+ To be able to read and write the characteristics of the Bluetooth Low Energy peripheral device,
+ it is necessary to find and connect the device. This requires the peripheral device to advertise
+ its presence and services. We start the device discovery with the help of the
+ \l QBluetoothDeviceDiscoveryAgent class. We connect to its \l {QBluetoothDeviceDiscoveryAgent::deviceDiscovered()}
+ signal and start the search with \l {QBluetoothDeviceDiscoveryAgent::start()}{start()}:
+
+ \snippet heartlistener/heartrate.cpp devicediscovery-1
+ \snippet heartlistener/heartrate.cpp devicediscovery-2
+
+ Since we are only interested in Low Energy devices we filter the device type within the
+ receiving slot. The device type can be ascertained using the \l QBluetoothDeviceInfo::coreConfigurations()
+ flag:
+
+ \snippet heartlistener/heartrate.cpp devicediscovery-3
+ \snippet heartlistener/heartrate.cpp devicediscovery-4
+
+ Once the address of the peripheral device is known we use the \l QLowEnergyController class.
+ This class is the entry point for all Bluetooth Low Energy development. The constructor of the class
+ accepts the remote device's \l QBluetoothAddress. Finally we set up the customary slots and
+ directly connect to the device using
+ \l {QLowEnergyController::connectToDevice()}{connectToDevice()}:
+
+ \snippet heartlistener/heartrate.cpp Connect signals
+
+ \section2 Service Search
+
+ As soon as the connection is established we initiate the service discovery:
+
+ \snippet heartlistener/heartrate.cpp Connecting to service
+
+ The \c serviceDiscovered() slot below is triggered as a result of the
+ \l {QLowEnergyController::serviceDiscovered()} signal and provides an intermittent progress report.
+ Since we are talking about the heart listener app which monitors HeartRate devices in the vicinity
+ we ignore any service that is not of type \l QBluetoothUuid::HeartRate.
+
+ \snippet heartlistener/heartrate.cpp Filter HeartRate service 1
+
+ Eventually the \l {QLowEnergyController::discoveryFinished()} signal is emitted to indicate
+ the successful completion of the service discovery. Provided a HeartRate service was found,
+ a \l QLowEnergyService instance is created to represent the service. The returned service object
+ provides the required signals for update notifications and the discovery of service details
+ is triggered using \l QLowEnergyService::discoverDetails():
+
+ \snippet heartlistener/heartrate.cpp Filter HeartRate service 2
+
+ During the detail search the service's \l {QLowEnergyService::state()}{state()} transitions
+ from \l {QLowEnergyService::DiscoveryRequired}{DiscoveryRequired} to
+ \l {QLowEnergyService::DiscoveringServices}{DiscoveringServices} and eventually ends with
+ \l {QLowEnergyService::ServiceDiscovered}{ServiceDiscovered}:
+
+ \snippet heartlistener/heartrate.cpp Find HRM characteristic
+
+ \section2 Interaction with the Peripheral Device
+
+ In the code example above, the desired characteristic is of type
+ \l {QBluetoothUuid::HeartRateMeasurement}{HeartRateMeasurement}. Since the application measures
+ the heart rate changes, it must enable change notifications for the characteristic.
+ Note that not all characteristics provide change notifications. Since the HeartRate characteristic
+ has been standardized it is possible to assume that notifications can be received. Ultimately
+ \l QLowEnergyCharacteristic::properties() must have the \l {QLowEnergyCharacteristic::Notify} flag
+ set and a descriptor of type \l {QBluetoothUuid::ClientCharacteristicConfiguration} must exist to confirm
+ the availability of an appropriate notification.
+
+ Finally, we process the value of the HeartRate characteristic, as per Bluetooth Low Energy standard:
+
+ \snippet heartlistener/heartrate.cpp Reading value 1
+ \snippet heartlistener/heartrate.cpp Reading value 2
+
+ In general a characteristic value is a series of bytes. The precise interpretation of
+ those bytes depends on the characteristic type and value structure.
+ A significant number has been standardized by the
+ \l {https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx}{Bluetooth SIG} whereas others
+ may follow a custom protocol. The above code snippet demonstrates how to the read the standardized
+ HeartRate value.
+*/
diff --git a/src/bluetooth/doc/src/bluetooth-overview.qdoc b/src/bluetooth/doc/src/bluetooth-overview.qdoc
index e20a1d22..81d6270a 100644
--- a/src/bluetooth/doc/src/bluetooth-overview.qdoc
+++ b/src/bluetooth/doc/src/bluetooth-overview.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt local connectivty modules.
@@ -109,64 +109,7 @@
\section1 Bluetooth Low Energy
- Bluetooth Low Energy (in later text BLE), also known as Bluetooth Smart is a wireless computer
- network technology, which was officially introduced in 2011. It works at the same,
- 2,4HGz frequency, as ”classic” Bluetooth. The main difference is, as stated by its technology name,
- low energy consumption. It provides an opportunity for BLE devices to operate for months,
- even years, on coin-cell batteries. This technology was introduced with Bluetooth v 4.0
- and devices which support this technology are called Bluetooth Smart Ready Devices.
- The key features of technology are:
- \list
- \li Ultra-low peak, average and idle mode power consumption
- \li Ability to run for years on standard, coin-cell batteries
- \li Low cost
- \li Multi-vendor interoperability
- \li Enhanced range
- \endlist
-
- BLE uses a client-server architecture. The server (BLE device) offers services (temperature,
- heart rate or any other measurements) and advertises them. The client (PC, smartphone
- or any other Bluetooth Smart Ready device) connects to the server and reads the values
- advertised by the server. The BLE API is based on GATT (Generic Attribute Profile) concepts.
- GATT commands are initiated by the client, and the server processes them. Each command is
- usually answered by a reply.
-
- Each BLE service may consist of one or more characteristics. A characteristic
- contains data and can be further described by descriptors, which provide additional
- information or means of manipulating the characteristic. All services, characteristics and
- descriptors are recognized by their 128bits UUIDs. Further details on known uuids can be found
- in \l QBluetoothUuid.
-
- To be able to read and write characteristics, it is necessary to connect to the LE service.
-
- \snippet heartlistener/heartrate.cpp Connect signals
-
- We start a service discovery with a \l QBluetoothServiceDiscoveryAgent class and connect its
- \l {QBluetoothServiceDiscoveryAgent::}{serviceDiscovered()} signal. Within the receiving slot we connect to the desired service.
- \l QLowEnergyController is used to connect or disconnect to services, emits service-related value changes
- and propagates errors in relation to the service management.
-
- Even though it is possible to connect to an LE service before the service scan is done,
- it is advisable to delay until after the service search has finished.
-
- \snippet heartlistener/heartrate.cpp Connecting to service
-
- In the code example above, the desired characteristics is of type
- \l {QBluetoothUuid::HeartRateMeasurement}{HeartRateMeasurement}. Since the application measures
- the heart rate changes, it must enable change notifications for the characteristic.
- Note that not all characteristics provide change notifications. Since the HeartRate characteristic
- has been standardized it is possible to assume that notifications can be received. Ultimately
- \l QLowEnergyCharacteristicInfo::isNotificationCharacteristic() must return \c true to
- verify the availability of notifications.
-
- Finally, we process the value of the HeartRate characteristic, as per Bluetooth Low Energy standard:
-
- \snippet heartlistener/heartrate.cpp Reading value
-
- In general a characterisitic value is a series of hexadecimal numbers. The precise interpretation of
- those hexadecimal numbers depends on the characteristic type and its value structure.
- A significant number has been standardized by the
- \l {https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx}{Bluetooth SIG} whereas others
- may follow a custom protocol. The above code snippet demonstrates how to the read the standardized
- HeartRate value.
+ Bluetooth Low Energy, also known as Bluetooth Smart, is a new technology enabling
+ devices with low energy consumption to communicate with each other. More details about
+ this technology and the related Qt APIs can be found in the \l {Bluetooth Low Energy Overview}.
*/
diff --git a/src/bluetooth/gatoattclient.cpp b/src/bluetooth/gatoattclient.cpp
deleted file mode 100644
index abf3a760..00000000
--- a/src/bluetooth/gatoattclient.cpp
+++ /dev/null
@@ -1,617 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Javier de San Pedro <dev.git@javispedro.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: 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.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/QDataStream>
-#include <QtCore/QDebug>
-
-#include "gatoattclient.h"
-#include "helpers.h"
-
-#define PROTOCOL_DEBUG 0
-
-#define ATT_CID 4
-#define ATT_PSM 31
-
-#define ATT_DEFAULT_LE_MTU 23
-#define ATT_MAX_LE_MTU 0x200
-
-QT_BEGIN_NAMESPACE
-
-enum AttOpcode {
- AttOpNone = 0,
- AttOpErrorResponse = 0x1,
- AttOpExchangeMTURequest = 0x2,
- AttOpExchangeMTUResponse = 0x3,
- AttOpFindInformationRequest = 0x4,
- AttOpFindInformationResponse = 0x5,
- AttOpFindByTypeValueRequest = 0x6,
- AttOpFindByTypeValueResponse = 0x7,
- AttOpReadByTypeRequest = 0x8,
- AttOpReadByTypeResponse = 0x9,
- AttOpReadRequest = 0xA,
- AttOpReadResponse = 0xB,
- AttOpReadBlobRequest = 0xC,
- AttOpReadBlobResponse = 0xD,
- AttOpReadMultipleRequest = 0xE,
- AttOpReadMultipleResponse = 0xF,
- AttOpReadByGroupTypeRequest = 0x10,
- AttOpReadByGroupTypeResponse = 0x11,
- AttOpWriteRequest = 0x12,
- AttOpWriteResponse = 0x13,
- AttOpWriteCommand = 0x52,
- AttOpPrepareWriteRequest = 0x16,
- AttOpPrepareWriteResponse = 0x17,
- AttOpExecuteWriteRequest = 0x18,
- AttOpExecuteWriteResponse = 0x19,
- AttOpHandleValueNotification = 0x1B,
- AttOpHandleValueIndication = 0x1D,
- AttOpHandleValueConfirmation = 0x1E,
- AttOpSignedWriteCommand = 0xD2
-};
-
-static QByteArray remove_method_signature(const char *sig)
-{
- const char* bracketPosition = strchr(sig, '(');
- if (!bracketPosition || !(sig[0] >= '0' && sig[0] <= '3')) {
- qWarning("Invalid slot specification");
- return QByteArray();
- }
- return QByteArray(sig + 1, bracketPosition - 1 - sig);
-}
-
-GatoAttClient::GatoAttClient(QObject *parent) :
- QObject(parent), socket(new GatoSocket(this)), cur_mtu(ATT_DEFAULT_LE_MTU), next_id(1)
-{
- connect(socket, SIGNAL(connected()), SLOT(handleSocketConnected()));
- connect(socket, SIGNAL(disconnected()), SLOT(handleSocketDisconnected()));
- connect(socket, SIGNAL(readyRead()), SLOT(handleSocketReadyRead()));
-}
-
-GatoAttClient::~GatoAttClient()
-{
-}
-
-GatoSocket::State GatoAttClient::state() const
-{
- return socket->state();
-}
-
-bool GatoAttClient::connectTo(const GatoAddress &addr)
-{
- return socket->connectTo(addr, ATT_CID);
-}
-
-void GatoAttClient::close()
-{
- socket->close();
-}
-
-int GatoAttClient::mtu() const
-{
- return cur_mtu;
-}
-
-uint GatoAttClient::request(int opcode, const QByteArray &data, QObject *receiver, const char *member)
-{
- Request req;
- req.id = next_id++;
- req.opcode = opcode;
- req.pkt = data;
- req.pkt.prepend(static_cast<char>(opcode));
- req.receiver = receiver;
- req.member = remove_method_signature(member);
-
- pending_requests.enqueue(req);
-
- if (pending_requests.size() == 1) {
- // So we can just send this request instead of waiting for others to complete
- sendARequest();
- }
-
- return req.id;
-}
-
-void GatoAttClient::cancelRequest(uint id)
-{
- QQueue<Request>::iterator it = pending_requests.begin();
- while (it != pending_requests.end()) {
- if (it->id == id) {
- it = pending_requests.erase(it);
- } else {
- ++it;
- }
- }
-}
-
-uint GatoAttClient::requestExchangeMTU(quint16 client_mtu, QObject *receiver, const char *member)
-{
- QByteArray data;
- QDataStream s(&data, QIODevice::WriteOnly);
- s.setByteOrder(QDataStream::LittleEndian);
- s << client_mtu;
-
- return request(AttOpExchangeMTURequest, data, receiver, member);
-}
-
-uint GatoAttClient::requestFindInformation(GatoHandle start, GatoHandle end, QObject *receiver, const char *member)
-{
- QByteArray data;
- QDataStream s(&data, QIODevice::WriteOnly);
- s.setByteOrder(QDataStream::LittleEndian);
- s << start << end;
-
- return request(AttOpFindInformationRequest, data, receiver, member);
-}
-
-uint GatoAttClient::requestFindByTypeValue(GatoHandle start, GatoHandle end, const GatoUUID &uuid, const QByteArray &value, QObject *receiver, const char *member)
-{
- QByteArray data;
- QDataStream s(&data, QIODevice::WriteOnly);
- s.setByteOrder(QDataStream::LittleEndian);
- s << start << end;
-
- bool uuid16_ok;
- quint16 uuid16 = uuid.toUInt16(&uuid16_ok);
- if (uuid16_ok) {
- s << uuid16;
- } else {
- qWarning() << "FindByTypeValue does not support UUIDs other than UUID16";
- return -1;
- }
-
- s << value;
-
- return request(AttOpFindByTypeValueRequest, data, receiver, member);
-}
-
-uint GatoAttClient::requestReadByType(GatoHandle start, GatoHandle end, const GatoUUID &uuid, QObject *receiver, const char *member)
-{
- QByteArray data;
- QDataStream s(&data, QIODevice::WriteOnly);
- s.setByteOrder(QDataStream::LittleEndian);
- s << start << end;
- write_gatouuid(s, uuid, true, false);
-
- return request(AttOpReadByTypeRequest, data, receiver, member);
-}
-
-uint GatoAttClient::requestRead(GatoHandle handle, QObject *receiver, const char *member)
-{
- QByteArray data;
- QDataStream s(&data, QIODevice::WriteOnly);
- s.setByteOrder(QDataStream::LittleEndian);
- s << handle;
-
- return request(AttOpReadRequest, data, receiver, member);
-}
-
-uint GatoAttClient::requestReadByGroupType(GatoHandle start, GatoHandle end, const GatoUUID &uuid, QObject *receiver, const char *member)
-{
- QByteArray data;
- QDataStream s(&data, QIODevice::WriteOnly);
- s.setByteOrder(QDataStream::LittleEndian);
- s << start << end;
- write_gatouuid(s, uuid, true, false);
-
- return request(AttOpReadByGroupTypeRequest, data, receiver, member);
-}
-
-uint GatoAttClient::requestWrite(GatoHandle handle, const QByteArray &value, QObject *receiver, const char *member)
-{
- QByteArray data;
- QDataStream s(&data, QIODevice::WriteOnly);
- s.setByteOrder(QDataStream::LittleEndian);
- s << handle;
- s.writeRawData(value.constData(), value.length());
-
- return request(AttOpWriteRequest, data, receiver, member);
-}
-
-void GatoAttClient::command(int opcode, const QByteArray &data)
-{
- QByteArray packet = data;
- packet.prepend(static_cast<char>(opcode));
-
- socket->send(packet);
-
-#if PROTOCOL_DEBUG
- qDebug() << "Wrote" << packet.size() << "bytes (command)" << packet.toHex();
-#endif
-}
-
-void GatoAttClient::commandWrite(GatoHandle handle, const QByteArray &value)
-{
- QByteArray data;
- QDataStream s(&data, QIODevice::WriteOnly);
- s.setByteOrder(QDataStream::LittleEndian);
- s << handle;
- s.writeRawData(value.constData(), value.length());
-
- command(AttOpWriteCommand, data);
-}
-
-void GatoAttClient::sendARequest()
-{
- if (pending_requests.isEmpty()) {
- return;
- }
-
- Request &req = pending_requests.head();
- socket->send(req.pkt);
-
-#if PROTOCOL_DEBUG
- qDebug() << "Wrote" << req.pkt.size() << "bytes (request)" << req.pkt.toHex();
-#endif
-}
-
-bool GatoAttClient::handleEvent(const QByteArray &event)
-{
- const char *data = event.constData();
- quint8 opcode = event[0];
- GatoHandle handle;
-
- switch (opcode) {
- case AttOpHandleValueNotification:
- handle = read_le<GatoHandle>(&data[1]);
- emit attributeUpdated(handle, event.mid(3), false);
- return true;
- case AttOpHandleValueIndication:
- handle = read_le<GatoHandle>(&data[1]);
-
- // Send the confirmation back
- command(AttOpHandleValueConfirmation, QByteArray());
-
- emit attributeUpdated(handle, event.mid(3), true);
- return true;
- default:
- return false;
- }
-}
-
-bool GatoAttClient::handleResponse(const Request &req, const QByteArray &response)
-{
- // If we know the request, we can provide a decoded answer
- switch (req.opcode) {
- case AttOpExchangeMTURequest:
- if (response[0] == AttOpExchangeMTUResponse) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(quint16, read_le<quint16>(response.constData() + 1)));
- }
- return true;
- } else if (response[0] == AttOpErrorResponse && response[1] == AttOpExchangeMTURequest) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(quint16, 0));
- }
- return true;
- } else {
- return false;
- }
- break;
- case AttOpFindInformationRequest:
- if (response[0] == AttOpFindInformationResponse) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(QList<GatoAttClient::InformationData>, parseInformationData(response.mid(1))));
- }
- return true;
- } else if (response[0] == AttOpErrorResponse && response[1] == AttOpFindInformationRequest) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(QList<GatoAttClient::InformationData>, QList<InformationData>()));
- }
- return true;
- } else {
- return false;
- }
- break;
- case AttOpFindByTypeValueRequest:
- if (response[0] == AttOpFindByTypeValueResponse) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(QList<GatoAttClient::HandleInformation>, parseHandleInformation(response.mid(1))));
- }
- return true;
- } else if (response[0] == AttOpErrorResponse && response[1] == AttOpFindByTypeValueRequest) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(QList<GatoAttClient::HandleInformation>, QList<HandleInformation>()));
- }
- return true;
- } else {
- return false;
- }
- break;
- case AttOpReadByTypeRequest:
- if (response[0] == AttOpReadByTypeResponse) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(QList<GatoAttClient::AttributeData>, parseAttributeData(response.mid(1))));
- }
- return true;
- } else if (response[0] == AttOpErrorResponse && response[1] == AttOpReadByTypeRequest) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(QList<GatoAttClient::AttributeData>, QList<AttributeData>()));
- }
- return true;
- } else {
- return false;
- }
- break;
- case AttOpReadRequest:
- if (response[0] == AttOpReadResponse) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(QByteArray, response.mid(1)));
- }
- return true;
- } else if (response[0] == AttOpErrorResponse && response[1] == AttOpReadRequest) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(QByteArray, QByteArray()));
- }
- return true;
- } else {
- return false;
- }
- break;
- case AttOpReadByGroupTypeRequest:
- if (response[0] == AttOpReadByGroupTypeResponse) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(QList<GatoAttClient::AttributeGroupData>, parseAttributeGroupData(response.mid(1))));
- }
- return true;
- } else if (response[0] == AttOpErrorResponse && response[1] == AttOpReadByGroupTypeRequest) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(QList<GatoAttClient::AttributeGroupData>, QList<AttributeGroupData>()));
- }
- return true;
- } else {
- return false;
- }
- break;
- case AttOpWriteRequest:
- if (response[0] == AttOpWriteResponse) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(bool, true));
- }
- return true;
- } else if (response[0] == AttOpErrorResponse && response[1] == AttOpWriteRequest) {
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(uint, req.id),
- Q_ARG(bool, false));
- }
- return true;
- } else {
- return false;
- }
- break;
- default: // Otherwise just send a QByteArray.
- if (req.receiver) {
- QMetaObject::invokeMethod(req.receiver, req.member.constData(),
- Q_ARG(const QByteArray&, response));
- }
- return true;
- }
-}
-
-QList<GatoAttClient::InformationData> GatoAttClient::parseInformationData(const QByteArray &data)
-{
- const int format = data[0];
- QList<InformationData> list;
- int item_len;
-
- switch (format) {
- case 1:
- item_len = 2 + 2;
- break;
- case 2:
- item_len = 2 + 16;
- break;
- default:
- qWarning() << "Unknown InformationData format!";
- return list;
- }
-
- int items = (data.size() - 1) / item_len;
- list.reserve(items);
-
- int pos = 1;
- const char *s = data.constData();
- for (int i = 0; i < items; i++) {
- InformationData d;
- QByteArray uuid;
- d.handle = read_le<GatoHandle>(&s[pos]);
- switch (format) {
- case 1:
- uuid = data.mid(pos + 2, 2);
- break;
- case 2:
- uuid = data.mid(pos + 2, 16);
- break;
- }
- d.uuid = bytearray_to_gatouuid(uuid);
-
- list.append(d);
-
- pos += item_len;
- }
-
- return list;
-}
-
-QList<GatoAttClient::HandleInformation> GatoAttClient::parseHandleInformation(const QByteArray &data)
-{
- const int item_len = 2;
- const int items = data.size() / item_len;
- QList<HandleInformation> list;
- list.reserve(items);
-
- int pos = 0;
- const char *s = data.constData();
- for (int i = 0; i < items; i++) {
- HandleInformation d;
- d.start = read_le<GatoHandle>(&s[pos]);
- d.end = read_le<GatoHandle>(&s[pos + 2]);
- list.append(d);
-
- pos += item_len;
- }
-
- return list;
-}
-
-QList<GatoAttClient::AttributeData> GatoAttClient::parseAttributeData(const QByteArray &data)
-{
- const int item_len = data[0];
- const int items = (data.size() - 1) / item_len;
- QList<AttributeData> list;
- list.reserve(items);
-
- int pos = 1;
- const char *s = data.constData();
- for (int i = 0; i < items; i++) {
- AttributeData d;
- d.handle = read_le<GatoHandle>(&s[pos]);
- d.value = data.mid(pos + 2, item_len - 2);
- list.append(d);
-
- pos += item_len;
- }
-
- return list;
-}
-
-QList<GatoAttClient::AttributeGroupData> GatoAttClient::parseAttributeGroupData(const QByteArray &data)
-{
- const int item_len = data[0];
- const int items = (data.size() - 1) / item_len;
- QList<AttributeGroupData> list;
- list.reserve(items);
-
- int pos = 1;
- const char *s = data.constData();
- for (int i = 0; i < items; i++) {
- AttributeGroupData d;
- d.start = read_le<GatoHandle>(&s[pos]);
- d.end = read_le<GatoHandle>(&s[pos + 2]);
- d.value = data.mid(pos + 4, item_len - 4);
- list.append(d);
-
- pos += item_len;
- }
-
- return list;
-}
-
-void GatoAttClient::handleSocketConnected()
-{
- requestExchangeMTU(ATT_MAX_LE_MTU, this, SLOT(handleServerMTU(quint16)));
- emit connected();
-}
-
-void GatoAttClient::handleSocketDisconnected()
-{
- emit disconnected();
-}
-
-void GatoAttClient::handleSocketReadyRead()
-{
- QByteArray pkt = socket->receive();
- if (!pkt.isEmpty()) {
-#if PROTOCOL_DEBUG
- qDebug() << "Received" << pkt.size() << "bytes" << pkt.toHex();
-#endif
-
- // Check if it is an event
- if (handleEvent(pkt)) {
- return;
- }
-
- // Otherwise, if we have a request waiting, check if this answers it
- if (!pending_requests.isEmpty()) {
- if (handleResponse(pending_requests.head(), pkt)) {
- pending_requests.dequeue();
- // Proceed to next request
- if (!pending_requests.isEmpty()) {
- sendARequest();
- }
- return;
- }
- }
-
- qDebug() << "No idea what this packet ("
- << QString("0x%1").arg(uint(pkt.at(0)), 2, 16, QLatin1Char('0'))
- << ") is";
- }
-}
-
-void GatoAttClient::handleServerMTU(uint req, quint16 server_mtu)
-{
- Q_UNUSED(req);
- if (server_mtu) {
- cur_mtu = server_mtu;
- if (cur_mtu < ATT_DEFAULT_LE_MTU) {
- cur_mtu = ATT_DEFAULT_LE_MTU;
- }
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/bluetooth/gatoattclient.h b/src/bluetooth/gatoattclient.h
deleted file mode 100644
index 6222f863..00000000
--- a/src/bluetooth/gatoattclient.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Javier de San Pedro <dev.git@javispedro.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: 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.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef GATOATTCLIENT_H
-#define GATOATTCLIENT_H
-
-#include <QtCore/QObject>
-#include <QtCore/QQueue>
-#include "gatosocket.h"
-#include "gatouuid.h"
-
-QT_BEGIN_NAMESPACE
-
-class GatoAttClient : public QObject
-{
- Q_OBJECT
-
-public:
- explicit GatoAttClient(QObject *parent = 0);
- ~GatoAttClient();
-
- GatoSocket::State state() const;
-
- bool connectTo(const GatoAddress& addr);
- void close();
-
- struct InformationData
- {
- GatoHandle handle;
- GatoUUID uuid;
- };
- struct HandleInformation
- {
- GatoHandle start;
- GatoHandle end;
- };
- struct AttributeData
- {
- GatoHandle handle;
- QByteArray value;
- };
- struct AttributeGroupData
- {
- GatoHandle start;
- GatoHandle end;
- QByteArray value;
- };
-
- int mtu() const;
-
- uint request(int opcode, const QByteArray &data, QObject *receiver, const char *member);
- uint requestExchangeMTU(quint16 client_mtu, QObject *receiver, const char *member);
- uint requestFindInformation(GatoHandle start, GatoHandle end, QObject *receiver, const char *member);
- uint requestFindByTypeValue(GatoHandle start, GatoHandle end, const GatoUUID &uuid, const QByteArray& value, QObject *receiver, const char *member);
- uint requestReadByType(GatoHandle start, GatoHandle end, const GatoUUID &uuid, QObject *receiver, const char *member);
- uint requestRead(GatoHandle handle, QObject *receiver, const char *member);
- uint requestReadByGroupType(GatoHandle start, GatoHandle end, const GatoUUID &uuid, QObject *receiver, const char *member);
- uint requestWrite(GatoHandle handle, const QByteArray &value, QObject *receiver, const char *member);
- void cancelRequest(uint id);
-
- void command(int opcode, const QByteArray &data);
- void commandWrite(GatoHandle handle, const QByteArray &value);
-
-Q_SIGNALS:
- void connected();
- void disconnected();
-
- void attributeUpdated(GatoHandle handle, const QByteArray &value, bool confirmed);
-
-private:
- struct Request
- {
- uint id;
- quint8 opcode;
- QByteArray pkt;
- QObject *receiver;
- QByteArray member;
- };
-
- void sendARequest();
- bool handleEvent(const QByteArray &event);
- bool handleResponse(const Request& req, const QByteArray &response);
-
- QList<InformationData> parseInformationData(const QByteArray &data);
- QList<HandleInformation> parseHandleInformation(const QByteArray &data);
- QList<AttributeData> parseAttributeData(const QByteArray &data);
- QList<AttributeGroupData> parseAttributeGroupData(const QByteArray &data);
-
-private Q_SLOTS:
- void handleSocketConnected();
- void handleSocketDisconnected();
- void handleSocketReadyRead();
-
- void handleServerMTU(uint req, quint16 server_mtu);
-
-private:
- GatoSocket *socket;
- quint16 cur_mtu;
- uint next_id;
- QQueue<Request> pending_requests;
-};
-
-QT_END_NAMESPACE
-
-#endif // GATOATTCLIENT_H
diff --git a/src/bluetooth/gatoperipheral.cpp b/src/bluetooth/gatoperipheral.cpp
deleted file mode 100644
index b44efc26..00000000
--- a/src/bluetooth/gatoperipheral.cpp
+++ /dev/null
@@ -1,874 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Javier de San Pedro <dev.git@javispedro.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: 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.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/QDebug>
-
-#include <assert.h>
-#include <bluetooth/bluetooth.h>
-
-#include "gatoperipheral_p.h"
-#include "gatoaddress.h"
-#include "gatouuid.h"
-#include "helpers.h"
-
-QT_BEGIN_NAMESPACE
-
-enum EIRDataFields {
- EIRFlags = 0x01,
- EIRIncompleteUUID16List = 0x02,
- EIRCompleteUUID16List = 0x03,
- EIRIncompleteUUID32List = 0x04,
- EIRCompleteUUID32List = 0x05,
- EIRIncompleteUUID128List = 0x06,
- EIRCompleteUUID128List = 0x07,
- EIRIncompleteLocalName = 0x08,
- EIRCompleteLocalName = 0x09,
- EIRTxPowerLevel = 0x0A,
- EIRDeviceClass = 0x0D,
- EIRSecurityManagerTKValue = 0x10,
- EIRSecurityManagerOutOfBandFlags = 0x11,
- EIRSolicitedUUID128List = 0x15
-};
-
-GatoPeripheral::GatoPeripheral(const GatoAddress &addr, QObject *parent) :
- QObject(parent), d_ptr(new GatoPeripheralPrivate(this))
-{
- Q_D(GatoPeripheral);
- d->addr = addr;
- d->att = new GatoAttClient(this);
-
- connect(d->att, SIGNAL(connected()), d, SLOT(handleAttConnected()));
- connect(d->att, SIGNAL(disconnected()), d, SLOT(handleAttDisconnected()));
- connect(d->att, SIGNAL(attributeUpdated(GatoHandle,QByteArray,bool)), d, SLOT(handleAttAttributeUpdated(GatoHandle,QByteArray,bool)));
-}
-
-GatoPeripheral::~GatoPeripheral()
-{
- if (state() != StateDisconnected) {
- disconnect();
- }
- delete d_ptr;
-}
-
-GatoPeripheral::State GatoPeripheral::state() const
-{
- Q_D(const GatoPeripheral);
- return static_cast<State>(d->att->state());
-}
-
-GatoAddress GatoPeripheral::address() const
-{
- Q_D(const GatoPeripheral);
- return d->addr;
-}
-
-QString GatoPeripheral::name() const
-{
- Q_D(const GatoPeripheral);
- return d->name;
-}
-
-QList<GatoService> GatoPeripheral::services() const
-{
- Q_D(const GatoPeripheral);
- return d->services.values();
-}
-
-void GatoPeripheral::parseEIR(quint8 data[], int len)
-{
- Q_D(GatoPeripheral);
-
- int pos = 0;
- while (pos < len) {
- int item_len = data[pos];
- pos++;
- if (item_len == 0) break;
- int type = data[pos];
- assert(pos + item_len <= len);
- switch (type) {
- case EIRFlags:
- d->parseEIRFlags(&data[pos + 1], item_len - 1);
- break;
- case EIRIncompleteUUID16List:
- d->parseEIRUUIDs(16/8, false, &data[pos + 1], item_len - 1);
- break;
- case EIRCompleteUUID16List:
- d->parseEIRUUIDs(16/8, true, &data[pos + 1], item_len - 1);
- break;
- case EIRIncompleteUUID32List:
- d->parseEIRUUIDs(32/8, false, &data[pos + 1], item_len - 1);
- break;
- case EIRCompleteUUID32List:
- d->parseEIRUUIDs(32/8, true, &data[pos + 1], item_len - 1);
- break;
- case EIRIncompleteUUID128List:
- d->parseEIRUUIDs(128/8, false, &data[pos + 1], item_len - 1);
- break;
- case EIRCompleteUUID128List:
- d->parseEIRUUIDs(128/8, true, &data[pos + 1], item_len - 1);
- break;
- case EIRIncompleteLocalName:
- d->parseName(false, &data[pos + 1], item_len - 1);
- break;
- case EIRCompleteLocalName:
- d->parseName(true, &data[pos + 1], item_len - 1);
- break;
- case EIRTxPowerLevel:
- case EIRSolicitedUUID128List:
- qDebug() << "Unhandled EIR data type" << type;
- break;
- default:
- qWarning() << "Unknown EIR data type" << type;
- break;
- }
-
- pos += item_len;
- }
-
- assert(pos == len);
-}
-
-bool GatoPeripheral::advertisesService(const GatoUUID &uuid) const
-{
- Q_D(const GatoPeripheral);
- return d->service_uuids.contains(uuid);
-}
-
-void GatoPeripheral::connectPeripheral()
-{
- Q_D(GatoPeripheral);
- if (d->att->state() != GatoSocket::StateDisconnected) {
- qDebug() << "Already connecting";
- return;
- }
-
- d->att->connectTo(d->addr);
-}
-
-void GatoPeripheral::disconnectPeripheral()
-{
- Q_D(GatoPeripheral);
-
- d->att->close();
-}
-
-void GatoPeripheral::discoverServices()
-{
- Q_D(GatoPeripheral);
- if (!d->complete_services && state() == StateConnected) {
- d->clearServices();
- d->att->requestReadByGroupType(0x0001, 0xFFFF, GatoUUID::GattPrimaryService,
- d, SLOT(handlePrimary(QList<GatoAttClient::AttributeGroupData>)));
- } else {
- qWarning() << "Not connected";
- }
-}
-
-void GatoPeripheral::discoverServices(const QList<GatoUUID> &serviceUUIDs)
-{
- Q_D(GatoPeripheral);
- if (serviceUUIDs.isEmpty()) return;
- if (state() == StateConnected) {
- foreach (const GatoUUID& uuid, serviceUUIDs) {
- QByteArray value = gatouuid_to_bytearray(uuid, true, false);
- uint req = d->att->requestFindByTypeValue(0x0001, 0xFFFF, GatoUUID::GattPrimaryService, value,
- d, SLOT(handlePrimaryForService(uint,QList<GatoAttClient::HandleInformation>)));
- d->pending_primary_reqs.insert(req, uuid);
- }
- } else {
- qWarning() << "Not connected";
- }
-}
-
-void GatoPeripheral::discoverCharacteristics(const GatoService &service)
-{
- Q_D(GatoPeripheral);
-
- if (!d->services.contains(service.startHandle())) {
- qWarning() << "Unknown service for this peripheral";
- return;
- }
-
- GatoService &our_service = d->services[service.startHandle()];
-
- if (our_service.startHandle() != service.startHandle() ||
- our_service.endHandle() != service.endHandle() ||
- our_service.uuid() != service.uuid()) {
- qWarning() << "Unknown service for this peripheral";
- return;
- }
-
- if (state() == StateConnected) {
- GatoHandle start = our_service.startHandle();
- GatoHandle end = our_service.endHandle();
-
- d->clearServiceCharacteristics(&our_service);
-
- uint req = d->att->requestReadByType(start, end, GatoUUID::GattCharacteristic,
- d, SLOT(handleCharacteristic(QList<GatoAttClient::AttributeData>)));
- d->pending_characteristic_reqs.insert(req, start);
- } else {
- qWarning() << "Not connected";
- }
-}
-
-void GatoPeripheral::discoverCharacteristics(const GatoService &service, const QList<GatoUUID> &characteristicUUIDs)
-{
- // TODO There seems to be no way to ask for the peripheral to filter by uuid
- Q_UNUSED(characteristicUUIDs);
- discoverCharacteristics(service);
-}
-
-void GatoPeripheral::discoverDescriptors(const GatoCharacteristic &characteristic)
-{
- Q_D(GatoPeripheral);
-
- GatoHandle char_handle = characteristic.startHandle();
- GatoHandle service_handle = d->characteristic_to_service.value(char_handle);
-
- if (!service_handle) {
- qWarning() << "Unknown characteristic for this peripheral";
- return;
- }
-
- GatoService &our_service = d->services[service_handle];
- Q_ASSERT(our_service.containsCharacteristic(char_handle));
- GatoCharacteristic our_char = our_service.getCharacteristic(char_handle);
- Q_ASSERT(our_char.startHandle() == char_handle);
-
- if (state() == StateConnected) {
- d->clearCharacteristicDescriptors(&our_char);
- our_service.addCharacteristic(our_char); // Update service with empty descriptors list
- uint req = d->att->requestFindInformation(our_char.startHandle() + 1, our_char.endHandle(),
- d, SLOT(handleDescriptors(uint,QList<GatoAttClient::InformationData>)));
- d->pending_descriptor_reqs.insert(req, char_handle);
- } else {
- qWarning() << "Not connected";
- }
-}
-
-void GatoPeripheral::readValue(const GatoCharacteristic &characteristic)
-{
- Q_D(GatoPeripheral);
-
- GatoHandle char_handle = characteristic.startHandle();
- GatoHandle service_handle = d->characteristic_to_service.value(char_handle);
-
- if (!service_handle) {
- qWarning() << "Unknown characteristic for this peripheral";
- return;
- }
-
- GatoService &our_service = d->services[service_handle];
- Q_ASSERT(our_service.containsCharacteristic(char_handle));
-
- if (state() == StateConnected) {
- uint req = d->att->requestRead(characteristic.valueHandle(),
- d, SLOT(handleCharacteristicRead(uint,QByteArray)));
- d->pending_characteristic_read_reqs.insert(req, char_handle);
- } else {
- qWarning() << "Not connected";
- }
-}
-
-void GatoPeripheral::readValue(const GatoDescriptor &descriptor)
-{
- Q_D(GatoPeripheral);
-
- GatoHandle desc_handle = descriptor.handle();
- GatoHandle char_handle = d->descriptor_to_characteristic.value(desc_handle);
-
- if (!char_handle) {
- qWarning() << "Unknown descriptor for this peripheral";
- return;
- }
-
- GatoHandle service_handle = d->characteristic_to_service.value(char_handle);
- Q_ASSERT(service_handle);
-
- GatoService &our_service = d->services[service_handle];
- Q_ASSERT(our_service.containsCharacteristic(char_handle));
-
- if (state() == StateConnected) {
- uint req = d->att->requestRead(descriptor.handle(),
- d, SLOT(handleDescriptorRead(uint,QByteArray)));
- d->pending_descriptor_read_reqs.insert(req, char_handle);
- } else {
- qWarning() << "Not connected";
- }
-}
-
-void GatoPeripheral::writeValue(const GatoCharacteristic &characteristic, const QByteArray &data, WriteType type)
-{
- Q_D(GatoPeripheral);
-
- GatoHandle char_handle = characteristic.startHandle();
- GatoHandle service_handle = d->characteristic_to_service.value(char_handle);
-
- if (!service_handle) {
- qWarning() << "Unknown characteristic for this peripheral";
- return;
- }
-
- GatoService &our_service = d->services[service_handle];
- Q_ASSERT(our_service.containsCharacteristic(char_handle));
-
- if (state() == StateConnected) {
- switch (type) {
- case WriteWithResponse:
- d->att->requestWrite(characteristic.valueHandle(), data,
- d, SLOT(handleCharacteristicWrite(uint,bool)));
- break;
- case WriteWithoutResponse:
- d->att->commandWrite(characteristic.valueHandle(), data);
- break;
- }
-
-
- } else {
- qWarning() << "Not connected";
- }
-}
-
-void GatoPeripheral::writeValue(const GatoDescriptor &descriptor, const QByteArray &data)
-{
- Q_D(GatoPeripheral);
-
- GatoHandle desc_handle = descriptor.handle();
- GatoHandle char_handle = d->descriptor_to_characteristic.value(desc_handle);
-
- if (!char_handle) {
- qWarning() << "Unknown descriptor for this peripheral";
- return;
- }
-
- GatoHandle service_handle = d->characteristic_to_service.value(char_handle);
- Q_ASSERT(service_handle);
-
- GatoService &our_service = d->services[service_handle];
- Q_ASSERT(our_service.containsCharacteristic(char_handle));
-
- if (state() == StateConnected) {
- d->att->requestWrite(descriptor.handle(), data,
- d, SLOT(handleDescriptorWrite(uint,bool)));
- } else {
- qWarning() << "Not connected";
- }
-}
-
-void GatoPeripheral::setNotification(const GatoCharacteristic &characteristic, bool enabled)
-{
- Q_D(GatoPeripheral);
-
- GatoHandle char_handle = characteristic.startHandle();
- GatoHandle service_handle = d->characteristic_to_service.value(char_handle);
-
- if (!service_handle) {
- qWarning() << "Unknown characteristic for this peripheral";
- return;
- }
-
- GatoService &our_service = d->services[service_handle];
- Q_ASSERT(our_service.containsCharacteristic(char_handle));
- GatoCharacteristic our_char = our_service.getCharacteristic(char_handle);
-
- if (!(our_char.properties() & GatoCharacteristic::PropertyNotify)) {
- qWarning() << "Characteristic does not support notifications";
- return;
- }
-
- if (state() != StateConnected) {
- qWarning() << "Not connected";
- return;
- }
-
- const GatoUUID uuid(GatoUUID::GattClientCharacteristicConfiguration);
- if (our_char.containsDescriptor(uuid)) {
- GatoDescriptor desc = our_char.getDescriptor(uuid);
- d->pending_set_notify.remove(char_handle);
- writeValue(characteristic, d->genClientCharConfiguration(true, false));
- } else {
- d->pending_set_notify[char_handle] = enabled;
- discoverDescriptors(our_char); // May need to find appropiate descriptor
- }
-}
-
-GatoPeripheralPrivate::GatoPeripheralPrivate(GatoPeripheral *parent)
- : QObject(parent), q_ptr(parent),
- complete_name(false), complete_services(false)
-{
-}
-
-GatoPeripheralPrivate::~GatoPeripheralPrivate()
-{
- delete att;
-}
-
-void GatoPeripheralPrivate::parseEIRFlags(quint8 data[], int len)
-{
- Q_UNUSED(data);
- Q_UNUSED(len);
- // Nothing to do for now.
-}
-
-void GatoPeripheralPrivate::parseEIRUUIDs(int size, bool complete, quint8 data[], int len)
-{
- Q_UNUSED(complete);
-
- if (size != 16/8 && size != 32/8 && size != 128/8) {
- qWarning() << "Unhandled UUID size: " << size;
- return;
- }
-
- for (int pos = 0; pos < len; pos += size) {
- char *ptr = reinterpret_cast<char*>(&data[pos]);
- QByteArray ba = QByteArray::fromRawData(ptr, size/8);
-
- service_uuids.insert(bytearray_to_gatouuid(ba));
- }
-}
-
-void GatoPeripheralPrivate::parseName(bool complete, quint8 data[], int len)
-{
- Q_Q(GatoPeripheral);
- if (complete || !complete_name) {
- name = QString::fromUtf8(reinterpret_cast<char*>(data), len);
- complete_name = complete;
- emit q->nameChanged();
- }
-}
-
-GatoCharacteristic GatoPeripheralPrivate::parseCharacteristicValue(const QByteArray &ba)
-{
- GatoCharacteristic characteristic;
- const char *data = ba.constData();
-
- quint8 properties = data[0];
- characteristic.setProperties(GatoCharacteristic::Properties(properties));
-
- GatoHandle handle = read_le<quint16>(&data[1]);
- characteristic.setValueHandle(handle);
-
- GatoUUID uuid = bytearray_to_gatouuid(ba.mid(3));
- characteristic.setUuid(uuid);
-
- return characteristic;
-}
-
-QByteArray GatoPeripheralPrivate::genClientCharConfiguration(bool notification, bool indication)
-{
- QByteArray ba;
- ba.resize(sizeof(quint16));
-
- quint16 val = 0;
- if (notification)
- val |= 0x1;
- if (indication)
- val |= 0x2;
-
- write_le<quint16>(val, ba.data());
-
- return ba;
-}
-
-void GatoPeripheralPrivate::clearServices()
-{
- characteristic_to_service.clear();
- value_to_characteristic.clear();
- descriptor_to_characteristic.clear();
- services.clear();
-}
-
-void GatoPeripheralPrivate::clearServiceCharacteristics(GatoService *service)
-{
- QList<GatoCharacteristic> chars = service->characteristics();
- QList<GatoCharacteristic>::iterator it;
- for (it = chars.begin(); it != chars.end(); ++it) {
- clearCharacteristicDescriptors(&*it);
- characteristic_to_service.remove(it->startHandle());
- value_to_characteristic.remove(it->valueHandle());
- }
- service->clearCharacteristics();
-}
-
-void GatoPeripheralPrivate::clearCharacteristicDescriptors(GatoCharacteristic *characteristic)
-{
- QList<GatoDescriptor> descs = characteristic->descriptors();
- foreach (const GatoDescriptor& d, descs) {
- descriptor_to_characteristic.remove(d.handle());
- }
- characteristic->clearDescriptors();
-}
-
-void GatoPeripheralPrivate::finishSetNotifyOperations(const GatoCharacteristic &characteristic)
-{
- Q_Q(GatoPeripheral);
-
- GatoHandle handle = characteristic.startHandle();
-
- if (pending_set_notify.contains(handle)) {
- const GatoUUID uuid(GatoUUID::GattClientCharacteristicConfiguration);
- bool notify = pending_set_notify.value(handle);
-
- foreach (const GatoDescriptor &descriptor, characteristic.descriptors()) {
- if (descriptor.uuid() == uuid) {
- q->writeValue(descriptor, genClientCharConfiguration(notify, false));
- }
- }
-
- pending_set_notify.remove(handle);
- }
-}
-
-void GatoPeripheralPrivate::handleAttConnected()
-{
- Q_Q(GatoPeripheral);
-
- emit q->connected();
-}
-
-void GatoPeripheralPrivate::handleAttDisconnected()
-{
- Q_Q(GatoPeripheral);
-
- // Forget about all pending requests
- pending_primary_reqs.clear();
- pending_characteristic_reqs.clear();
- pending_characteristic_read_reqs.clear();
- pending_descriptor_reqs.clear();
- pending_descriptor_read_reqs.clear();
-
- emit q->disconnected();
-}
-
-void GatoPeripheralPrivate::handleAttAttributeUpdated(GatoHandle handle, const QByteArray &value, bool confirmed)
-{
- Q_Q(GatoPeripheral);
- Q_UNUSED(confirmed);
-
- // Let's see if this is a handle we know about.
- if (value_to_characteristic.contains(handle)) {
- // Ok, it's a characteristic value.
- GatoHandle char_handle = value_to_characteristic.value(handle);
- GatoHandle service_handle = characteristic_to_service.value(char_handle);
- if (!service_handle) {
- qWarning() << "Got a notification for a characteristic I don't know about";
- return;
- }
-
- GatoService &service = services[service_handle];
- GatoCharacteristic characteristic = service.getCharacteristic(char_handle);
-
- emit q->valueUpdated(characteristic, value);
- }
-}
-
-void GatoPeripheralPrivate::handlePrimary(uint req, const QList<GatoAttClient::AttributeGroupData> &list)
-{
- Q_Q(GatoPeripheral);
- Q_UNUSED(req);
-
- if (list.isEmpty()) {
- complete_services = true;
- emit q->servicesDiscovered();
- } else {
- GatoHandle last_handle = 0;
-
- foreach (const GatoAttClient::AttributeGroupData &data, list) {
- GatoUUID uuid = bytearray_to_gatouuid(data.value);
- GatoService service;
-
- service.setUuid(uuid);
- service.setStartHandle(data.start);
- service.setEndHandle(data.end);
-
- services.insert(data.start, service);
- service_uuids.insert(uuid);
-
- last_handle = data.end;
- }
-
- // Fetch following attributes
- att->requestReadByGroupType(last_handle + 1, 0xFFFF, GatoUUID::GattPrimaryService,
- this, SLOT(handlePrimary(uint,QList<GatoAttClient::AttributeGroupData>)));
- }
-}
-
-void GatoPeripheralPrivate::handlePrimaryForService(uint req, const QList<GatoAttClient::HandleInformation> &list)
-{
- Q_Q(GatoPeripheral);
-
- GatoUUID uuid = pending_primary_reqs.value(req, GatoUUID());
- if (uuid.isNull()) {
- qDebug() << "Got primary for service response for a request I did not make";
- return;
- }
- pending_primary_reqs.remove(req);
-
- if (list.isEmpty()) {
- if (pending_primary_reqs.isEmpty()) {
- emit q->servicesDiscovered();
- }
- } else {
- GatoHandle last_handle = 0;
-
- foreach (const GatoAttClient::HandleInformation &data, list) {
- GatoService service;
-
- service.setUuid(uuid);
- service.setStartHandle(data.start);
- service.setEndHandle(data.end);
-
- services.insert(data.start, service);
- service_uuids.insert(uuid);
-
- last_handle = data.end;
- }
-
- // Fetch following attributes
- QByteArray value = gatouuid_to_bytearray(uuid, true, false);
- uint req = att->requestFindByTypeValue(last_handle + 1, 0xFFFF, GatoUUID::GattPrimaryService, value,
- this, SLOT(handlePrimaryForService(uint,QList<GatoAttClient::HandleInformation>)));
- pending_primary_reqs.insert(req, uuid);
- }
-}
-
-void GatoPeripheralPrivate::handleCharacteristic(uint req, const QList<GatoAttClient::AttributeData> &list)
-{
- Q_Q(GatoPeripheral);
-
- GatoHandle service_start = pending_characteristic_reqs.value(req, 0);
- if (!service_start) {
- qDebug() << "Got characteristics for a request I did not make";
- return;
- }
- pending_characteristic_reqs.remove(req);
-
- Q_ASSERT(services.contains(service_start));
- GatoService &service = services[service_start];
- Q_ASSERT(service.startHandle() == service_start);
-
- if (list.isEmpty()) {
- emit q->characteristicsDiscovered(service);
- } else {
- GatoHandle last_handle = 0;
-
- // If we are continuing a characteristic list, this means the
- // last service we discovered in the previous iteration was not
- // the last one, so we have to reduce its endHandle!
- QList<GatoCharacteristic> cur_chars = service.characteristics();
- if (!cur_chars.isEmpty()) {
- GatoCharacteristic &last = cur_chars.back();
- last.setEndHandle(list.front().handle - 1);
- service.addCharacteristic(last);
- }
-
- for (int i = 0; i < list.size(); i++) {
- const GatoAttClient::AttributeData &data = list.at(i);
- GatoCharacteristic characteristic = parseCharacteristicValue(data.value);
-
- characteristic.setStartHandle(data.handle);
- if (i + 1 < list.size()) {
- characteristic.setEndHandle(list.at(i + 1).handle - 1);
- } else {
- characteristic.setEndHandle(service.endHandle());
- }
-
- service.addCharacteristic(characteristic);
- characteristic_to_service.insert(data.handle, service_start);
- value_to_characteristic.insert(characteristic.valueHandle(), data.handle);
-
- last_handle = data.handle;
- }
-
- if (last_handle >= service.endHandle()) {
- // Already finished, no need to send another request
- emit q->characteristicsDiscovered(service);
- return;
- }
-
- // Fetch following attributes
- uint req = att->requestReadByType(last_handle + 1, service.endHandle(), GatoUUID::GattCharacteristic,
- this, SLOT(handleCharacteristic(uint,QList<GatoAttClient::AttributeData>)));
- pending_characteristic_reqs.insert(req, service.startHandle());
- }
-}
-
-void GatoPeripheralPrivate::handleDescriptors(uint req, const QList<GatoAttClient::InformationData> &list)
-{
- Q_Q(GatoPeripheral);
-
- GatoHandle char_handle = pending_descriptor_reqs.value(req);
- if (!char_handle) {
- qDebug() << "Got descriptor for a request I did not make";
- return;
- }
- pending_descriptor_reqs.remove(req);
- GatoHandle service_handle = characteristic_to_service.value(char_handle);
- if (!service_handle) {
- qWarning() << "Unknown characteristic during descriptor discovery: " << char_handle;
- return;
- }
-
- Q_ASSERT(services.contains(service_handle));
- GatoService &service = services[service_handle];
- Q_ASSERT(service.startHandle() == service_handle);
-
- Q_ASSERT(service.containsCharacteristic(char_handle));
- GatoCharacteristic characteristic = service.getCharacteristic(char_handle);
-
- if (list.isEmpty()) {
- finishSetNotifyOperations(characteristic);
- emit q->descriptorsDiscovered(characteristic);
- } else {
- GatoHandle last_handle = 0;
-
- foreach (const GatoAttClient::InformationData &data, list) {
- // Skip the value attribute itself.
- if (data.handle == characteristic.valueHandle()) continue;
-
- GatoDescriptor descriptor;
-
- descriptor.setHandle(data.handle);
- descriptor.setUuid(data.uuid);
-
- characteristic.addDescriptor(descriptor);
-
- service.addCharacteristic(characteristic);
- descriptor_to_characteristic.insert(data.handle, char_handle);
-
- last_handle = data.handle;
- }
-
- service.addCharacteristic(characteristic);
-
- if (last_handle >= characteristic.endHandle()) {
- // Already finished, no need to send another request
- finishSetNotifyOperations(characteristic);
- emit q->descriptorsDiscovered(characteristic);
- return;
- }
-
- // Fetch following attributes
- uint req = att->requestFindInformation(last_handle + 1, characteristic.endHandle(),
- this, SLOT(handleDescriptors(uint,QList<GatoAttClient::InformationData>)));
- pending_descriptor_reqs.insert(req, char_handle);
-
- }
-}
-
-void GatoPeripheralPrivate::handleCharacteristicRead(uint req, const QByteArray &value)
-{
- Q_Q(GatoPeripheral);
-
- GatoHandle char_handle = pending_characteristic_read_reqs.value(req);
- if (!char_handle) {
- qDebug() << "Got characteristics for a request I did not make";
- return;
- }
- pending_characteristic_read_reqs.remove(req);
- GatoHandle service_handle = characteristic_to_service.value(char_handle);
- if (!service_handle) {
- qWarning() << "Unknown characteristic during read: " << char_handle;
- return;
- }
-
- Q_ASSERT(services.contains(service_handle));
- GatoService &service = services[service_handle];
- Q_ASSERT(service.startHandle() == service_handle);
-
- Q_ASSERT(service.containsCharacteristic(char_handle));
- GatoCharacteristic characteristic = service.getCharacteristic(char_handle);
-
- emit q->valueUpdated(characteristic, value);
-}
-
-void GatoPeripheralPrivate::handleDescriptorRead(uint req, const QByteArray &value)
-{
- Q_Q(GatoPeripheral);
-
- GatoHandle desc_handle = pending_descriptor_read_reqs.value(req);
- if (!desc_handle) {
- qDebug() << "Got characteristics for a request I did not make";
- return;
- }
- pending_descriptor_read_reqs.remove(req);
- GatoHandle char_handle = descriptor_to_characteristic.value(desc_handle);
- if (!char_handle) {
- qWarning() << "Unknown characteristic during read: " << char_handle;
- return;
- }
- GatoHandle service_handle = characteristic_to_service.value(char_handle);
- if (!service_handle) {
- qWarning() << "Unknown characteristic during read: " << char_handle;
- return;
- }
-
- Q_ASSERT(services.contains(service_handle));
- GatoService &service = services[service_handle];
- Q_ASSERT(service.startHandle() == service_handle);
-
- Q_ASSERT(service.containsCharacteristic(char_handle));
- GatoCharacteristic characteristic = service.getCharacteristic(char_handle);
-
- Q_ASSERT(characteristic.containsDescriptor(desc_handle));
- GatoDescriptor descriptor = characteristic.getDescriptor(desc_handle);
-
- emit q->descriptorValueUpdated(descriptor, value);
-}
-
-void GatoPeripheralPrivate::handleCharacteristicWrite(uint req, bool ok)
-{
- Q_UNUSED(req);
- if (!ok) {
- qWarning() << "Failed to write some characteristic";
- }
-}
-
-void GatoPeripheralPrivate::handleDescriptorWrite(uint req, bool ok)
-{
- Q_UNUSED(req);
- if (!ok) {
- qWarning() << "Failed to write some characteristic";
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/bluetooth/gatoperipheral.h b/src/bluetooth/gatoperipheral.h
deleted file mode 100644
index 0186d9a7..00000000
--- a/src/bluetooth/gatoperipheral.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Javier de San Pedro <dev.git@javispedro.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: 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.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef GATOPERIPHERAL_H
-#define GATOPERIPHERAL_H
-
-#include <QtCore/QObject>
-#include "libgato_global.h"
-#include "gatouuid.h"
-#include "gatoaddress.h"
-
-QT_BEGIN_NAMESPACE
-
-class GatoService;
-class GatoCharacteristic;
-class GatoDescriptor;
-class GatoPeripheralPrivate;
-
-class LIBGATO_EXPORT GatoPeripheral : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(GatoPeripheral)
- Q_ENUMS(State)
- Q_ENUMS(WriteType)
- Q_PROPERTY(GatoAddress address READ address)
- Q_PROPERTY(QString name READ name NOTIFY nameChanged)
-
-public:
- GatoPeripheral(const GatoAddress& addr, QObject *parent = 0);
- ~GatoPeripheral();
-
- enum State {
- StateDisconnected,
- StateConnecting,
- StateConnected
- };
-
- enum WriteType {
- WriteWithResponse = 0,
- WriteWithoutResponse
- };
-
- State state() const;
- GatoAddress address() const;
- QString name() const;
- QList<GatoService> services() const;
-
- void parseEIR(quint8 data[], int len);
- bool advertisesService(const GatoUUID &uuid) const;
-
-public Q_SLOTS:
- void connectPeripheral();
- void disconnectPeripheral();
- void discoverServices();
- void discoverServices(const QList<GatoUUID>& serviceUUIDs);
- void discoverCharacteristics(const GatoService &service);
- void discoverCharacteristics(const GatoService &service, const QList<GatoUUID>& characteristicUUIDs);
- void discoverDescriptors(const GatoCharacteristic &characteristic);
- void readValue(const GatoCharacteristic &characteristic);
- void readValue(const GatoDescriptor &descriptor);
- void writeValue(const GatoCharacteristic &characteristic, const QByteArray &data, WriteType type = WriteWithResponse);
- void writeValue(const GatoDescriptor &descriptor, const QByteArray &data);
- void setNotification(const GatoCharacteristic &characteristic, bool enabled);
-
-Q_SIGNALS:
- void connected();
- void disconnected();
- void nameChanged();
- void servicesDiscovered();
- void characteristicsDiscovered(const GatoService &service);
- void descriptorsDiscovered(const GatoCharacteristic &characteristic);
- void valueUpdated(const GatoCharacteristic &characteristic, const QByteArray &value);
- void descriptorValueUpdated(const GatoDescriptor &descriptor, const QByteArray &value);
-
-private:
- GatoPeripheralPrivate *const d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // GATOPERIPHERAL_H
diff --git a/src/bluetooth/gatoperipheral_p.h b/src/bluetooth/gatoperipheral_p.h
deleted file mode 100644
index 9873c7bd..00000000
--- a/src/bluetooth/gatoperipheral_p.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Javier de San Pedro <dev.git@javispedro.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: 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.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef GATOPERIPHERAL_P_H
-#define GATOPERIPHERAL_P_H
-
-#include "gatoperipheral.h"
-#include "gatoservice.h"
-#include "gatocharacteristic.h"
-#include "gatodescriptor.h"
-#include "gatoattclient.h"
-
-QT_BEGIN_NAMESPACE
-
-class GatoPeripheralPrivate : public QObject
-{
- Q_OBJECT
-
- Q_DECLARE_PUBLIC(GatoPeripheral)
-
-public:
- GatoPeripheralPrivate(GatoPeripheral *parent);
- ~GatoPeripheralPrivate();
-
- GatoPeripheral *q_ptr;
- GatoAddress addr;
- QString name;
- QSet<GatoUUID> service_uuids;
- QMap<GatoHandle, GatoService> services;
-
- bool complete_name : 1;
- bool complete_services : 1;
-
- /** Maps attribute handles to service handles. */
- QMap<GatoHandle, GatoHandle> characteristic_to_service;
- QMap<GatoHandle, GatoHandle> value_to_characteristic;
- QMap<GatoHandle, GatoHandle> descriptor_to_characteristic;
-
- GatoAttClient *att;
- QMap<uint, GatoUUID> pending_primary_reqs;
- QMap<uint, GatoHandle> pending_characteristic_reqs;
- QMap<uint, GatoHandle> pending_characteristic_read_reqs;
- QMap<uint, GatoHandle> pending_descriptor_reqs;
- QMap<uint, GatoHandle> pending_descriptor_read_reqs;
-
- QMap<GatoHandle, bool> pending_set_notify;
-
- void parseEIRFlags(quint8 data[], int len);
- void parseEIRUUIDs(int size, bool complete, quint8 data[], int len);
- void parseName(bool complete, quint8 data[], int len);
-
- static GatoCharacteristic parseCharacteristicValue(const QByteArray &ba);
-
- static QByteArray genClientCharConfiguration(bool notification, bool indication);
-
- void clearServices();
- void clearServiceCharacteristics(GatoService *service);
- void clearCharacteristicDescriptors(GatoCharacteristic *characteristic);
-
- void finishSetNotifyOperations(const GatoCharacteristic &characteristic);
-
-public slots:
- void handleAttConnected();
- void handleAttDisconnected();
- void handleAttAttributeUpdated(GatoHandle handle, const QByteArray &value, bool confirmed);
- void handlePrimary(uint req, const QList<GatoAttClient::AttributeGroupData>& list);
- void handlePrimaryForService(uint req, const QList<GatoAttClient::HandleInformation>& list);
- void handleCharacteristic(uint req, const QList<GatoAttClient::AttributeData> &list);
- void handleDescriptors(uint req, const QList<GatoAttClient::InformationData> &list);
- void handleCharacteristicRead(uint req, const QByteArray &value);
- void handleDescriptorRead(uint req, const QByteArray &value);
- void handleCharacteristicWrite(uint req, bool ok);
- void handleDescriptorWrite(uint req, bool ok);
-};
-
-QT_END_NAMESPACE
-
-#endif // GATOPERIPHERAL_P_H
diff --git a/src/bluetooth/qbluetooth.cpp b/src/bluetooth/qbluetooth.cpp
index ca7bfd9a..691bd022 100644
--- a/src/bluetooth/qbluetooth.cpp
+++ b/src/bluetooth/qbluetooth.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetooth.h b/src/bluetooth/qbluetooth.h
index f9650385..ebe546f8 100644
--- a/src/bluetooth/qbluetooth.h
+++ b/src/bluetooth/qbluetooth.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothaddress.cpp b/src/bluetooth/qbluetoothaddress.cpp
index cd1eab4c..00a057fc 100644
--- a/src/bluetooth/qbluetoothaddress.cpp
+++ b/src/bluetooth/qbluetoothaddress.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothaddress.h b/src/bluetooth/qbluetoothaddress.h
index d10946db..3fa491a2 100644
--- a/src/bluetooth/qbluetoothaddress.h
+++ b/src/bluetooth/qbluetoothaddress.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothaddress_p.h b/src/bluetooth/qbluetoothaddress_p.h
index 20408b05..be641dca 100644
--- a/src/bluetooth/qbluetoothaddress_p.h
+++ b/src/bluetooth/qbluetoothaddress_p.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef QBLUETOOTHADDRESS_P_H
#define QBLUETOOTHADDRESS_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothaddress.h"
QT_BEGIN_NAMESPACE
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
index ab0643d6..16d74aff 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.h b/src/bluetooth/qbluetoothdevicediscoveryagent.h
index 89937769..2db7b345 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent.h
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent.h
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
index c889d051..1bd3dac5 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
index c7fdde05..2f90fd30 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
index 181586bd..c89c2d37 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -79,21 +71,6 @@ void QBluetoothDeviceDiscoveryAgentPrivate::stop()
{
}
-#ifdef QT_BLUEZ_BLUETOOTH
-void QBluetoothDeviceDiscoveryAgentPrivate::_q_deviceFound(const QString &address,
- const QVariantMap &dict)
-{
- Q_UNUSED(address);
- Q_UNUSED(dict);
-}
-
-void QBluetoothDeviceDiscoveryAgentPrivate::_q_propertyChanged(const QString &name,
- const QDBusVariant &value)
-{
- Q_UNUSED(name);
- Q_UNUSED(value);
-}
-#endif
QT_END_NAMESPACE
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
index c6199d62..1afbc6bb 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,6 +35,17 @@
#ifndef QBLUETOOTHDEVICEDISCOVERYAGENT_P_H
#define QBLUETOOTHDEVICEDISCOVERYAGENT_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothdevicediscoveryagent.h"
#ifdef QT_ANDROID_BLUETOOTH
#include <QtAndroidExtras/QAndroidJniObject>
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp
index 771ce56f..2e4ad274 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothdeviceinfo.cpp b/src/bluetooth/qbluetoothdeviceinfo.cpp
index d43cbab6..6aa58a07 100644
--- a/src/bluetooth/qbluetoothdeviceinfo.cpp
+++ b/src/bluetooth/qbluetoothdeviceinfo.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothdeviceinfo.h b/src/bluetooth/qbluetoothdeviceinfo.h
index f2cc1529..d97e54de 100644
--- a/src/bluetooth/qbluetoothdeviceinfo.h
+++ b/src/bluetooth/qbluetoothdeviceinfo.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothdeviceinfo_p.h b/src/bluetooth/qbluetoothdeviceinfo_p.h
index f5e575aa..5b110993 100644
--- a/src/bluetooth/qbluetoothdeviceinfo_p.h
+++ b/src/bluetooth/qbluetoothdeviceinfo_p.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef QBLUETOOTHDEVICEINFO_P_H
#define QBLUETOOTHDEVICEINFO_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothdeviceinfo.h"
#include "qbluetoothaddress.h"
#include "qbluetoothuuid.h"
diff --git a/src/bluetooth/qbluetoothglobal.h b/src/bluetooth/qbluetoothglobal.h
index c2184eb4..9c64e24e 100644
--- a/src/bluetooth/qbluetoothglobal.h
+++ b/src/bluetooth/qbluetoothglobal.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothhostinfo.cpp b/src/bluetooth/qbluetoothhostinfo.cpp
index e20d52ac..cf720021 100644
--- a/src/bluetooth/qbluetoothhostinfo.cpp
+++ b/src/bluetooth/qbluetoothhostinfo.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothhostinfo.h b/src/bluetooth/qbluetoothhostinfo.h
index f51837fe..abc70e7e 100644
--- a/src/bluetooth/qbluetoothhostinfo.h
+++ b/src/bluetooth/qbluetoothhostinfo.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothhostinfo_p.h b/src/bluetooth/qbluetoothhostinfo_p.h
index a44b29dd..7eb46bd6 100644
--- a/src/bluetooth/qbluetoothhostinfo_p.h
+++ b/src/bluetooth/qbluetoothhostinfo_p.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef QBLUETOOTHHOSTINFO_P_H
#define QBLUETOOTHHOSTINFO_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothhostinfo.h"
QT_BEGIN_NAMESPACE
diff --git a/src/bluetooth/qbluetoothlocaldevice.cpp b/src/bluetooth/qbluetoothlocaldevice.cpp
index 78899d0a..fa700c6a 100644
--- a/src/bluetooth/qbluetoothlocaldevice.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothlocaldevice.h b/src/bluetooth/qbluetoothlocaldevice.h
index 661e6a9c..4c1e9016 100644
--- a/src/bluetooth/qbluetoothlocaldevice.h
+++ b/src/bluetooth/qbluetoothlocaldevice.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothlocaldevice_android.cpp b/src/bluetooth/qbluetoothlocaldevice_android.cpp
index 475ecd95..4c1b1d4e 100644
--- a/src/bluetooth/qbluetoothlocaldevice_android.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice_android.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothlocaldevice_bluez.cpp b/src/bluetooth/qbluetoothlocaldevice_bluez.cpp
index 18493f82..c7ee556d 100644
--- a/src/bluetooth/qbluetoothlocaldevice_bluez.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice_bluez.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothlocaldevice_p.cpp b/src/bluetooth/qbluetoothlocaldevice_p.cpp
index 6fedafc7..dbfb8724 100644
--- a/src/bluetooth/qbluetoothlocaldevice_p.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice_p.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothlocaldevice_p.h b/src/bluetooth/qbluetoothlocaldevice_p.h
index 08ad1c54..1507373f 100644
--- a/src/bluetooth/qbluetoothlocaldevice_p.h
+++ b/src/bluetooth/qbluetoothlocaldevice_p.h
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,6 +35,17 @@
#ifndef QBLUETOOTHLOCALDEVICE_P_H
#define QBLUETOOTHLOCALDEVICE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtBluetooth/qbluetoothglobal.h>
#include "qbluetoothlocaldevice.h"
diff --git a/src/bluetooth/qbluetoothlocaldevice_qnx.cpp b/src/bluetooth/qbluetoothlocaldevice_qnx.cpp
index 6c6dc1aa..c2a099f4 100644
--- a/src/bluetooth/qbluetoothlocaldevice_qnx.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice_qnx.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothserver.cpp b/src/bluetooth/qbluetoothserver.cpp
index 3123b032..34108a91 100644
--- a/src/bluetooth/qbluetoothserver.cpp
+++ b/src/bluetooth/qbluetoothserver.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -226,6 +218,8 @@ QBluetoothServiceInfo QBluetoothServer::listen(const QBluetoothUuid &uuid, const
QBluetoothServiceInfo::Sequence protocolDescriptorList;
QBluetoothServiceInfo::Sequence protocol;
protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap));
+ if (d->serverType == QBluetoothServiceInfo::L2capProtocol)
+ protocol << QVariant::fromValue(serverPort());
protocolDescriptorList.append(QVariant::fromValue(protocol));
protocol.clear();
//! [listen]
@@ -233,10 +227,10 @@ QBluetoothServiceInfo QBluetoothServer::listen(const QBluetoothUuid &uuid, const
//! [listen2]
protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Rfcomm))
<< QVariant::fromValue(quint8(serverPort()));
+ protocolDescriptorList.append(QVariant::fromValue(protocol));
//! [listen2]
}
//! [listen3]
- protocolDescriptorList.append(QVariant::fromValue(protocol));
serviceInfo.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList,
protocolDescriptorList);
bool result = serviceInfo.registerService();
diff --git a/src/bluetooth/qbluetoothserver.h b/src/bluetooth/qbluetoothserver.h
index 61573843..2eadd1d4 100644
--- a/src/bluetooth/qbluetoothserver.h
+++ b/src/bluetooth/qbluetoothserver.h
@@ -1,41 +1,33 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothserver_android.cpp b/src/bluetooth/qbluetoothserver_android.cpp
index f90c540e..e1a50703 100644
--- a/src/bluetooth/qbluetoothserver_android.cpp
+++ b/src/bluetooth/qbluetoothserver_android.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothserver_bluez.cpp b/src/bluetooth/qbluetoothserver_bluez.cpp
index 4532e570..88eab65c 100644
--- a/src/bluetooth/qbluetoothserver_bluez.cpp
+++ b/src/bluetooth/qbluetoothserver_bluez.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothserver_p.cpp b/src/bluetooth/qbluetoothserver_p.cpp
index d9efcf2f..310b6f68 100644
--- a/src/bluetooth/qbluetoothserver_p.cpp
+++ b/src/bluetooth/qbluetoothserver_p.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothserver_p.h b/src/bluetooth/qbluetoothserver_p.h
index 492ad489..75f1bde6 100644
--- a/src/bluetooth/qbluetoothserver_p.h
+++ b/src/bluetooth/qbluetoothserver_p.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef QBLUETOOTHSERVER_P_H
#define QBLUETOOTHSERVER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGlobal>
#include <QList>
#include <QtBluetooth/QBluetoothSocket>
diff --git a/src/bluetooth/qbluetoothserver_qnx.cpp b/src/bluetooth/qbluetoothserver_qnx.cpp
index 2aefa041..bb2346cd 100644
--- a/src/bluetooth/qbluetoothserver_qnx.cpp
+++ b/src/bluetooth/qbluetoothserver_qnx.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent.cpp b/src/bluetooth/qbluetoothservicediscoveryagent.cpp
index 864b6d05..57c7c2b3 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -54,7 +46,10 @@ QT_BEGIN_NAMESPACE
\brief The QBluetoothServiceDiscoveryAgent class enables you to query for
Bluetooth services.
- To query the services provided by all contactable Bluetooth devices:
+ The discovery process relies on the Bluetooth Service Discovery Process (SDP).
+ The following steps are required to query the services provided by all contactable
+ Bluetooth devices:
+
\list
\li create an instance of QBluetoothServiceDiscoveryAgent,
\li connect to either the serviceDiscovered() or finished() signals,
@@ -63,16 +58,22 @@ QT_BEGIN_NAMESPACE
\snippet doc_src_qtbluetooth.cpp service_discovery
- By default a minimal service discovery is performed. In this mode, the QBluetotohServiceInfo
- objects returned are guaranteed to contain only device and service UUID information. Depending
+ By default a minimal service discovery is performed. In this mode, the returned \l QBluetoothServiceInfo
+ objects are guaranteed to contain only device and service UUID information. Depending
on platform and device capabilities, other service information may also be available. For most
use cases this is adequate as QBluetoothSocket::connectToService() will perform additional
- discovery if required. If full service information is required, pass \l FullDiscovery as the
+ discovery if required. If the full service information is required, pass \l FullDiscovery as the
discoveryMode parameter to start().
This class may internally utilize \l QBluetoothDeviceDiscoveryAgent to find unknown devices.
- \sa QBluetoothDeviceDiscoveryAgent
+ The service discovery may find Bluetooth Low Energy services too if the target device
+ is a combination of a classic and Low Energy device. Those devices are required to advertise
+ their Low Energy services via SDP. If the target device only supports Bluetooth Low
+ Energy services, it is likely to not advertise them via SDP. The \l QLowEnergyController class
+ should be utilized to perform the service discovery on Low Energy devices.
+
+ \sa QBluetoothDeviceDiscoveryAgent, QLowEnergyController
*/
/*!
@@ -102,12 +103,12 @@ QT_BEGIN_NAMESPACE
\fn QBluetoothServiceDiscoveryAgent::serviceDiscovered(const QBluetoothServiceInfo &info)
This signal is emitted when the Bluetooth service described by \a info is discovered.
-*/
-/*!
- \fn QBluetoothServiceDiscoveryAgent::serviceDiscovered(const QLowEnergyServiceInfo &info)
+ \note The passed \l QBluetoothServiceInfo parameter may contain a Bluetooth Low Energy
+ service if the target device advertises the service via SDP. This is required from device
+ which support both, classic Bluetooth (BaseRate) and Low Energy services.
- This signal is emitted when the Bluetooth Low Energy service described by \a info is discovered.
+ \sa QBluetoothDeviceInfo::coreConfigurations()
*/
/*!
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent.h b/src/bluetooth/qbluetoothservicediscoveryagent.h
index f1e754db..5e47ada0 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent.h
+++ b/src/bluetooth/qbluetoothservicediscoveryagent.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +41,6 @@
#include <QtBluetooth/QBluetoothServiceInfo>
#include <QtBluetooth/QBluetoothUuid>
#include <QtBluetooth/QBluetoothDeviceDiscoveryAgent>
-#include <QtBluetooth/QLowEnergyServiceInfo>
QT_BEGIN_NAMESPACE
@@ -101,7 +92,6 @@ public Q_SLOTS:
Q_SIGNALS:
void serviceDiscovered(const QBluetoothServiceInfo &info);
- void serviceDiscovered(const QLowEnergyServiceInfo &info);
void finished();
void canceled();
void error(QBluetoothServiceDiscoveryAgent::Error error);
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
index 35449720..01993f25 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -345,8 +337,12 @@ void QBluetoothServiceDiscoveryAgentPrivate::populateDiscoveredServices(const QB
QBluetoothServiceInfo serviceInfo;
serviceInfo.setDevice(remoteDevice);
- QBluetoothServiceInfo::Sequence protocolDescriptorList;
- protocolDescriptorList << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap));
+ QBluetoothServiceInfo::Sequence protocolDescriptorList;
+ {
+ QBluetoothServiceInfo::Sequence protocol;
+ protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap));
+ protocolDescriptorList.append(QVariant::fromValue(protocol));
+ }
if (customUuids.contains(i) && sppIndex > -1) {
//we have a custom uuid of service class type SPP
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
index 2f2f26d8..d82a73a8 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
@@ -5,43 +5,34 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qbluetoothservicediscoveryagent.h"
#include "qbluetoothservicediscoveryagent_p.h"
-#include "qlowenergyserviceinfo_p.h"
#include "bluez/manager_p.h"
#include "bluez/adapter_p.h"
@@ -231,10 +222,18 @@ void QBluetoothServiceDiscoveryAgentPrivate::runSdpScan(
QStringList arguments;
arguments << remoteAddress.toString() << localAddress.toString();
+ QByteArray output;
+
QProcess process;
process.setProcessChannelMode(QProcess::ForwardedErrorChannel);
process.setReadChannel(QProcess::StandardOutput);
process.start(fileInfo.canonicalFilePath(), arguments);
+
+ if (process.waitForStarted(-1)) {
+ while (process.waitForReadyRead(-1))
+ output += process.readAllStandardOutput();
+ }
+
process.waitForFinished();
if (process.exitStatus() != QProcess::NormalExit
@@ -261,17 +260,20 @@ void QBluetoothServiceDiscoveryAgentPrivate::runSdpScan(
}
QStringList xmlRecords;
-
- int size, index = 0;
- const QByteArray output = QByteArray::fromBase64(process.readAll());
- const char *data = output.constData();
-
- // separate the individial SDP records
- // each record starts with 4 byte size indicator
- while (index < output.size()) {
- memcpy(&size, &data[index], sizeof(int));
- xmlRecords.append(QString::fromUtf8(output.mid(index+sizeof(int), size)));
- index += sizeof(int) + size;
+ const QString decodedData = QString::fromUtf8(QByteArray::fromBase64(output));
+
+ // split the various xml docs up
+ int next;
+ int start = decodedData.indexOf(QStringLiteral("<?xml"), 0);
+ if (start != -1) {
+ do {
+ next = decodedData.indexOf(QStringLiteral("<?xml"), start + 1);
+ if (next != -1)
+ xmlRecords.append(decodedData.mid(start, next-start));
+ else
+ xmlRecords.append(decodedData.mid(start, decodedData.size() - start));
+ start = next;
+ } while ( start != -1);
}
QMetaObject::invokeMethod(q, "_q_finishSdpScan", Qt::QueuedConnection,
@@ -297,8 +299,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_finishSdpScan(QBluetoothServiceD
emit q->error(error);
} else if (!xmlRecords.isEmpty() && discoveryState() != Inactive) {
foreach (const QString &record, xmlRecords) {
- bool isBtleService = false;
- const QBluetoothServiceInfo serviceInfo = parseServiceXml(record, &isBtleService);
+ const QBluetoothServiceInfo serviceInfo = parseServiceXml(record);
//apply uuidFilter
if (!uuidFilter.isEmpty()) {
@@ -433,19 +434,40 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_createdDevice(QDBusPendingCallWa
b = b.remove(QLatin1Char('{')).remove(QLatin1Char('}'));
const QBluetoothUuid uuid(b);
- qCDebug(QT_BT_BLUEZ) << "Discovered BLE service" << uuid << uuidFilter.size();
- QLowEnergyServiceInfo lowEnergyService(uuid);
- lowEnergyService.setDevice(discoveredDevices.at(0));
+ qCDebug(QT_BT_BLUEZ) << "Discovered service" << uuid << uuidFilter.size();
+ QBluetoothServiceInfo service;
+ service.setDevice(discoveredDevices.at(0));
+ bool ok = false;
+ quint16 serviceClass = uuid.toUInt16(&ok);
+ if (ok)
+ service.setServiceName(QBluetoothUuid::serviceClassToString(
+ static_cast<QBluetoothUuid::ServiceClassUuid>(serviceClass)));
+
+ QBluetoothServiceInfo::Sequence classId;
+ classId << QVariant::fromValue(uuid);
+ service.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId);
+
+ QBluetoothServiceInfo::Sequence protocolDescriptorList;
+ {
+ QBluetoothServiceInfo::Sequence protocol;
+ protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap));
+ protocolDescriptorList.append(QVariant::fromValue(protocol));
+ }
+ {
+ QBluetoothServiceInfo::Sequence protocol;
+ protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Att));
+ protocolDescriptorList.append(QVariant::fromValue(protocol));
+ }
+ service.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList);
+
if (uuidFilter.isEmpty())
- emit q->serviceDiscovered(lowEnergyService);
+ emit q->serviceDiscovered(service);
else {
for (int j = 0; j < uuidFilter.size(); j++) {
if (uuidFilter.at(j) == uuid)
- emit q->serviceDiscovered(lowEnergyService);
-
+ emit q->serviceDiscovered(service);
}
}
-
}
if (singleDevice && deviceReply.isError()) {
@@ -500,14 +522,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_discoveredServices(QDBusPendingC
foreach (const QString &record, reply.value()) {
- bool isBtleService = false;
- QBluetoothServiceInfo serviceInfo = parseServiceXml(record, &isBtleService);
-
- if (isBtleService) {
- qCDebug(QT_BT_BLUEZ) << "Discovered BLE services" << discoveredDevices.at(0).address().toString()
- << serviceInfo.serviceName() << serviceInfo.serviceUuid() << serviceInfo.serviceClassUuids();
- continue;
- }
+ QBluetoothServiceInfo serviceInfo = parseServiceXml(record);
if (!serviceInfo.isValid())
continue;
@@ -551,7 +566,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_discoveredServices(QDBusPendingC
}
QBluetoothServiceInfo QBluetoothServiceDiscoveryAgentPrivate::parseServiceXml(
- const QString& xmlRecord, bool *isBtleService)
+ const QString& xmlRecord)
{
QXmlStreamReader xml(xmlRecord);
@@ -567,25 +582,7 @@ QBluetoothServiceInfo QBluetoothServiceDiscoveryAgentPrivate::parseServiceXml(
xml.attributes().value(QLatin1String("id")).toString().toUShort(0, 0);
if (xml.readNextStartElement()) {
- QVariant value = readAttributeValue(xml);
- if (isBtleService) {
- if (attributeId == 1) {// Attribute with id 1 contains UUID of the service
- const QBluetoothServiceInfo::Sequence seq =
- value.value<QBluetoothServiceInfo::Sequence>();
- for (int i = 0; i < seq.count(); i++) {
- const QBluetoothUuid uuid = seq.at(i).value<QBluetoothUuid>();
- if ((uuid.data1 & 0x1800) == 0x1800) {// We are taking into consideration that LE services starts at 0x1800
- //TODO don't emit in the middle of nowhere
- Q_Q(QBluetoothServiceDiscoveryAgent);
- QLowEnergyServiceInfo leService(uuid);
- leService.setDevice(discoveredDevices.at(0));
- *isBtleService = true;
- emit q->serviceDiscovered(leService);
- break;
- }
- }
- }
- }
+ const QVariant value = readAttributeValue(xml);
serviceInfo.setAttribute(attributeId, value);
}
}
@@ -652,7 +649,6 @@ void QBluetoothServiceDiscoveryAgentPrivate::performMinimalServiceDiscovery(cons
if (!uuidFilter.isEmpty() && !uuidFilter.contains(uuid))
continue;
- // TODO deal with BTLE services under Bluez 5 -> right now they are normal services
QBluetoothServiceInfo serviceInfo;
serviceInfo.setDevice(discoveredDevices.at(0));
@@ -669,6 +665,19 @@ void QBluetoothServiceDiscoveryAgentPrivate::performMinimalServiceDiscovery(cons
serviceInfo.setServiceName(QBluetoothUuid::serviceClassToString(clsId));
}
+ QBluetoothServiceInfo::Sequence protocolDescriptorList;
+ {
+ QBluetoothServiceInfo::Sequence protocol;
+ protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap));
+ protocolDescriptorList.append(QVariant::fromValue(protocol));
+ }
+ {
+ QBluetoothServiceInfo::Sequence protocol;
+ protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Att));
+ protocolDescriptorList.append(QVariant::fromValue(protocol));
+ }
+ serviceInfo.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList);
+
//don't include the service if we already discovered it before
if (!isDuplicatedService(serviceInfo)) {
discoveredServices << serviceInfo;
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp
index 86874a6c..695912f1 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_p.h b/src/bluetooth/qbluetoothservicediscoveryagent_p.h
index 0377ce1a..ea985627 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_p.h
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_p.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,11 +34,21 @@
#ifndef QBLUETOOTHSERVICEDISCOVERYAGENT_P_H
#define QBLUETOOTHSERVICEDISCOVERYAGENT_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothaddress.h"
#include "qbluetoothdeviceinfo.h"
#include "qbluetoothserviceinfo.h"
#include "qbluetoothservicediscoveryagent.h"
-#include "qlowenergyserviceinfo.h"
#include <QStack>
#include <QStringList>
@@ -148,7 +150,7 @@ private:
void runSdpScan(const QBluetoothAddress &remoteAddress,
const QBluetoothAddress localAddress);
QVariant readAttributeValue(QXmlStreamReader &xml);
- QBluetoothServiceInfo parseServiceXml(const QString& xml, bool *isBtleService);
+ QBluetoothServiceInfo parseServiceXml(const QString& xml);
void performMinimalServiceDiscovery(const QBluetoothAddress &deviceAddress);
#endif
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp
index a2abbebc..7fe0fad7 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -45,8 +37,6 @@
#include "qbluetoothdeviceinfo.h"
#include "qbluetoothdevicediscoveryagent.h"
-#include "qlowenergyserviceinfo_p.h"
-
#include <QStringList>
#include "qbluetoothuuid.h"
#include <stdio.h>
@@ -288,8 +278,10 @@ void QBluetoothServiceDiscoveryAgentPrivate::remoteDevicesChanged(int fd)
QBluetoothServiceInfo serviceInfo;
serviceInfo.setDevice(discoveredDevices.at(0));
- QBluetoothServiceInfo::Sequence protocolDescriptorList;
- protocolDescriptorList << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap));
+ QBluetoothServiceInfo::Sequence protocolDescriptorList;
+ QBluetoothServiceInfo::Sequence l2cpProtocol;
+ l2cpProtocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap));
+ protocolDescriptorList.append(QVariant::fromValue(l2cpProtocol));
bool ok;
QBluetoothUuid suuid(QByteArray(next_service).toUInt(&ok,16));
@@ -353,9 +345,38 @@ void QBluetoothServiceDiscoveryAgentPrivate::remoteDevicesChanged(int fd)
leUuid = QBluetoothUuid(lowEnergyUuid.toUShort(0,0));
}
- QLowEnergyServiceInfo lowEnergyService(leUuid);
+ //Check if the UUID is in the uuidFilter
+ if (!uuidFilter.isEmpty() && !uuidFilter.contains(leUuid))
+ continue;
+
+ QBluetoothServiceInfo lowEnergyService;
lowEnergyService.setDevice(discoveredDevices.at(0));
- qCDebug(QT_BT_QNX) << "Adding Low Energy service" << lowEnergyService.serviceUuid();
+
+ bool ok = false;
+ quint16 serviceClass = leUuid.toUInt16(&ok);
+ if (ok)
+ lowEnergyService.setServiceName(QBluetoothUuid::serviceClassToString(
+ static_cast<QBluetoothUuid::ServiceClassUuid>(serviceClass)));
+
+ QBluetoothServiceInfo::Sequence classId;
+ classId << QVariant::fromValue(leUuid);
+ lowEnergyService.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId);
+
+ QBluetoothServiceInfo::Sequence protocolDescriptorList;
+ {
+ QBluetoothServiceInfo::Sequence protocol;
+ protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap));
+ protocolDescriptorList.append(QVariant::fromValue(protocol));
+ }
+ {
+ QBluetoothServiceInfo::Sequence protocol;
+ protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Att));
+ protocolDescriptorList.append(QVariant::fromValue(protocol));
+ }
+ service.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList);
+
+ qCDebug(QT_BT_QNX) << "Adding Low Energy service" << leUuid;
+
q_ptr->serviceDiscovered(lowEnergyService);
}
diff --git a/src/bluetooth/qbluetoothserviceinfo.cpp b/src/bluetooth/qbluetoothserviceinfo.cpp
index cfb2bbcb..9c2f1ed1 100644
--- a/src/bluetooth/qbluetoothserviceinfo.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothserviceinfo.h b/src/bluetooth/qbluetoothserviceinfo.h
index 4d3b8612..1ec1d7d9 100644
--- a/src/bluetooth/qbluetoothserviceinfo.h
+++ b/src/bluetooth/qbluetoothserviceinfo.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothserviceinfo_android.cpp b/src/bluetooth/qbluetoothserviceinfo_android.cpp
index 078554d0..5d7f0fac 100644
--- a/src/bluetooth/qbluetoothserviceinfo_android.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo_android.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothserviceinfo_bluez.cpp b/src/bluetooth/qbluetoothserviceinfo_bluez.cpp
index eb764047..59a9abca 100644
--- a/src/bluetooth/qbluetoothserviceinfo_bluez.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo_bluez.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothserviceinfo_p.cpp b/src/bluetooth/qbluetoothserviceinfo_p.cpp
index e5f2f4e5..ba6a9526 100644
--- a/src/bluetooth/qbluetoothserviceinfo_p.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo_p.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothserviceinfo_p.h b/src/bluetooth/qbluetoothserviceinfo_p.h
index 3dc32b5c..7ff7132c 100644
--- a/src/bluetooth/qbluetoothserviceinfo_p.h
+++ b/src/bluetooth/qbluetoothserviceinfo_p.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef QBLUETOOTHSERVICEINFO_P_H
#define QBLUETOOTHSERVICEINFO_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothuuid.h"
#include "qbluetoothaddress.h"
#include "qbluetoothdeviceinfo.h"
diff --git a/src/bluetooth/qbluetoothserviceinfo_qnx.cpp b/src/bluetooth/qbluetoothserviceinfo_qnx.cpp
index 8767889b..387f4751 100644
--- a/src/bluetooth/qbluetoothserviceinfo_qnx.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo_qnx.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothsocket.cpp b/src/bluetooth/qbluetoothsocket.cpp
index 0c514887..8f6309d4 100644
--- a/src/bluetooth/qbluetoothsocket.cpp
+++ b/src/bluetooth/qbluetoothsocket.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -572,10 +564,12 @@ void QBluetoothSocket::serviceDiscovered(const QBluetoothServiceInfo &service)
{
Q_D(QBluetoothSocket);
qCDebug(QT_BT) << "FOUND SERVICE!" << service;
- if(service.protocolServiceMultiplexer() != 0 || service.serverChannel() != 0) {
+ if (service.protocolServiceMultiplexer() > 0 || service.serverChannel() > 0) {
connectToService(service, d->openMode);
d->discoveryAgent->deleteLater();
d->discoveryAgent = 0;
+ } else {
+ qCDebug(QT_BT) << "Could not find port/psm for potential remote service";
}
}
diff --git a/src/bluetooth/qbluetoothsocket.h b/src/bluetooth/qbluetoothsocket.h
index 9f56764f..6540e0c9 100644
--- a/src/bluetooth/qbluetoothsocket.h
+++ b/src/bluetooth/qbluetoothsocket.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -160,8 +152,6 @@ protected:
QBluetoothSocketPrivate *d_ptr;
private:
- Q_PRIVATE_SLOT(d_func(), void _q_readNotify())
- Q_PRIVATE_SLOT(d_func(), void _q_writeNotify())
friend class QLowEnergyControllerPrivate;
};
diff --git a/src/bluetooth/qbluetoothsocket_android.cpp b/src/bluetooth/qbluetoothsocket_android.cpp
index d499b6ad..ce68d236 100644
--- a/src/bluetooth/qbluetoothsocket_android.cpp
+++ b/src/bluetooth/qbluetoothsocket_android.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -84,16 +76,127 @@ bool QBluetoothSocketPrivate::ensureNativeSocket(QBluetoothServiceInfo::Protocol
void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address,
const QBluetoothUuid &uuid,
- QIODevice::OpenMode openMode)
+ QIODevice::OpenMode openMode,
+ int fallbackServiceChannel)
{
Q_Q(QBluetoothSocket);
q->setSocketState(QBluetoothSocket::ConnectingState);
- QtConcurrent::run(this, &QBluetoothSocketPrivate::connectToServiceConc, address, uuid, openMode);
+ QtConcurrent::run(this, &QBluetoothSocketPrivate::connectToServiceConc,
+ address, uuid, openMode, fallbackServiceChannel);
+}
+
+bool QBluetoothSocketPrivate::fallBackConnect(QAndroidJniObject uuid, int channel)
+{
+ qCWarning(QT_BT_ANDROID) << "Falling back to workaround.";
+
+ QAndroidJniEnvironment env;
+ jclass remoteDeviceClazz = env->GetObjectClass(remoteDevice.object());
+ jmethodID getClassMethod = env->GetMethodID(remoteDeviceClazz, "getClass", "()Ljava/lang/Class;");
+ if (!getClassMethod) {
+ qCWarning(QT_BT_ANDROID) << "BluetoothDevice.getClass method could not be found.";
+ return false;
+ }
+
+
+ QAndroidJniObject remoteDeviceClass = QAndroidJniObject(env->CallObjectMethod(remoteDevice.object(), getClassMethod));
+ if (!remoteDeviceClass.isValid()) {
+ qCWarning(QT_BT_ANDROID) << "Could not invoke BluetoothDevice.getClass.";
+ return false;
+ }
+
+ jclass classClass = env->FindClass("java/lang/Class");
+ jclass integerClass = env->FindClass("java/lang/Integer");
+ jfieldID integerType = env->GetStaticFieldID(integerClass, "TYPE", "Ljava/lang/Class;");
+ jobject integerObject = env->GetStaticObjectField(integerClass, integerType);
+ if (!integerObject) {
+ qCWarning(QT_BT_ANDROID) << "Could not get Integer.TYPE";
+ return false;
+ }
+
+ jobjectArray paramTypes = env->NewObjectArray(1, classClass, integerObject);
+ if (!paramTypes) {
+ qCWarning(QT_BT_ANDROID) << "Could not create new Class[]{Integer.TYPE}";
+ return false;
+ }
+
+ QAndroidJniObject parcelUuid("android/os/ParcelUuid", "(Ljava/util/UUID;)V",
+ uuid.object());
+ if (parcelUuid.isValid()) {
+ jint socketChannel = remoteDevice.callMethod<jint>("getServiceChannel",
+ "(Landroid/os/ParcelUuid;)I",
+ parcelUuid.object());
+ if (env->ExceptionCheck()) {
+ env->ExceptionDescribe();
+ env->ExceptionClear();
+ }
+
+ if (socketChannel
+ == remoteDevice.getStaticField<jint>("android/bluetooth/BluetoothDevice", "ERROR")) {
+ qCWarning(QT_BT_ANDROID) << "Cannot determine RFCOMM service channel.";
+ } else {
+ qCWarning(QT_BT_ANDROID) << "Using found rfcomm channel" << socketChannel;
+ channel = socketChannel;
+ }
+ }
+
+ QAndroidJniObject method = remoteDeviceClass.callObjectMethod(
+ "getMethod",
+ "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;",
+ QAndroidJniObject::fromString(QLatin1String("createRfcommSocket")).object<jstring>(),
+ paramTypes);
+ if (!method.isValid() || env->ExceptionCheck()) {
+ qCWarning(QT_BT_ANDROID) << "Could not invoke getMethod";
+ if (env->ExceptionCheck()) {
+ env->ExceptionDescribe();
+ env->ExceptionClear();
+ }
+ return false;
+ }
+
+ jclass methodClass = env->GetObjectClass(method.object());
+ jmethodID invokeMethodId = env->GetMethodID(
+ methodClass, "invoke",
+ "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;");
+ if (!invokeMethodId) {
+ qCWarning(QT_BT_ANDROID) << "Could not invoke method.";
+ return false;
+ }
+
+ jmethodID valueOfMethodId = env->GetStaticMethodID(integerClass, "valueOf", "(I)Ljava/lang/Integer;");
+ jclass objectClass = env->FindClass("java/lang/Object");
+ jobjectArray invokeParams = env->NewObjectArray(1, objectClass, env->CallStaticObjectMethod(integerClass, valueOfMethodId, channel));
+
+
+ jobject invokeResult = env->CallObjectMethod(method.object(), invokeMethodId,
+ remoteDevice.object(), invokeParams);
+ if (!invokeResult)
+ {
+ qCWarning(QT_BT_ANDROID) << "Invoke Resulted with error.";
+ if (env->ExceptionCheck()) {
+ env->ExceptionDescribe();
+ env->ExceptionClear();
+ }
+ return false;
+ }
+
+ socketObject = QAndroidJniObject(invokeResult);
+ socketObject.callMethod<void>("connect");
+ if (env->ExceptionCheck()) {
+ env->ExceptionDescribe();
+ env->ExceptionClear();
+
+ qCWarning(QT_BT_ANDROID) << "Socket connect via workaround failed.";
+
+ return false;
+ }
+
+ qCWarning(QT_BT_ANDROID) << "Workaround invoked.";
+ return true;
}
void QBluetoothSocketPrivate::connectToServiceConc(const QBluetoothAddress &address,
- const QBluetoothUuid &uuid, QIODevice::OpenMode openMode)
+ const QBluetoothUuid &uuid, QIODevice::OpenMode openMode, int fallbackServiceChannel)
{
Q_Q(QBluetoothSocket);
Q_UNUSED(openMode);
@@ -160,16 +263,19 @@ void QBluetoothSocketPrivate::connectToServiceConc(const QBluetoothAddress &addr
socketObject.callMethod<void>("connect");
if (env->ExceptionCheck()) {
- if (env->ExceptionCheck()) {
- env->ExceptionDescribe();
- env->ExceptionClear();
- }
+ env->ExceptionDescribe();
+ env->ExceptionClear();
- socketObject = remoteDevice = QAndroidJniObject();
- errorString = QBluetoothSocket::tr("Connection to service failed");
- q->setSocketError(QBluetoothSocket::ServiceNotFoundError);
- q->setSocketState(QBluetoothSocket::UnconnectedState);
- return;
+ bool success = fallBackConnect(uuidObject, fallbackServiceChannel);
+ if (!success) {
+ errorString = QBluetoothSocket::tr("Connection to service failed");
+ socketObject = remoteDevice = QAndroidJniObject();
+ q->setSocketError(QBluetoothSocket::ServiceNotFoundError);
+ q->setSocketState(QBluetoothSocket::UnconnectedState);
+
+ env->ExceptionClear(); //just in case
+ return;
+ }
}
if (inputThread) {
@@ -229,14 +335,6 @@ void QBluetoothSocketPrivate::connectToServiceConc(const QBluetoothAddress &addr
emit q->connected();
}
-void QBluetoothSocketPrivate::_q_writeNotify()
-{
-}
-
-void QBluetoothSocketPrivate::_q_readNotify()
-{
-}
-
void QBluetoothSocketPrivate::abort()
{
if (state == QBluetoothSocket::UnconnectedState)
diff --git a/src/bluetooth/qbluetoothsocket_bluez.cpp b/src/bluetooth/qbluetoothsocket_bluez.cpp
index 1807a225..f49f7253 100644
--- a/src/bluetooth/qbluetoothsocket_bluez.cpp
+++ b/src/bluetooth/qbluetoothsocket_bluez.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -72,7 +64,7 @@ QBluetoothSocketPrivate::QBluetoothSocketPrivate()
connectWriteNotifier(0),
connecting(false),
discoveryAgent(0),
- isLowEnergySocket(false)
+ lowEnergySocketType(0)
{
}
@@ -118,9 +110,9 @@ bool QBluetoothSocketPrivate::ensureNativeSocket(QBluetoothServiceInfo::Protocol
Q_Q(QBluetoothSocket);
readNotifier = new QSocketNotifier(socket, QSocketNotifier::Read);
- QObject::connect(readNotifier, SIGNAL(activated(int)), q, SLOT(_q_readNotify()));
+ QObject::connect(readNotifier, SIGNAL(activated(int)), this, SLOT(_q_readNotify()));
connectWriteNotifier = new QSocketNotifier(socket, QSocketNotifier::Write, q);
- QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), q, SLOT(_q_writeNotify()));
+ QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), this, SLOT(_q_writeNotify()));
connectWriteNotifier->setEnabled(false);
readNotifier->setEnabled(false);
@@ -166,14 +158,14 @@ void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address,
// of socket.
#if defined(QT_BLUEZ_BLUETOOTH) && !defined(QT_BLUEZ_NO_BTLE)
- if (isLowEnergySocket) {
+ if (lowEnergySocketType) {
addr.l2_cid = htobs(port);
- addr.l2_bdaddr_type = BDADDR_LE_PUBLIC;
+ addr.l2_bdaddr_type = lowEnergySocketType;
} else {
- addr.l2_psm = port;
+ addr.l2_psm = htobs(port);
}
#else
- addr.l2_psm = port;
+ addr.l2_psm = htobs(port);
#endif
convertAddress(address.toUInt64(), addr.l2_bdaddr.b);
@@ -240,8 +232,6 @@ void QBluetoothSocketPrivate::_q_writeNotify()
}
}
-// TODO: move to private backend?
-
void QBluetoothSocketPrivate::_q_readNotify()
{
Q_Q(QBluetoothSocket);
@@ -491,7 +481,7 @@ qint64 QBluetoothSocketPrivate::writeData(const char *data, qint64 maxSize)
if(txBuffer.size() == 0) {
connectWriteNotifier->setEnabled(true);
- QMetaObject::invokeMethod(q, "_q_writeNotify", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "_q_writeNotify", Qt::QueuedConnection);
}
char *txbuf = txBuffer.reserve(maxSize);
@@ -555,9 +545,9 @@ bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoo
fcntl(socket, F_SETFL, flags | O_NONBLOCK);
readNotifier = new QSocketNotifier(socket, QSocketNotifier::Read);
- QObject::connect(readNotifier, SIGNAL(activated(int)), q, SLOT(_q_readNotify()));
+ QObject::connect(readNotifier, SIGNAL(activated(int)), this, SLOT(_q_readNotify()));
connectWriteNotifier = new QSocketNotifier(socket, QSocketNotifier::Write, q);
- QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), q, SLOT(_q_writeNotify()));
+ QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), this, SLOT(_q_writeNotify()));
q->setSocketState(socketState);
q->setOpenMode(openMode);
diff --git a/src/bluetooth/qbluetoothsocket_p.cpp b/src/bluetooth/qbluetoothsocket_p.cpp
index 6e78be9e..85b730dd 100644
--- a/src/bluetooth/qbluetoothsocket_p.cpp
+++ b/src/bluetooth/qbluetoothsocket_p.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -69,14 +61,6 @@ void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address,
Q_UNUSED(port);
}
-void QBluetoothSocketPrivate::_q_writeNotify()
-{
-}
-
-void QBluetoothSocketPrivate::_q_readNotify()
-{
-}
-
void QBluetoothSocketPrivate::abort()
{
}
diff --git a/src/bluetooth/qbluetoothsocket_p.h b/src/bluetooth/qbluetoothsocket_p.h
index 2c44bb0c..e95af465 100644
--- a/src/bluetooth/qbluetoothsocket_p.h
+++ b/src/bluetooth/qbluetoothsocket_p.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef QBLUETOOTHSOCKET_P_H
#define QBLUETOOTHSOCKET_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothsocket.h"
#ifdef QT_QNX_BLUETOOTH
@@ -78,14 +81,9 @@ public:
class QBluetoothSocket;
class QBluetoothServiceDiscoveryAgent;
-class QBluetoothSocketPrivate
-#if defined(QT_QNX_BLUETOOTH) || defined(QT_ANDROID_BLUETOOTH)
-: public QObject
+class QBluetoothSocketPrivate : public QObject
{
Q_OBJECT
-#else
-{
-#endif
Q_DECLARE_PUBLIC(QBluetoothSocket)
friend class QBluetoothServerPrivate;
@@ -95,13 +93,18 @@ public:
~QBluetoothSocketPrivate();
//On QNX and Android we connect using the uuid not the port
-#if defined(QT_QNX_BLUETOOTH) || defined(QT_ANDROID_BLUETOOTH)
+#if defined(QT_QNX_BLUETOOTH)
void connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid, QIODevice::OpenMode openMode);
+#elif defined(QT_ANDROID_BLUETOOTH)
+ void connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid,
+ QIODevice::OpenMode openMode, int fallbackServiceChannel = 1);
+ bool fallBackConnect(QAndroidJniObject uuid, int channel);
#else
void connectToService(const QBluetoothAddress &address, quint16 port, QIODevice::OpenMode openMode);
#endif
#ifdef QT_ANDROID_BLUETOOTH
- void connectToServiceConc(const QBluetoothAddress &address, const QBluetoothUuid &uuid, QIODevice::OpenMode openMode);
+ void connectToServiceConc(const QBluetoothAddress &address, const QBluetoothUuid &uuid,
+ QIODevice::OpenMode openMode, int fallbackServiceChannel = 1);
#endif
@@ -155,12 +158,6 @@ public:
// qint64 rxOffset;
QString errorString;
- // private slots
- void _q_readNotify();
- void _q_writeNotify();
- void _q_serviceDiscovered(const QBluetoothServiceInfo &service);
- void _q_discoveryFinished();
-
#ifdef QT_ANDROID_BLUETOOTH
QAndroidJniObject adapter;
QAndroidJniObject socketObject;
@@ -174,6 +171,12 @@ private slots:
#endif
+#if defined(QT_QNX_BLUETOOTH) || defined(QT_BLUEZ_BLUETOOTH)
+private slots:
+ void _q_readNotify();
+ void _q_writeNotify();
+#endif
+
protected:
QBluetoothSocket *q_ptr;
@@ -190,7 +193,7 @@ private slots:
#ifdef QT_BLUEZ_BLUETOOTH
public:
- bool isLowEnergySocket;
+ quint8 lowEnergySocketType;
#endif
};
diff --git a/src/bluetooth/qbluetoothsocket_qnx.cpp b/src/bluetooth/qbluetoothsocket_qnx.cpp
index 10f08aa5..5926d8ad 100644
--- a/src/bluetooth/qbluetoothsocket_qnx.cpp
+++ b/src/bluetooth/qbluetoothsocket_qnx.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -122,9 +114,9 @@ void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address,
delete connectWriteNotifier;
readNotifier = new QSocketNotifier(socket, QSocketNotifier::Read);
- QObject::connect(readNotifier, SIGNAL(activated(int)), q, SLOT(_q_readNotify()));
+ QObject::connect(readNotifier, SIGNAL(activated(int)), this, SLOT(_q_readNotify()));
connectWriteNotifier = new QSocketNotifier(socket, QSocketNotifier::Write, q);
- QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), q, SLOT(_q_writeNotify()));
+ QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), this, SLOT(_q_writeNotify()));
connecting = true;
q->setOpenMode(openMode);
@@ -288,7 +280,7 @@ qint64 QBluetoothSocketPrivate::writeData(const char *data, qint64 maxSize)
if (txBuffer.size() == 0) {
connectWriteNotifier->setEnabled(true);
- QMetaObject::invokeMethod(q, "_q_writeNotify", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "_q_writeNotify", Qt::QueuedConnection);
}
char *txbuf = txBuffer.reserve(maxSize);
@@ -333,9 +325,9 @@ bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoo
socketType = socketType_;
readNotifier = new QSocketNotifier(socket, QSocketNotifier::Read);
- QObject::connect(readNotifier, SIGNAL(activated(int)), q, SLOT(_q_readNotify()));
+ QObject::connect(readNotifier, SIGNAL(activated(int)), this, SLOT(_q_readNotify()));
connectWriteNotifier = new QSocketNotifier(socket, QSocketNotifier::Write, q);
- QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), q, SLOT(_q_writeNotify()));
+ QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), this, SLOT(_q_writeNotify()));
q->setSocketState(socketState);
q->setOpenMode(openMode);
@@ -398,9 +390,9 @@ void QBluetoothSocketPrivate::controlReply(ppsResult result)
Q_Q(QBluetoothSocket);
readNotifier = new QSocketNotifier(socket, QSocketNotifier::Read);
- QObject::connect(readNotifier, SIGNAL(activated(int)), q, SLOT(_q_readNotify()));
+ QObject::connect(readNotifier, SIGNAL(activated(int)), this, SLOT(_q_readNotify()));
connectWriteNotifier = new QSocketNotifier(socket, QSocketNotifier::Write, q);
- QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), q, SLOT(_q_writeNotify()));
+ QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), this, SLOT(_q_writeNotify()));
connectWriteNotifier->setEnabled(true);
readNotifier->setEnabled(true);
diff --git a/src/bluetooth/qbluetoothtransfermanager.cpp b/src/bluetooth/qbluetoothtransfermanager.cpp
index 6e1d7f83..2b9ddc8b 100644
--- a/src/bluetooth/qbluetoothtransfermanager.cpp
+++ b/src/bluetooth/qbluetoothtransfermanager.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothtransfermanager.h b/src/bluetooth/qbluetoothtransfermanager.h
index 501a40a0..f252f975 100644
--- a/src/bluetooth/qbluetoothtransfermanager.h
+++ b/src/bluetooth/qbluetoothtransfermanager.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothtransferreply.cpp b/src/bluetooth/qbluetoothtransferreply.cpp
index 4dc1d4c8..6ade4808 100644
--- a/src/bluetooth/qbluetoothtransferreply.cpp
+++ b/src/bluetooth/qbluetoothtransferreply.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothtransferreply.h b/src/bluetooth/qbluetoothtransferreply.h
index ccf2d71d..a8fda6ce 100644
--- a/src/bluetooth/qbluetoothtransferreply.h
+++ b/src/bluetooth/qbluetoothtransferreply.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothtransferreply_bluez.cpp b/src/bluetooth/qbluetoothtransferreply_bluez.cpp
index 4f5eefeb..be5fccd0 100644
--- a/src/bluetooth/qbluetoothtransferreply_bluez.cpp
+++ b/src/bluetooth/qbluetoothtransferreply_bluez.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothtransferreply_bluez_p.h b/src/bluetooth/qbluetoothtransferreply_bluez_p.h
index 657b550f..0a9f9bca 100644
--- a/src/bluetooth/qbluetoothtransferreply_bluez_p.h
+++ b/src/bluetooth/qbluetoothtransferreply_bluez_p.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef QBLUETOOTHTRANSFERREPLY_BLUEZ_P_H
#define QBLUETOOTHTRANSFERREPLY_BLUEZ_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QIODevice>
#include <QtDBus/QtDBus>
diff --git a/src/bluetooth/qbluetoothtransferreply_p.h b/src/bluetooth/qbluetoothtransferreply_p.h
index afd7e622..caf3890d 100644
--- a/src/bluetooth/qbluetoothtransferreply_p.h
+++ b/src/bluetooth/qbluetoothtransferreply_p.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef QBLUETOOTHTRANSFERREPLY_P_H
#define QBLUETOOTHTRANSFERREPLY_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qbluetoothtransferreply.h"
QT_BEGIN_NAMESPACE
diff --git a/src/bluetooth/qbluetoothtransferreply_qnx.cpp b/src/bluetooth/qbluetoothtransferreply_qnx.cpp
index f2fea315..072230b1 100644
--- a/src/bluetooth/qbluetoothtransferreply_qnx.cpp
+++ b/src/bluetooth/qbluetoothtransferreply_qnx.cpp
@@ -1,41 +1,33 @@
/***************************************************************************
**
** Copyright (C) 2013 Research In Motion
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothtransferreply_qnx_p.h b/src/bluetooth/qbluetoothtransferreply_qnx_p.h
index 391f41af..d6b4d64b 100644
--- a/src/bluetooth/qbluetoothtransferreply_qnx_p.h
+++ b/src/bluetooth/qbluetoothtransferreply_qnx_p.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,6 +35,17 @@
#ifndef QBLUETOOTHTRANSFERREPLY_QNX_P_H
#define QBLUETOOTHTRANSFERREPLY_QNX_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qbluetoothtransferrequest.h>
#include <qbluetoothtransfermanager.h>
diff --git a/src/bluetooth/qbluetoothtransferrequest.cpp b/src/bluetooth/qbluetoothtransferrequest.cpp
index 4317b08c..685c70fb 100644
--- a/src/bluetooth/qbluetoothtransferrequest.cpp
+++ b/src/bluetooth/qbluetoothtransferrequest.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothtransferrequest.h b/src/bluetooth/qbluetoothtransferrequest.h
index b91429a0..981e99a8 100644
--- a/src/bluetooth/qbluetoothtransferrequest.h
+++ b/src/bluetooth/qbluetoothtransferrequest.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qbluetoothtransferrequest_p.h b/src/bluetooth/qbluetoothtransferrequest_p.h
index 2e67a7a4..ff146ec7 100644
--- a/src/bluetooth/qbluetoothtransferrequest_p.h
+++ b/src/bluetooth/qbluetoothtransferrequest_p.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef QBLUETOOTHTRANSFERREQUESTPRIVATE_H
#define QBLUETOOTHTRANSFERREQUESTPRIVATE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtBluetooth/qbluetoothglobal.h>
#include "qbluetoothtransferrequest.h"
diff --git a/src/bluetooth/qbluetoothuuid.cpp b/src/bluetooth/qbluetoothuuid.cpp
index 3f8487b4..72bf3404 100644
--- a/src/bluetooth/qbluetoothuuid.cpp
+++ b/src/bluetooth/qbluetoothuuid.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -383,6 +375,8 @@ Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34
will be implicitly converted into a QBluetoothUuid when necessary.
\value CharacteristicExtendedProperties Descriptor defines additional Characteristic Properties.
+ The existence of this descriptor is indicated by the
+ \l QLowEnergyCharacteristic::ExtendedProperty flag.
\value CharacteristicUserDescription Descriptor provides a textual user description for a characteristic value.
\value ClientCharacteristicConfiguration Descriptor defines how the characteristic may be configured by a specific client.
\value ServerCharacteristicConfiguration Descriptor defines how the characteristic descriptor is associated with may be
@@ -397,6 +391,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34
\value ReportReference Mapping information in the form of a Report ID and Report Type which maps the
current parent characteristic to the Report ID(s) and Report Type (s) defined
within the Report Map characteristic.
+ \value UnknownDescriptorType The descriptor type is unknown.
*/
/*!
@@ -475,17 +470,9 @@ QBluetoothUuid::QBluetoothUuid(quint32 uuid)
*/
QBluetoothUuid::QBluetoothUuid(quint128 uuid)
{
- // TODO: look at the memcpy(), should not be needed
- quint32 tmp32;
- memcpy(&tmp32, &uuid.data[0], 4);
- data1 = qFromBigEndian<quint32>(tmp32);
-
- quint16 tmp16;
- memcpy(&tmp16, &uuid.data[4], 2);
- data2 = qFromBigEndian<quint16>(tmp16);
-
- memcpy(&tmp16, &uuid.data[6], 2);
- data3 = qFromBigEndian<quint16>(tmp16);
+ data1 = qFromBigEndian<quint32>(*reinterpret_cast<quint32 *>(&uuid.data[0]));
+ data2 = qFromBigEndian<quint16>(*reinterpret_cast<quint16 *>(&uuid.data[4]));
+ data3 = qFromBigEndian<quint16>(*reinterpret_cast<quint16 *>(&uuid.data[6]));
memcpy(data4, &uuid.data[8], 8);
}
diff --git a/src/bluetooth/qbluetoothuuid.h b/src/bluetooth/qbluetoothuuid.h
index 274e98ab..2c035ffa 100644
--- a/src/bluetooth/qbluetoothuuid.h
+++ b/src/bluetooth/qbluetoothuuid.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qlowenergycharacteristic.cpp b/src/bluetooth/qlowenergycharacteristic.cpp
index 0c3dc7af..c3bd1a29 100644
--- a/src/bluetooth/qlowenergycharacteristic.cpp
+++ b/src/bluetooth/qlowenergycharacteristic.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -54,10 +46,25 @@ QT_BEGIN_NAMESPACE
\since 5.4
QLowEnergyCharacteristic provides information about a Bluetooth Low Energy
- service characteristic's name, UUID, value, permissions, handle and descriptors.
- To get the full characteristic specification and information it is necessary to
- connect to the service using QLowEnergyServiceInfo and QLowEnergyController classes.
- Some characteristics can contain none, one or more descriptors.
+ service characteristic's \l name(), \l uuid(), \l value(), \l properties(),
+ \l handle() and \l descriptors(). To obtain the characteristic's specification
+ and information, it is necessary to connect to the device using the
+ \l QLowEnergyService and \l QLowEnergyController classes.
+
+ The characteristic value may be written via the \l QLowEnergyService instance
+ that manages the service to which this characteristic belongs. The
+ \l {QLowEnergyService::writeCharacteristic()} function writes the new value.
+ The \l {QLowEnergyService::characteristicWritten()} signal is emitted upon success.
+ The \l value() of this object is automatically updated accordingly.
+
+ Characteristics may contain none, one or more descriptors. They can be individually
+ retrieved using the \l descriptor() function. The \l descriptors() function returns
+ all descriptors as a list. The general purpose of a descriptor is to add contextual
+ information to the characteristic. For example, the descriptor might provide
+ format or range information specifying how the characteristic's value is to be\
+ interpreted.
+
+ \sa QLowEnergyService, QLowEnergyDescriptor
*/
/*!
@@ -73,7 +80,7 @@ QT_BEGIN_NAMESPACE
\value Notify Permits notification of characteristic values.
\value Indicate Permits indications of characteristic values.
\value WriteSigned Permits signed writes of the GATT characteristic values.
- \value ExtendedProperty Additional characteristic properties are defined in the characteristic
+ \value ExtendedProperty Additional characteristic properties are defined in the characteristic's
extended properties descriptor.
\sa properties()
@@ -85,7 +92,10 @@ struct QLowEnergyCharacteristicPrivate
};
/*!
- Construct a new QLowEnergyCharacteristic.
+ Construct a new QLowEnergyCharacteristic. A default-constructed instance of
+ this class is always invalid.
+
+ \sa isValid()
*/
QLowEnergyCharacteristic::QLowEnergyCharacteristic():
d_ptr(0), data(0)
@@ -128,7 +138,15 @@ QLowEnergyCharacteristic::~QLowEnergyCharacteristic()
}
/*!
- Returns the name of the gatt characteristic type.
+ Returns the human-readable name of the characteristic.
+
+ The name is based on the characteristic's \l uuid() which must have been
+ standardized. The complete list of characteristic types can be found
+ under \l {https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx}{Bluetooth.org Characteristics}.
+
+ The returned string is empty if the \l uuid() is unknown.
+
+ \sa QBluetoothUuid::characteristicToString()
*/
QString QLowEnergyCharacteristic::name() const
{
@@ -137,7 +155,8 @@ QString QLowEnergyCharacteristic::name() const
}
/*!
- Returns the UUID of the gatt characteristic.
+ Returns the UUID of the characteristic if \l isValid() returns \c true; otherwise a
+ \l {QUuid::isNull()}{null} UUID.
*/
QBluetoothUuid QLowEnergyCharacteristic::uuid() const
{
@@ -149,7 +168,9 @@ QBluetoothUuid QLowEnergyCharacteristic::uuid() const
}
/*!
- Returns the properties of the gatt characteristic.
+ Returns the properties of the characteristic.
+
+ The properties define the access permissions for the characteristic.
*/
QLowEnergyCharacteristic::PropertyTypes QLowEnergyCharacteristic::properties() const
{
@@ -161,7 +182,19 @@ QLowEnergyCharacteristic::PropertyTypes QLowEnergyCharacteristic::properties() c
}
/*!
- Returns value of the GATT characteristic.
+ Returns the cached value of the characteristic.
+
+ If the characteristic's \l properties() permit writing of new values,
+ the value can be updated using \l QLowEnergyService::writeCharacteristic().
+
+ The cache is updated during the associated service's
+ \l {QLowEnergyService::discoverDetails()} {detail discovery}, a successful
+ \l {QLowEnergyService::writeCharacteristic()}{write operation} or when an update
+ notification is received.
+
+ The returned \l QByteArray is empty if the characteristic does not have the
+ \l {QLowEnergyCharacteristic::Read}{read permission}. However, a non-readable
+ characteristic may obtain a non-empty value via a related notification or write operation.
*/
QByteArray QLowEnergyCharacteristic::value() const
{
@@ -173,8 +206,8 @@ QByteArray QLowEnergyCharacteristic::value() const
}
/*!
- Returns the handle of the GATT characteristic's value attribute;
- otherwise returns \c 0.
+ Returns the handle of the characteristic's value attribute;
+ or \c 0 if the handle cannot be accessed on the platform.
*/
QLowEnergyHandle QLowEnergyCharacteristic::handle() const
{
@@ -186,8 +219,8 @@ QLowEnergyHandle QLowEnergyCharacteristic::handle() const
}
/*!
- Makes a copy of \a other and assigns it to this QLowEnergyCharacteristic object.
- The two copies continue to share the same service and registration details.
+ Makes a copy of \a other and assigns it to this \l QLowEnergyCharacteristic object.
+ The two copies continue to share the same service and controller details.
*/
QLowEnergyCharacteristic &QLowEnergyCharacteristic::operator=(const QLowEnergyCharacteristic &other)
{
@@ -210,8 +243,9 @@ QLowEnergyCharacteristic &QLowEnergyCharacteristic::operator=(const QLowEnergyCh
/*!
Returns \c true if \a other is equal to this QLowEnergyCharacteristic; otherwise \c false.
- Two QLowEnergyCharcteristic instances are considered to be equal if they refer to
- the same charcteristic on the same remote Bluetooth Low Energy device.
+ Two \l QLowEnergyCharacteristic instances are considered to be equal if they refer to
+ the same characteristic on the same remote Bluetooth Low Energy device or both instances
+ have been default-constructed.
*/
bool QLowEnergyCharacteristic::operator==(const QLowEnergyCharacteristic &other) const
{
@@ -234,7 +268,8 @@ bool QLowEnergyCharacteristic::operator==(const QLowEnergyCharacteristic &other)
Returns \c true if \a other is not equal to this QLowEnergyCharacteristic; otherwise \c false.
Two QLowEnergyCharcteristic instances are considered to be equal if they refer to
- the same charcteristic on the same remote Bluetooth Low Energy device.
+ the same characteristic on the same remote Bluetooth Low Energy device or both instances
+ have been default-constructed.
*/
bool QLowEnergyCharacteristic::operator!=(const QLowEnergyCharacteristic &other) const
@@ -245,14 +280,15 @@ bool QLowEnergyCharacteristic::operator!=(const QLowEnergyCharacteristic &other)
/*!
Returns \c true if the QLowEnergyCharacteristic object is valid, otherwise returns \c false.
- An invalid characteristic object is not associated to any service
- or the associated service is no longer valid due to for example a disconnect from
- the underlying Bluetooth Low Energy device. Once the object is invalid
+ An invalid characteristic object is not associated with any service (default-constructed)
+ or the associated service is no longer valid due to a disconnect from
+ the underlying Bluetooth Low Energy device, for example. Once the object is invalid
it cannot become valid anymore.
- \note If a QLowEnergyCharacteristic instance turns invalid due to a disconnect
+ \note If a \l QLowEnergyCharacteristic instance turns invalid due to a disconnect
from the underlying device, the information encapsulated by the current
- instance remains as it was at the time of the disconnect.
+ instance remains as it was at the time of the disconnect. Therefore it can be
+ retrieved after the disconnect event.
*/
bool QLowEnergyCharacteristic::isValid() const
{
@@ -265,6 +301,12 @@ bool QLowEnergyCharacteristic::isValid() const
return true;
}
+/*!
+ \internal
+
+ Returns the handle of the characteristic or
+ \c 0 if the handle cannot be accessed on the platform.
+ */
QLowEnergyHandle QLowEnergyCharacteristic::attributeHandle() const
{
if (d_ptr.isNull() || !data)
@@ -275,8 +317,7 @@ QLowEnergyHandle QLowEnergyCharacteristic::attributeHandle() const
/*!
- Returns the descriptor with \a uuid; otherwise an invalid \c QLowEnergyDescriptor
- instance.
+ Returns the descriptor for \a uuid or an invalid \c QLowEnergyDescriptor instance.
\sa descriptors()
*/
diff --git a/src/bluetooth/qlowenergycharacteristic.h b/src/bluetooth/qlowenergycharacteristic.h
index 1c30a939..e0ed2976 100644
--- a/src/bluetooth/qlowenergycharacteristic.h
+++ b/src/bluetooth/qlowenergycharacteristic.h
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp
index d0c70ba3..00c51adf 100644
--- a/src/bluetooth/qlowenergycontroller.cpp
+++ b/src/bluetooth/qlowenergycontroller.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,6 +40,157 @@
QT_BEGIN_NAMESPACE
+/*!
+ \class QLowEnergyController
+ \inmodule QtBluetooth
+ \brief The QLowEnergyController class provides access to Bluetooth
+ Low Energy Devices.
+
+ \since 5.4
+
+ QLowEnergyController acts as the entry point for Bluetooth Low Energy
+ development. Each QLowEnergyController instance acts as placeholder
+ towards a remote Low Energy device enabling connection control,
+ service discovery and state tracking.
+
+ Bluetooth Low Energy defines two types of devices; the peripheral and
+ the central. Each role performs a different task. The peripheral device
+ provides data which is utilized by central devices. An example might be a
+ humidity sensor which measures the moisture in a winter garden. A device
+ such as a mobile phone might read the sensor's value and display it to the user
+ in the greater context of all sensors in the same environment. In this case
+ the sensor is the peripheral device and the mobile phone acts as the
+ central device.
+
+ At the moment Qt only supports the central role and therefore the remote
+ device can only be a device acting as a peripheral. This implies that the local
+ device acts within the boundaries of the central role as per the Bluetooth 4.0
+ specification.
+
+ The first step is to establish a connection via \l connectToDevice().
+ Once the connection has been established, the controller's \l state()
+ changes to \l QLowEnergyController::ConnectedState and the \l connected()
+ signal is emitted. It is important to mention that the remote device can
+ usually only be connected to a single device. Therefore it is not
+ possible to have multiple instances of this class being connected to the
+ same remote device. The \l disconnectFromDevice() function is used to break
+ the existing connection.
+
+ The second step after establishing the connection is to discover the services
+ offered by the remote peripheral device. This process is started via
+ \l discoverServices() and has finished once the \l discoveryFinished() signal
+ has been emitted. The discovered services can be enumerated via
+ \l services().
+
+ The last step is to create service objects. The \l createServiceObject()
+ function acts as factory for each service object and expects the service
+ UUID as parameter. The calling context should take ownership of the returned
+ \l QLowEnergyService instance.
+
+ Any \l QLowEnergyService, \l QLowEnergyCharacteristic or
+ \l QLowEnergyDescriptor instance which is later created from this controller's
+ connection becomes invalid as soon as the controller disconnects from the
+ remote Bluetooth Low Energy device.
+
+ \sa QLowEnergyService, QLowEnergyCharacteristic, QLowEnergyDescriptor
+*/
+
+/*!
+ \enum QLowEnergyController::Error
+
+ Indicates all possible error conditions found during the controller's
+ existence.
+
+ \value NoError No error has occurred.
+ \value UnknownError An unknown error has occurred.
+ \value UnknownRemoteDeviceError The remote Bluetooth Low Energy device with the address passed to
+ the constructor of this class cannot be found.
+ \value NetworkError The attempt to read from or write to the
+ remote device failed.
+ \value InvalidBluetoothAdapterError The local Bluetooth device with the address passed to
+ the constructor of this class cannot be found or
+ there is no local Bluetooth device.
+*/
+
+/*!
+ \enum QLowEnergyController::ControllerState
+
+ Indicates the state of the controller object.
+
+ \value UnconnectedState The controller is not connected to a remote device.
+ \value ConnectingState The controller is attempting to connect to a remote device.
+ \value ConnectedState The controller is connected to a remote device.
+ \value DiscoveringState The controller is retrieving the list of services offered
+ by the remote device.
+ \value DiscoveredState The controller has discovered all services offered by the
+ remote device.
+ \value ClosingState The controller is about to be disconnected from the remote device.
+*/
+
+/*!
+ \enum QLowEnergyController::RemoteAddressType
+
+ Indicates what type of Bluetooth address the remote device uses.
+
+ \value PublicAddress The peripheral uses a public Bluetooth address.
+ \value RandomAddress A random address is a Bluetooth Low Energy security feature.
+ Peripherals using such addresses may frequently change their
+ Bluetooth address. This information is needed when trying to
+ connect to a peripheral.
+ */
+
+
+/*!
+ \fn void QLowEnergyController::connected()
+
+ This signal is emitted when the controller successfully connects to the remote
+ Low Energy device.
+*/
+
+/*!
+ \fn void QLowEnergyController::disconnected()
+
+ This signal is emitted when the controller disconnects from the remote
+ Low Energy device.
+*/
+
+/*!
+ \fn void QLowEnergyController::stateChanged(ControllerState state)
+
+ This signal is emitted when the controller's state changes. The new
+ \a state can also be retrieved via \l state().
+
+ \sa state()
+*/
+
+/*!
+ \fn void QLowEnergyController::error(QLowEnergyController::Error newError)
+
+ This signal is emitted when an error occurs.
+ The \a newError parameter describes the error that occurred.
+
+ \sa error(), errorString()
+*/
+
+/*!
+ \fn void QLowEnergyController::serviceDiscovered(const QBluetoothUuid &newService)
+
+ This signal is emitted each time a new service is discovered. The
+ \a newService parameter contains the UUID of the found service.
+
+ \sa discoverServices(), discoveryFinished()
+*/
+
+/*!
+ \fn void QLowEnergyController::discoveryFinished()
+
+ This signal is emitted when the running service discovery finishes.
+ The signal is not emitted if the discovery process finishes with
+ an error.
+
+ \sa discoverServices(), error()
+*/
+
void QLowEnergyControllerPrivate::setError(
QLowEnergyController::Error newError)
{
@@ -215,6 +358,16 @@ quint16 QLowEnergyControllerPrivate::updateValueOfDescriptor(
return service->characteristicList[charHandle].descriptorList[descriptorHandle].value.size();
}
+/*!
+ Constructs a new instance of this class with \a parent.
+
+ The \a remoteDevice must contain the address of the
+ remote Bluetooth Low Energy device to which this object
+ should attempt to connect later on.
+
+ The controller uses the local default Bluetooth adapter for
+ the connection management.
+ */
QLowEnergyController::QLowEnergyController(
const QBluetoothAddress &remoteDevice,
QObject *parent)
@@ -224,8 +377,22 @@ QLowEnergyController::QLowEnergyController(
d->q_ptr = this;
d->remoteDevice = remoteDevice;
d->localAdapter = QBluetoothLocalDevice().address();
+ d->addressType = QLowEnergyController::PublicAddress;
}
+/*!
+ Constructs a new instance of this class with \a parent.
+
+ The \a remoteDevice must contain the address of the
+ remote Bluetooth Low Energy device to which this object
+ should attempt to connect later on.
+
+ The connection is established via \a localDevice. If \a localDevice
+ is invalid, the local default device is automatically selected. If
+ \a localDevice specifies a local device that is not a local Bluetooth
+ adapter, \l error() is set to \l InvalidBluetoothAdapterError once
+ \l connectToDevice() is called.
+ */
QLowEnergyController::QLowEnergyController(
const QBluetoothAddress &remoteDevice,
const QBluetoothAddress &localDevice,
@@ -238,6 +405,9 @@ QLowEnergyController::QLowEnergyController(
d->localAdapter = localDevice;
}
+/*!
+ Destroys the QLowEnergyController instance.
+ */
QLowEnergyController::~QLowEnergyController()
{
disconnectFromDevice(); //in case we were connected
@@ -259,16 +429,54 @@ QBluetoothAddress QLowEnergyController::localAddress() const
return d_ptr->localAdapter;
}
+/*!
+ Returns the address of the remote Bluetooth Low Energy device.
+ */
QBluetoothAddress QLowEnergyController::remoteAddress() const
{
return d_ptr->remoteDevice;
}
+/*!
+ Returns the current state of the controller.
+
+ \sa stateChanged()
+ */
QLowEnergyController::ControllerState QLowEnergyController::state() const
{
return d_ptr->state;
}
+/*!
+ Returns the type of \l remoteAddress(). By default, this value is initialized
+ to \l PublicAddress.
+
+ \sa setRemoteAddressType()
+ */
+QLowEnergyController::RemoteAddressType QLowEnergyController::remoteAddressType() const
+{
+ return d_ptr->addressType;
+}
+
+/*!
+ Sets the remote address \a type. The type is required to connect
+ to the remote Bluetooth Low Energy device.
+ */
+void QLowEnergyController::setRemoteAddressType(
+ QLowEnergyController::RemoteAddressType type)
+{
+ d_ptr->addressType = type;
+}
+
+/*!
+ Connects to the remote Bluetooth Low Energy device.
+
+ This function does nothing if the controller's \l state()
+ is \l UnconnectedState. The \l connected() signal is emitted
+ once the connection is successfully established.
+
+ \sa disconnectFromDevice()
+ */
void QLowEnergyController::connectToDevice()
{
Q_D(QLowEnergyController);
@@ -284,6 +492,16 @@ void QLowEnergyController::connectToDevice()
d->connectToDevice();
}
+/*!
+ Disconnects from the remote device.
+
+ Any \l QLowEnergyService, \l QLowEnergyCharacteristic or \l QLowEnergyDescriptor
+ instance that resulted from the current connection is automatically invalidated.
+ Once any of those objects become invalid they remain invalid even if this
+ controller object reconnects.
+
+ \sa connectToDevice()
+ */
void QLowEnergyController::disconnectFromDevice()
{
Q_D(QLowEnergyController);
@@ -295,6 +513,15 @@ void QLowEnergyController::disconnectFromDevice()
d->disconnectFromDevice();
}
+/*!
+ Initiates the service discovery process.
+
+ The discovery progress is indicated via the \l serviceDiscovered() signal.
+ The \l discoveryFinished() signal is emitted when the process has finished.
+
+ If the controller instance is not connected or the controller has performed
+ the service discovery already this function will do nothing.
+ */
void QLowEnergyController::discoverServices()
{
Q_D(QLowEnergyController);
@@ -302,6 +529,7 @@ void QLowEnergyController::discoverServices()
if (d->state != QLowEnergyController::ConnectedState)
return;
+ d->setState(QLowEnergyController::DiscoveringState);
d->discoverServices();
}
@@ -326,12 +554,19 @@ QList<QBluetoothUuid> QLowEnergyController::services() const
a \a parent parameter as default owner.
This function returns a null pointer if no service with
- \a serviceUUid can be found on the remote device.
+ \a serviceUuid can be found on the remote device or the controller
+ is disconnected.
This function can return instances for secondary services
too. The include relationships between services can be expressed
via \l QLowEnergyService::includedServices().
+ If this function is called multiple times using the same service UUID,
+ the returned \l QLowEnergyService instances share their internal
+ data. Therefore if one of the instances initiates the discovery
+ of the service details, the other instances automatically
+ transition into the discovery state too.
+
\sa services()
*/
QLowEnergyService *QLowEnergyController::createServiceObject(
@@ -347,11 +582,18 @@ QLowEnergyService *QLowEnergyController::createServiceObject(
return service;
}
+/*!
+ Returns the last occurred error or \l NoError.
+*/
QLowEnergyController::Error QLowEnergyController::error() const
{
return d_ptr->error;
}
+/*!
+ Returns a textual representation of the last occurred error.
+ The string is translated.
+*/
QString QLowEnergyController::errorString() const
{
return d_ptr->errorString;
diff --git a/src/bluetooth/qlowenergycontroller.h b/src/bluetooth/qlowenergycontroller.h
index 27421cf1..bd8ef5f3 100644
--- a/src/bluetooth/qlowenergycontroller.h
+++ b/src/bluetooth/qlowenergycontroller.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -66,9 +58,16 @@ public:
UnconnectedState = 0,
ConnectingState,
ConnectedState,
+ DiscoveringState,
+ DiscoveredState,
ClosingState,
};
+ enum RemoteAddressType {
+ PublicAddress = 0,
+ RandomAddress
+ };
+
explicit QLowEnergyController(const QBluetoothAddress &remoteDevice,
QObject *parent = 0);
explicit QLowEnergyController(const QBluetoothAddress &remoteDevice,
@@ -81,10 +80,12 @@ public:
ControllerState state() const;
+ RemoteAddressType remoteAddressType() const;
+ void setRemoteAddressType(RemoteAddressType type);
+
void connectToDevice();
void disconnectFromDevice();
- // TODO add a way of detecting whether discoverDetails() as already called
void discoverServices();
QList<QBluetoothUuid> services() const;
QLowEnergyService *createServiceObject(
diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp
index dcb99736..79d5add6 100644
--- a/src/bluetooth/qlowenergycontroller_bluez.cpp
+++ b/src/bluetooth/qlowenergycontroller_bluez.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -72,11 +64,12 @@
#define ATT_OP_READ_BLOB_RESPONSE 0xD
#define ATT_OP_READ_BY_GROUP_REQUEST 0x10 //discover services
#define ATT_OP_READ_BY_GROUP_RESPONSE 0x11
-#define ATT_OP_WRITE_REQUEST 0x12 //write characteristic
+#define ATT_OP_WRITE_REQUEST 0x12 //write characteristic with response
#define ATT_OP_WRITE_RESPONSE 0x13
#define ATT_OP_HANDLE_VAL_NOTIFICATION 0x1b //informs about value change
#define ATT_OP_HANDLE_VAL_INDICATION 0x1d //informs about value change -> requires reply
#define ATT_OP_HANDLE_VAL_CONFIRMATION 0x1e //answer for ATT_OP_HANDLE_VAL_INDICATION
+#define ATT_OP_WRITE_COMMAND 0x52 //write characteristic without response
//GATT command sizes in bytes
#define FIND_INFO_REQUEST_SIZE 5
@@ -84,7 +77,7 @@
#define READ_BY_TYPE_REQ_SIZE 7
#define READ_REQUEST_SIZE 3
#define READ_BLOB_REQUEST_SIZE 5
-#define WRITE_REQUEST_SIZE 3
+#define WRITE_REQUEST_SIZE 3 // same size for WRITE_COMMAND
#define MTU_EXCHANGE_SIZE 3
// GATT error codes
@@ -213,7 +206,10 @@ void QLowEnergyControllerPrivate::connectToDevice()
this, SLOT(l2cpErrorChanged(QBluetoothSocket::SocketError)));
connect(l2cpSocket, SIGNAL(readyRead()), this, SLOT(l2cpReadyRead()));
- l2cpSocket->d_ptr->isLowEnergySocket = true;
+ if (addressType == QLowEnergyController::PublicAddress)
+ l2cpSocket->d_ptr->lowEnergySocketType = BDADDR_LE_PUBLIC;
+ else if (addressType == QLowEnergyController::RandomAddress)
+ l2cpSocket->d_ptr->lowEnergySocketType = BDADDR_LE_RANDOM;
// bind the socket to the local device
int sockfd = l2cpSocket->socketDescriptor();
@@ -456,10 +452,12 @@ void QLowEnergyControllerPrivate::processReply(
const quint16 type = request.reference.toUInt();
if (isErrorResponse) {
- if (type == GATT_SECONDARY_SERVICE)
+ if (type == GATT_SECONDARY_SERVICE) {
+ setState(QLowEnergyController::DiscoveredState);
q->discoveryFinished();
- else // search for secondary services
+ } else { // search for secondary services
sendReadByGroupRequest(0x0001, 0xFFFF, GATT_SECONDARY_SERVICE);
+ }
break;
}
@@ -502,10 +500,12 @@ void QLowEnergyControllerPrivate::processReply(
if (end != 0xFFFF) {
sendReadByGroupRequest(end+1, 0xFFFF, type);
} else {
- if (type == GATT_SECONDARY_SERVICE)
+ if (type == GATT_SECONDARY_SERVICE) {
+ setState(QLowEnergyController::DiscoveredState);
emit q->discoveryFinished();
- else // search for secondary services
+ } else { // search for secondary services
sendReadByGroupRequest(0x0001, 0xFFFF, GATT_SECONDARY_SERVICE);
+ }
}
}
break;
@@ -795,11 +795,11 @@ void QLowEnergyControllerPrivate::processReply(
if (!descriptorHandle) {
service->characteristicList[charHandle].value = newValue;
QLowEnergyCharacteristic ch(service, charHandle);
- emit service->characteristicChanged(ch, newValue);
+ emit service->characteristicWritten(ch, newValue);
} else {
service->characteristicList[charHandle].descriptorList[descriptorHandle].value = newValue;
QLowEnergyDescriptor descriptor(service, charHandle, descriptorHandle);
- emit service->descriptorChanged(descriptor, newValue);
+ emit service->descriptorWritten(descriptor, newValue);
}
}
break;
@@ -890,7 +890,6 @@ void QLowEnergyControllerPrivate::sendReadByTypeRequest(
void QLowEnergyControllerPrivate::readServiceValues(
const QBluetoothUuid &serviceUuid, bool readCharacteristics)
{
- // TODO Long charactertistic value reads not yet supported (larger than MTU)
quint8 packet[READ_REQUEST_SIZE];
if (QT_BT_BLUEZ().isDebugEnabled()) {
if (readCharacteristics)
@@ -1124,7 +1123,8 @@ void QLowEnergyControllerPrivate::discoverNextDescriptor(
void QLowEnergyControllerPrivate::writeCharacteristic(
const QSharedPointer<QLowEnergyServicePrivate> service,
const QLowEnergyHandle charHandle,
- const QByteArray &newValue)
+ const QByteArray &newValue,
+ bool writeWithResponse)
{
Q_ASSERT(!service.isNull());
@@ -1136,16 +1136,27 @@ void QLowEnergyControllerPrivate::writeCharacteristic(
const int size = 1 + 2 + newValue.size();
quint8 packet[WRITE_REQUEST_SIZE];
- packet[0] = ATT_OP_WRITE_REQUEST;
- bt_put_unaligned(htobs(valueHandle), (quint16 *) &packet[1]);
+ if (writeWithResponse)
+ packet[0] = ATT_OP_WRITE_REQUEST;
+ else
+ packet[0] = ATT_OP_WRITE_COMMAND;
+ bt_put_unaligned(htobs(valueHandle), (quint16 *) &packet[1]);
QByteArray data(size, Qt::Uninitialized);
memcpy(data.data(), packet, WRITE_REQUEST_SIZE);
memcpy(&(data.data()[WRITE_REQUEST_SIZE]), newValue.constData(), newValue.size());
qCDebug(QT_BT_BLUEZ) << "Writing characteristic" << hex << charHandle
- << "(size:" << size << ")";
+ << "(size:" << size << "response:" << writeWithResponse << ")";
+
+ // Advantage of write without response is the quick turnaround.
+ // It can be send at any time and does not produce responses.
+ // Therefore we will not put them into the openRequest queue at all.
+ if (!writeWithResponse) {
+ sendCommand(data);
+ return;
+ }
Request request;
request.payload = data;
diff --git a/src/bluetooth/qlowenergycontroller_p.cpp b/src/bluetooth/qlowenergycontroller_p.cpp
index a903494d..7de0c604 100644
--- a/src/bluetooth/qlowenergycontroller_p.cpp
+++ b/src/bluetooth/qlowenergycontroller_p.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -74,19 +66,19 @@ void QLowEnergyControllerPrivate::discoverServiceDetails(const QBluetoothUuid &/
}
-void QLowEnergyControllerPrivate::writeCharacteristic(
- const QSharedPointer<QLowEnergyServicePrivate> /*service*/,
+void QLowEnergyControllerPrivate::writeCharacteristic(const QSharedPointer<QLowEnergyServicePrivate> /*service*/,
const QLowEnergyHandle /*charHandle*/,
- const QByteArray &/*newValue*/)
+ const QByteArray &/*newValue*/,
+ bool /*writeWithResponse*/)
{
}
void QLowEnergyControllerPrivate::writeDescriptor(
- const QSharedPointer<QLowEnergyServicePrivate> service,
- const QLowEnergyHandle charHandle,
- const QLowEnergyHandle descriptorHandle,
- const QByteArray &newValue)
+ const QSharedPointer<QLowEnergyServicePrivate> /*service*/,
+ const QLowEnergyHandle /*charHandle*/,
+ const QLowEnergyHandle /*descriptorHandle*/,
+ const QByteArray &/*newValue*/)
{
}
diff --git a/src/bluetooth/qlowenergycontroller_p.h b/src/bluetooth/qlowenergycontroller_p.h
index ef21fbff..d9f75625 100644
--- a/src/bluetooth/qlowenergycontroller_p.h
+++ b/src/bluetooth/qlowenergycontroller_p.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -97,7 +89,7 @@ public:
// write data
void writeCharacteristic(const QSharedPointer<QLowEnergyServicePrivate> service,
const QLowEnergyHandle charHandle,
- const QByteArray &newValue);
+ const QByteArray &newValue, bool writeWithResponse = true);
void writeDescriptor(const QSharedPointer<QLowEnergyServicePrivate> service,
const QLowEnergyHandle charHandle,
const QLowEnergyHandle descriptorHandle,
@@ -114,6 +106,8 @@ public:
// list of all found service uuids
ServiceDataMap serviceList;
+ QLowEnergyController::RemoteAddressType addressType;
+
private:
#if defined(QT_BLUEZ_BLUETOOTH) && !defined(QT_BLUEZ_NO_BTLE)
QBluetoothSocket *l2cpSocket;
diff --git a/src/bluetooth/qlowenergydescriptor.cpp b/src/bluetooth/qlowenergydescriptor.cpp
index 6817d20e..270a8a68 100644
--- a/src/bluetooth/qlowenergydescriptor.cpp
+++ b/src/bluetooth/qlowenergydescriptor.cpp
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -54,9 +46,18 @@ QT_BEGIN_NAMESPACE
\since 5.4
QLowEnergyDescriptor provides information about a Bluetooth Low Energy
- descriptor's name, UUID, value and handle. Descriptors are contained in the
- Bluetooth Low Energy characteristic and they provide additional information
- about the characteristic (data format, notification activation, etc).
+ descriptor's \l name(), \l uuid(), \l value() and \l handle(). Descriptors are
+ encapsulated by Bluetooth Low Energy characteristics and provide additional
+ centextual information about the characteristic (data format, notification activation
+ and so on).
+
+ The descriptor value may be written via the \l QLowEnergyService instance
+ that manages the service to which this descriptor belongs. The
+ \l {QLowEnergyService::writeDescriptor()} function writes the new value.
+ The \l {QLowEnergyService::descriptorWritten()} signal
+ is emitted upon success. The cahced \l value() of this object is updated accordingly.
+
+ \sa QLowEnergyService, QLowEnergyCharacteristic
*/
struct QLowEnergyDescriptorPrivate
@@ -66,7 +67,8 @@ struct QLowEnergyDescriptorPrivate
};
/*!
- Construct a new QLowEnergyDescriptor.
+ Construct a new QLowEnergyDescriptor. A default-constructed instance
+ of this class is always invalid.
*/
QLowEnergyDescriptor::QLowEnergyDescriptor():
d_ptr(0), data(0)
@@ -74,7 +76,7 @@ QLowEnergyDescriptor::QLowEnergyDescriptor():
}
/*!
- Construct a new QLowEnergyDesxcriptor that is a copy of \a other.
+ Construct a new QLowEnergyDescriptor that is a copy of \a other.
The two copies continue to share the same underlying data which does not detach
upon write.
@@ -114,7 +116,7 @@ QLowEnergyDescriptor::~QLowEnergyDescriptor()
/*!
Makes a copy of \a other and assigns it to this QLowEnergyDescriptor object.
- The two copies continue to share the same service and registration details.
+ The two copies continue to share the same service and controller details.
*/
QLowEnergyDescriptor &QLowEnergyDescriptor::operator=(const QLowEnergyDescriptor &other)
{
@@ -140,7 +142,8 @@ QLowEnergyDescriptor &QLowEnergyDescriptor::operator=(const QLowEnergyDescriptor
Returns \c true if \a other is equal to this QLowEnergyCharacteristic; otherwise \c false.
Two QLowEnergyDescriptor instances are considered to be equal if they refer to
- the same descriptor on the same remote Bluetooth Low Energy device.
+ the same descriptor on the same remote Bluetooth Low Energy device or both
+ instances have been default-constructed.
*/
bool QLowEnergyDescriptor::operator==(const QLowEnergyDescriptor &other) const
{
@@ -165,7 +168,8 @@ bool QLowEnergyDescriptor::operator==(const QLowEnergyDescriptor &other) const
Returns \c true if \a other is not equal to this QLowEnergyCharacteristic; otherwise \c false.
Two QLowEnergyDescriptor instances are considered to be equal if they refer to
- the same descriptor on the same remote Bluetooth Low Energy device.
+ the same descriptor on the same remote Bluetooth Low Energy device or both
+ instances have been default-constructed.
*/
bool QLowEnergyDescriptor::operator!=(const QLowEnergyDescriptor &other) const
{
@@ -175,14 +179,15 @@ bool QLowEnergyDescriptor::operator!=(const QLowEnergyDescriptor &other) const
/*!
Returns \c true if the QLowEnergyDescriptor object is valid, otherwise returns \c false.
- An invalid descriptor instance is not associated to any service
- or the associated service is no longer valid due to for example a disconnect from
- the underlying Bluetooth Low Energy device. Once the object is invalid
+ An invalid descriptor instance is not associated with any service (default-constructed)
+ or the associated service is no longer valid due to a disconnect from
+ the underlying Bluetooth Low Energy device, for example. Once the object is invalid
it cannot become valid anymore.
\note If a QLowEnergyDescriptor instance turns invalid due to a disconnect
from the underlying device, the information encapsulated by the current
- instance remains as it was at the time of the disconnect.
+ instance remains as it was at the time of the disconnect. Therefore it can be
+ retrieved after the disconnect event.
*/
bool QLowEnergyDescriptor::isValid() const
{
@@ -196,7 +201,8 @@ bool QLowEnergyDescriptor::isValid() const
}
/*!
- Returns the UUID of this descriptor.
+ Returns the UUID of this descriptor if \l isValid() returns \c true; otherwise a
+ \l {QUuid::isNull()}{null} UUID.
*/
QBluetoothUuid QLowEnergyDescriptor::uuid() const
{
@@ -211,7 +217,8 @@ QBluetoothUuid QLowEnergyDescriptor::uuid() const
}
/*!
- Returns the handle of the descriptor.
+ Returns the handle of the descriptor or \c 0 if the handle
+ cannot be accessed on the platform.
*/
QLowEnergyHandle QLowEnergyDescriptor::handle() const
{
@@ -222,7 +229,10 @@ QLowEnergyHandle QLowEnergyDescriptor::handle() const
}
/*!
- Returns the value of the descriptor.
+ Returns the cached value of the descriptor.
+
+ A descriptor value may be updated using
+ \l QLowEnergyService::writeDescriptor().
*/
QByteArray QLowEnergyDescriptor::value() const
{
@@ -237,9 +247,15 @@ QByteArray QLowEnergyDescriptor::value() const
}
/*!
- Returns the name of the descriptor type.
+ Returns the human-readable name of the descriptor.
- \sa type()
+ The name is based on the descriptor's \l type(). The complete list
+ of descriptor types can be found under
+ \l {https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx}{Bluetooth.org Descriptors}.
+
+ The returned string is empty if the \l type() is unknown.
+
+ \sa type(), QBluetoothUuid::descriptorToString()
*/
QString QLowEnergyDescriptor::name() const
@@ -248,7 +264,9 @@ QString QLowEnergyDescriptor::name() const
}
/*!
- Returns the type of descriptor.
+ Returns the type of the descriptor.
+
+ \sa name()
*/
QBluetoothUuid::DescriptorType QLowEnergyDescriptor::type() const
{
diff --git a/src/bluetooth/qlowenergydescriptor.h b/src/bluetooth/qlowenergydescriptor.h
index 2c0a3296..38c8518f 100644
--- a/src/bluetooth/qlowenergydescriptor.h
+++ b/src/bluetooth/qlowenergydescriptor.h
@@ -6,36 +6,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qlowenergyservice.cpp b/src/bluetooth/qlowenergyservice.cpp
index 725c82e9..9136f83b 100644
--- a/src/bluetooth/qlowenergyservice.cpp
+++ b/src/bluetooth/qlowenergyservice.cpp
@@ -1,40 +1,33 @@
/****************************************************************************
**
** 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:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,18 +44,226 @@
QT_BEGIN_NAMESPACE
/*!
- \enum QBluetoothDeviceInfo::ServiceType
+ \class QLowEnergyService
+ \inmodule QtBluetooth
+ \brief The QLowEnergyService class represents an individual service
+ on a Bluetooth Low Energy Device.
+
+ \since 5.4
+
+ QLowEnergyService provides access to the details of Bluetooth Low Energy
+ services. The class facilitates the discovery and publification of
+ service details, permits reading and writing of the contained data
+ and notifies about data changes.
+
+ \section1 Service Structure
+
+ A Bluetooth Low Energy peripheral device can contain multiple services.
+ In turn each service may include further services. This class represents a
+ single service of the peripheral device and is created via
+ \l QLowEnergyController::createServiceObject(). The \l type() indicates
+ whether this service is a primary (top-level) service or whether the
+ service is part of another service. Each service may contain one or more
+ characteristics and each characteristic may contain descriptors. The
+ resulting structure may look like the following diagram:
+
+ \image peripheral-structure.png Structure of a generic peripheral
+
+ A characteristic is the principle information carrier. It has a
+ \l {QLowEnergyCharacteristic::value()}{value()} and
+ \l {QLowEnergyCharacteristic::value()}{properties()}
+ describing the access permissions for the value. The general purpose
+ of the contained descriptor is to further define the nature of the
+ characteristic. For example, it might specify how the value is meant to be
+ interpreted or whether it can notify the value consumer about value
+ changes.
+
+ \section1 Service Interaction
+
+ Once a service object was created for the first time, its details are yet to
+ be discovered. This is indicated by its current \l state() being \l DiscoveryRequired.
+ It is only possible to retrieve the \l serviceUuid() and \l serviceName().
+
+ The discovery of its included services, characteristics and descriptors
+ is triggered when calling \l discoverDetails(). During the discovery the
+ \l state() transitions from \l DiscoveryRequired via \l DiscoveringServices
+ to its final \l ServiceDiscovered state. This transition is advertised via
+ the \l stateChanged() signal. Once the details are known, all of the contained
+ characteristics, descriptors and included services are known and can be read
+ or written.
+
+ The values of characteristics and descriptors can be retrieved via
+ \l QLowEnergyCharacteristic and \l QLowEnergyDescriptor, respectively.
+ However writing those attributes requires the service object. The
+ \l writeCharacteristic() function attempts to write a new value to the given
+ characteristic. If the write attempt is successful, the \l characteristicWritten()
+ signal is emitted. A failure to write triggers the \l CharacteristicWriteError.
+ Writing a descriptor follows the same pattern.
+
+ \target notifications
+
+ In some cases the peripheral generates value updates which
+ the central is interested in receiving. In order for a characteristic to support
+ such notifications it must have the \l QLowEnergyCharacteristic::Notify or
+ \l QLowEnergyCharacteristic::Indicate property and a descriptor of type
+ \l QBluetoothUuid::ClientCharacteristicConfiguration. Provided those conditions
+ are fulfilled notifications can be enabled as shown in the following code segment:
+
+ \snippet doc_src_qtbluetooth.cpp enable_btle_notifications
+
+ The example shows a battery level characteristic which updates the central
+ on every value change. The notifications are provided via
+ the \l characteristicChanged() signal. More details about this mechanism
+ are provided by the
+ \l {https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml}{Bluetooth Specification}.
+
+ \section1 Service Data Sharing
+
+ Each QLowEnergyService instance shares its internal states and information
+ with other QLowEnergyService instance of the same service. If one instance
+ initiates the discovery of the service details, all remaining instances
+ automatically follow. Therefore the following snippet always works:
+
+ \snippet doc_src_qtbluetooth.cpp data_share_qlowenergyservice
+
+ Other operations such as calls to \l writeCharacteristic(),
+ writeDescriptor() or the invalidation of the service due to the
+ related \l QLowEnergyController disconnecting from the device are shared
+ the same way.
+
+ \sa QLowEnergyController, QLowEnergyCharacteristic, QLowEnergyDescriptor
+ */
+
+/*!
+ \enum QLowEnergyService::ServiceType
This enum describes the type of the service.
\value PrimaryService The service is a top-level/primary service.
- If this type flag is not set the service is considered
+ If this type flag is not set, the service is considered
to be a secondary service. Each service may be included
- by another service which is indicated by \l IncludedService.
+ by another service which is indicated by IncludedService.
\value IncludedService The service is included by another service.
*/
/*!
+ \enum QLowEnergyService::ServiceError
+
+ This enum describes all possible error conditions during the service's
+ existence. The \l error() function returns the last occurred error.
+
+ \value NoError No error has occurred.
+ \value OperationError An operation was attempted while the service was not ready.
+ An example might be the attempt to write to
+ the service while it was not yet in the
+ \l ServiceDiscovered \l state() or the service is invalid
+ due to a loss of connection to the peripheral device.
+ \value CharacteristicWriteError An attempt to write a new value to a characteristic
+ failed. For example, it might be triggered when attempting
+ to write to a read-only characteristic.
+ \value DescriptorWriteError An attempt to write a new value to a descriptor
+ failed. For example, it might be triggered when attempting
+ to write to a read-only descriptor.
+ */
+
+/*!
+ \enum QLowEnergyService::ServiceState
+
+ This enum describes the \l state() of the service object.
+
+ \value InvalidService A service can become invalid when it looses
+ the connection to the underlying device. Even though
+ the connection may be lost it retains its last information.
+ An invalid service cannot become valid anymore even if
+ the connection to the device is re-established.
+ \value DiscoveryRequired The service details are yet to be discovered by calling \l discoverDetails().
+ The only reliable pieces of information are its
+ \l serviceUuid() and \l serviceName().
+ \value DiscoveringServices The service details are being discovered.
+ \value ServiceDiscovered The service details have been discovered.
+ */
+
+/*!
+ \enum QLowEnergyService::WriteMode
+
+ This enum describes the mode to be used when writing a characteristic value.
+ The characteristic advertises its supported write modes via its
+ \l {QLowEnergyCharacteristic::properties()}{properties}.
+
+ \value WriteWithResponse If a characteristic is written using this mode, the peripheral
+ shall send a write confirmation. If the operation is
+ successful, the confirmation is emitted via the
+ \l characteristicWritten() signal. Otherwise the
+ \l CharacteristicWriteError is emitted.
+ A characteristic must have set the
+ \l QLowEnergyCharacteristic::Write property to support this
+ write mode.
+
+ \value WriteWithoutResponse If a characteristic is written using this mode, the remote peripheral
+ shall not send a write confirmation. The operation's success
+ cannot be determined and the payload must not be longer than 20 bytes.
+ A characteristic must have set the
+ \l QLowEnergyCharacteristic::WriteNoResponse property to support this
+ write mode. Its adavantage is a quicker
+ write operation as it may happen in between other
+ device interactions.
+ */
+
+/*!
+ \fn void QLowEnergyService::stateChanged(QLowEnergyService::ServiceState newState)
+
+ This signal is emitted when the service's state changes. The \a newState can also be
+ retrieved via \l state().
+
+ \sa state()
+ */
+
+/*!
+ \fn void QLowEnergyService::error(QLowEnergyService::ServiceError newError)
+
+ This signal is emitted when an error occurrs. The \a newError parameter
+ describes the error that occurred.
+ */
+
+/*!
+ \fn void QLowEnergyService::characteristicWritten(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue);
+
+ This signal is emitted when the value of \a characteristic
+ is successfully changed to \a newValue. The change must have been triggered
+ by calling \l writeCharacteristic(). If the write operation is not successful,
+ the \l error() signal is emitted using the \l CharacteristicWriteError flag.
+
+ \note If \l writeCharacteristic() is called using the \l WriteWithoutResponse mode,
+ this signal and the \l error() are never emitted.
+
+ \sa writeCharacteristic()
+ */
+
+/*!
+ \fn void QLowEnergyService::characteristicChanged(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue);
+
+ This signal is emitted when the value of \a characteristic is changed
+ by an event on the peripheral. The \a newValue parameter contains the
+ updated value of the \a characteristic.
+
+ The signal emission implies that change notifications must
+ have been activated via the characteristic's
+ \l {QBluetoothUuid::ClientCharacteristicConfiguration}{ClientCharacteristicConfiguration}
+ descriptor prior to the change event on the peripheral. More details on how this might be
+ done can be found further \l{notifications}{above}.
+ */
+
+/*!
+ \fn void QLowEnergyService::descriptorWritten(const QLowEnergyDescriptor &descriptor, const QByteArray &newValue)
+
+ This signal is emitted when the value of \a descriptor
+ is successfully changed to \a newValue. The change must have been caused
+ by calling \l writeDescriptor().
+
+ \sa writeDescriptor()
+ */
+
+/*!
\internal
QLowEnergyControllerPrivate creates instances of this class.
@@ -83,26 +284,30 @@ QLowEnergyService::QLowEnergyService(QSharedPointer<QLowEnergyServicePrivate> p,
this, SIGNAL(stateChanged(QLowEnergyService::ServiceState)));
connect(p.data(), SIGNAL(characteristicChanged(QLowEnergyCharacteristic,QByteArray)),
this, SIGNAL(characteristicChanged(QLowEnergyCharacteristic,QByteArray)));
- connect(p.data(), SIGNAL(descriptorChanged(QLowEnergyDescriptor,QByteArray)),
- this, SIGNAL(descriptorChanged(QLowEnergyDescriptor,QByteArray)));
+ connect(p.data(), SIGNAL(characteristicWritten(QLowEnergyCharacteristic,QByteArray)),
+ this, SIGNAL(characteristicWritten(QLowEnergyCharacteristic,QByteArray)));
+ connect(p.data(), SIGNAL(descriptorWritten(QLowEnergyDescriptor,QByteArray)),
+ this, SIGNAL(descriptorWritten(QLowEnergyDescriptor,QByteArray)));
}
-
+/*!
+ Destroys the \l QLowEnergyService instance.
+ */
QLowEnergyService::~QLowEnergyService()
{
}
/*!
- Returns the uuids of all services which are included by the
+ Returns the UUIDs of all services which are included by the
current service.
It is possible that an included service contains yet another service. Such
second level includes have to be obtained via their relevant first level
- QLowEnergyService instance. Technically it is possible that this can create
+ QLowEnergyService instance. Technically, this could create
a circular dependency.
- \l {QLowEnergyController::createServiceObject} should be used to obtain
- service instances for each of the uuids.
+ \l {QLowEnergyController::createServiceObject()} should be used to obtain
+ service instances for each of the UUIDs.
\sa createServiceObject()
*/
@@ -111,11 +316,39 @@ QList<QBluetoothUuid> QLowEnergyService::includedServices() const
return d_ptr->includedServices;
}
+/*!
+ Returns the current state of the service.
+
+ If the device's service was instantiated for the first time, the object's
+ state is \l DiscoveryRequired. The state of all service objects which
+ point to the same service on the peripheral device are always equal.
+ This is caused by the shared nature of the internal object data.
+ Therefore any service object instance created after
+ the first one has a state equal to already existing instances.
+
+
+ A service becomes invalid if the \l QLowEnergyController disconnects
+ from the remote device. An invalid service retains its internal state
+ at the time of the disconnect event. This implies that once the service
+ details are discovered they can even be retrieved from an invalid
+ service. This permits scenarios where the device connection is established,
+ the service details are retrieved and the device immediately disconnected
+ to permit the next device to connect to the peripheral device.
+
+ However, under normal circumstances the connection should remain to avoid
+ repeated discovery of services and their details. The discovery may take
+ a while and the client can subscribe to ongoing change notifications.
+
+ \sa stateChanged()
+ */
QLowEnergyService::ServiceState QLowEnergyService::state() const
{
return d_ptr->state;
}
+/*!
+ Returns the type of the service.
+ */
QLowEnergyService::ServiceTypes QLowEnergyService::type() const
{
return d_ptr->type;
@@ -140,10 +373,10 @@ QLowEnergyCharacteristic QLowEnergyService::characteristic(const QBluetoothUuid
/*!
Returns all characteristics associated with this \c QLowEnergyService instance.
- The returned list will be empty if this service instance is invalid,
- \l discoverDetails() was not yet called or there are no known characteristics.
+ The returned list is empty if this service instance's \l discoverDetails()
+ was not yet called or there are no known characteristics.
- \sa characteristic(), state(), discoverDetails
+ \sa characteristic(), state(), discoverDetails()
*/
QList<QLowEnergyCharacteristic> QLowEnergyService::characteristics() const
@@ -160,12 +393,21 @@ QList<QLowEnergyCharacteristic> QLowEnergyService::characteristics() const
}
+/*!
+ Returns the UUID of the service; otherwise a null UUID.
+ */
QBluetoothUuid QLowEnergyService::serviceUuid() const
{
return d_ptr->uuid;
}
+/*!
+ Returns the name of the service; otherwise an empty string.
+
+ The returned name can only be retrieved if \l serviceUuid()
+ is a \l {https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx}{well-known UUID}.
+*/
QString QLowEnergyService::serviceName() const
{
bool ok = false;
@@ -183,12 +425,19 @@ QString QLowEnergyService::serviceName() const
}
+/*!
+ Initiates the discovery of the services, characteristics
+ and descriptors contained by the service. The discovery process is indicated
+ via the \l stateChanged() signal.
+
+ \sa state()
+ */
void QLowEnergyService::discoverDetails()
{
Q_D(QLowEnergyService);
if (!d->controller || d->state == QLowEnergyService::InvalidService) {
- d->setError(QLowEnergyService::ServiceNotValidError);
+ d->setError(QLowEnergyService::OperationError);
return;
}
@@ -200,16 +449,19 @@ void QLowEnergyService::discoverDetails()
d->controller->discoverServiceDetails(d->uuid);
}
+/*!
+ Returns the last occurred error or \l NoError.
+ */
QLowEnergyService::ServiceError QLowEnergyService::error() const
{
return d_ptr->lastError;
}
-
/*!
- Returns \c true if \a characteristic belongs to this service; otherwise \c false.
+ Returns \c true if \a characteristic belongs to this service;
+ otherwise \c false.
- A characteristic belongs to a service if \l {QLowEnergyService::characteristics()}
+ A characteristic belongs to a service if \l characteristics()
contains the \a characteristic.
*/
bool QLowEnergyService::contains(const QLowEnergyCharacteristic &characteristic) const
@@ -226,17 +478,25 @@ bool QLowEnergyService::contains(const QLowEnergyCharacteristic &characteristic)
}
/*!
- Writes \a newValue as value for the \a characteristic. If the operation is successful
- the \l characteristicChanged() signal will be emitted. \a newValue must contain the
- hexadecimal representation of new value.
+ Writes \a newValue as value for the \a characteristic. If the operation is successful,
+ the \l characteristicWritten() signal is emitted; otherwise the \l CharacteristicWriteError
+ is set.
+
+ The \a mode parameter determines whether the remote device should send a write
+ confirmation. The to-be-written \a characteristic must support the relevant
+ write mode. The characteristic's supported write modes are indicated by its
+ \l QLowEnergyCharacteristic::Write and \l QLowEnergyCharacteristic::WriteNoResponse
+ properties.
- A characteristic can only be written if this service is in the \l ServiceDiscovered state
- and \a characteristic is writable.
+ A characteristic can only be written if this service is in the \l ServiceDiscovered state,
+ belongs to the service and is writable.
+
+ \sa QLowEnergyCharacteristic::properties()
*/
void QLowEnergyService::writeCharacteristic(
- const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue)
+ const QLowEnergyCharacteristic &characteristic,
+ const QByteArray &newValue, QLowEnergyService::WriteMode mode)
{
- //TODO check behavior when writing to WriteNoResponse characteristic
//TODO check behavior when writing to WriteSigned characteristic
//TODO add support for write long characteristic value (newValue.size() > MTU - 3)
Q_D(QLowEnergyService);
@@ -245,23 +505,29 @@ void QLowEnergyService::writeCharacteristic(
if (!contains(characteristic))
return;
- // don't write if we don't have to
- if (characteristic.value() == newValue)
- return;
-
- // don't write write-protected or undiscovered characteristic
- if (!(characteristic.properties() & QLowEnergyCharacteristic::Write)
- || state() != ServiceDiscovered) {
+ if (state() != ServiceDiscovered)
d->setError(QLowEnergyService::OperationError);
- return;
- }
if (!d->controller)
return;
- d->controller->writeCharacteristic(characteristic.d_ptr,
+ // don't write if properties don't permit it
+ if (mode == WriteWithResponse
+ && (characteristic.properties() & QLowEnergyCharacteristic::Write))
+ {
+ d->controller->writeCharacteristic(characteristic.d_ptr,
+ characteristic.attributeHandle(),
+ newValue,
+ true);
+ } else if (mode == WriteWithoutResponse
+ && (characteristic.properties() & QLowEnergyCharacteristic::WriteNoResponse)) {
+ d->controller->writeCharacteristic(characteristic.d_ptr,
characteristic.attributeHandle(),
- newValue);
+ newValue,
+ false);
+ } else {
+ d->setError(QLowEnergyService::OperationError);
+ }
}
/*!
@@ -287,12 +553,12 @@ bool QLowEnergyService::contains(const QLowEnergyDescriptor &descriptor) const
}
/*!
- Writes \a newValue as value for \a descriptor. If the operation is successful
- the \l descriptorChanged() signal is emitted. \a newValue must contain the
- hexadecimal representation of new value.
+ Writes \a newValue as value for \a descriptor. If the operation is successful,
+ the \l descriptorWritten() signal is emitted; otherwise the \l DescriptorWriteError
+ is emitted.
- A descriptor can only be written if this service is in the \l ServiceDiscovered state
- and \a characteristic is writable.
+ A descriptor can only be written if this service is in the \l ServiceDiscovered state,
+ belongs to the service and is writable.
*/
void QLowEnergyService::writeDescriptor(const QLowEnergyDescriptor &descriptor,
const QByteArray &newValue)
@@ -317,6 +583,4 @@ void QLowEnergyService::writeDescriptor(const QLowEnergyDescriptor &descriptor,
newValue);
}
-
-
QT_END_NAMESPACE
diff --git a/src/bluetooth/qlowenergyservice.h b/src/bluetooth/qlowenergyservice.h
index d7033224..903b64fe 100644
--- a/src/bluetooth/qlowenergyservice.h
+++ b/src/bluetooth/qlowenergyservice.h
@@ -1,40 +1,33 @@
/****************************************************************************
**
** 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:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -61,19 +54,24 @@ public:
enum ServiceError {
NoError = 0,
- ServiceNotValidError,
OperationError,
- CharacteristicWriteError, // emitted when writeCharacteristic() failed
- DescriptorWriteError // emitted when writeDescriptor() failed
+ CharacteristicWriteError,
+ DescriptorWriteError
};
enum ServiceState {
- InvalidService = 0, // when underlying controller disconnects
+ InvalidService = 0,
DiscoveryRequired, // we know start/end handle but nothing more
+ //TODO Rename DiscoveringServices -> DiscoveringDetails or DiscoveringService
DiscoveringServices,// discoverDetails() called and running
ServiceDiscovered, // all details have been synchronized
};
+ enum WriteMode {
+ WriteWithResponse = 0,
+ WriteWithoutResponse
+ };
+
~QLowEnergyService();
QList<QBluetoothUuid> includedServices() const;
@@ -92,7 +90,8 @@ public:
bool contains(const QLowEnergyCharacteristic &characteristic) const;
void writeCharacteristic(const QLowEnergyCharacteristic &characteristic,
- const QByteArray &newValue);
+ const QByteArray &newValue,
+ WriteMode mode = WriteWithResponse);
bool contains(const QLowEnergyDescriptor &descriptor) const;
void writeDescriptor(const QLowEnergyDescriptor &descriptor,
@@ -102,7 +101,9 @@ Q_SIGNALS:
void stateChanged(QLowEnergyService::ServiceState newState);
void characteristicChanged(const QLowEnergyCharacteristic &info,
const QByteArray &value);
- void descriptorChanged(const QLowEnergyDescriptor &info,
+ void characteristicWritten(const QLowEnergyCharacteristic &info,
+ const QByteArray &value);
+ void descriptorWritten(const QLowEnergyDescriptor &info,
const QByteArray &value);
void error(QLowEnergyService::ServiceError error);
diff --git a/src/bluetooth/qlowenergyserviceinfo.cpp b/src/bluetooth/qlowenergyserviceinfo.cpp
deleted file mode 100644
index 572e71d7..00000000
--- a/src/bluetooth/qlowenergyserviceinfo.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2013 BlackBerry Limited all rights reserved
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: 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.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qlowenergyserviceinfo.h"
-#include "qlowenergyserviceinfo_p.h"
-#include <QtCore/QCoreApplication>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QLowEnergyServiceInfo
- \inmodule QtBluetooth
- \brief The QLowEnergyServiceInfo class stores information about the Bluetooth
- Low Energy service.
- \since 5.4
-
- QLowEnergyServiceInfo provides information about a Bluetooth Low Energy
- service's name, device, UUID, connection status, service type, handle
- and characteristics. A Bluetooth Low Energy device can have one or more
- low energy services. Each low energy service contains one or more
- characteristics. The class is used with the QLowEnergyController
- class. It is necessary to connect to the service first in order
- to get the all service information and characteristics.
-*/
-
-/*!
- \enum QLowEnergyServiceInfo::ServiceType
-
- This enum describes the type of the service. One LE device can have one or more primary services.
-
- \value PrimaryService The primary service. The primary service can have one or
- more included services.
- \value IncludedService The included service by primary services.
-*/
-
-/*!
- Construct a new QLowEnergyServiceInfo.
-*/
-QLowEnergyServiceInfo::QLowEnergyServiceInfo():
- d_ptr(QSharedPointer<QLowEnergyServiceInfoPrivate>(new QLowEnergyServiceInfoPrivate))
-{
-
-}
-
-/*!
- Construct a new QLowEnergyServiceInfo object with the given \a uuid.
-
- Based on uuid, corresponsing service name is given.
-*/
-QLowEnergyServiceInfo::QLowEnergyServiceInfo(const QBluetoothUuid &uuid):
- d_ptr(QSharedPointer<QLowEnergyServiceInfoPrivate>(new QLowEnergyServiceInfoPrivate))
-{
- d_ptr->uuid = QBluetoothUuid(uuid);
-}
-
-/*!
- Construct a new QLowEnergyServiceInfo that is a copy of \a other.
-
- The two copies continue to share the same underlying data which does not detach
- upon write.
-*/
-QLowEnergyServiceInfo::QLowEnergyServiceInfo(const QLowEnergyServiceInfo &other):
- d_ptr(other.d_ptr)
-{
-
-}
-
-/*!
- Destroys the QLowEnergyServiceInfo object.
-*/
-QLowEnergyServiceInfo::~QLowEnergyServiceInfo()
-{
-
-}
-
-/*!
- Returns the gatt service uuid.
-*/
-QBluetoothUuid QLowEnergyServiceInfo::serviceUuid() const
-{
- return d_ptr->uuid;
-}
-
-/*!
- Returns the service name.
-*/
-QString QLowEnergyServiceInfo::serviceName() const
-{
- bool ok = false;
- quint16 clsId = d_ptr->uuid.toUInt16(&ok);
- if (ok) {
- QBluetoothUuid::ServiceClassUuid id
- = static_cast<QBluetoothUuid::ServiceClassUuid>(clsId);
- return QBluetoothUuid::serviceClassToString(id);
- }
- return qApp ?
- qApp->translate("QBluetoothServiceDiscoveryAgent", "Unknown Service") :
- QStringLiteral("Unknown Service");
-}
-
-/*!
- Returns a copy of \a other and assigns it to this QLowEnergyServiceInfo object.
- The two copies continue to share the same service and registration details.
-*/
-QLowEnergyServiceInfo &QLowEnergyServiceInfo::operator=(const QLowEnergyServiceInfo &other)
-{
- d_ptr = other.d_ptr;
- return *this;
-}
-
-/*!
- Returns the address of the Bluetooth device that provides this service.
-*/
-QBluetoothDeviceInfo QLowEnergyServiceInfo::device() const
-{
- return d_ptr->deviceInfo;
-}
-
-/*!
- Sets the Bluetooth device that provides this service to \a device.
-*/
-void QLowEnergyServiceInfo::setDevice(const QBluetoothDeviceInfo &device)
-{
- d_ptr->deviceInfo = device;
-}
-
-/*!
- Returns true if the QLowEnergyServiceInfo object is valid, otherwise returns false.
-*/
-bool QLowEnergyServiceInfo::isValid() const
-{
- if (d_ptr->uuid == QBluetoothUuid())
- return false;
- if (!d_ptr->deviceInfo.isValid())
- return false;
- return true;
-}
-
-QT_END_NAMESPACE
-
-
diff --git a/src/bluetooth/qlowenergyserviceinfo.h b/src/bluetooth/qlowenergyserviceinfo.h
deleted file mode 100644
index 43ddff30..00000000
--- a/src/bluetooth/qlowenergyserviceinfo.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2013 BlackBerry Limited all rights reserved
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: 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.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QLOWENERGYSERVICEINFO_H
-#define QLOWENERGYSERVICEINFO_H
-#include <QtCore/QSharedPointer>
-#include <QtBluetooth/QBluetoothAddress>
-#include <QtBluetooth/QBluetoothDeviceInfo>
-#include <QtBluetooth/QBluetoothUuid>
-
-QT_BEGIN_NAMESPACE
-
-class QLowEnergyServiceInfoPrivate;
-
-class Q_BLUETOOTH_EXPORT QLowEnergyServiceInfo
-{
-public:
- QLowEnergyServiceInfo();
- QLowEnergyServiceInfo(const QBluetoothUuid &uuid);
- QLowEnergyServiceInfo(const QLowEnergyServiceInfo &other);
-
- ~QLowEnergyServiceInfo();
-
- QLowEnergyServiceInfo &operator=(const QLowEnergyServiceInfo &other);
-
- void setDevice(const QBluetoothDeviceInfo &info);
- QBluetoothDeviceInfo device() const;
-
- QBluetoothUuid serviceUuid() const;
-
- QString serviceName() const;
-
- bool isValid() const;
-
-protected:
- QSharedPointer<QLowEnergyServiceInfoPrivate> d_ptr;
-
-};
-
-QT_END_NAMESPACE
-
-#endif // QLOWENERGYSERVICEINFO_H
diff --git a/src/bluetooth/qlowenergyserviceinfo_p.h b/src/bluetooth/qlowenergyserviceinfo_p.h
deleted file mode 100644
index 6d1d3c73..00000000
--- a/src/bluetooth/qlowenergyserviceinfo_p.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2013 BlackBerry Limited all rights reserved
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtBluetooth module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: 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.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QLOWENERGYSERVICEINFO_P_H
-#define QLOWENERGYSERVICEINFO_P_H
-#include "qlowenergyserviceinfo.h"
-
-QT_BEGIN_NAMESPACE
-
-class QLowEnergyServiceInfoPrivate
-{
-public:
- QBluetoothUuid uuid;
- QBluetoothDeviceInfo deviceInfo;
-};
-
-QT_END_NAMESPACE
-
-#endif // QLOWENERGYSERVICEINFO_P_H
diff --git a/src/bluetooth/qlowenergyserviceprivate.cpp b/src/bluetooth/qlowenergyserviceprivate.cpp
index 4768582d..43bb3498 100644
--- a/src/bluetooth/qlowenergyserviceprivate.cpp
+++ b/src/bluetooth/qlowenergyserviceprivate.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qlowenergyserviceprivate_p.h b/src/bluetooth/qlowenergyserviceprivate_p.h
index cc0fafee..4a98d589 100644
--- a/src/bluetooth/qlowenergyserviceprivate_p.h
+++ b/src/bluetooth/qlowenergyserviceprivate_p.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -88,7 +80,9 @@ signals:
void error(QLowEnergyService::ServiceError error);
void characteristicChanged(const QLowEnergyCharacteristic &characteristic,
const QByteArray &newValue);
- void descriptorChanged(const QLowEnergyDescriptor &descriptor,
+ void characteristicWritten(const QLowEnergyCharacteristic &characteristic,
+ const QByteArray &newValue);
+ void descriptorWritten(const QLowEnergyDescriptor &descriptor,
const QByteArray &newValue);
public:
diff --git a/src/bluetooth/qnx/ppshelpers.cpp b/src/bluetooth/qnx/ppshelpers.cpp
index 9b1d3e4b..eaf9c374 100644
--- a/src/bluetooth/qnx/ppshelpers.cpp
+++ b/src/bluetooth/qnx/ppshelpers.cpp
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qnx/ppshelpers_p.h b/src/bluetooth/qnx/ppshelpers_p.h
index b552f91a..e771fd8e 100644
--- a/src/bluetooth/qnx/ppshelpers_p.h
+++ b/src/bluetooth/qnx/ppshelpers_p.h
@@ -5,36 +5,28 @@
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/bluetooth/qprivatelinearbuffer_p.h b/src/bluetooth/qprivatelinearbuffer_p.h
index 2eb38cd6..b13e68d3 100644
--- a/src/bluetooth/qprivatelinearbuffer_p.h
+++ b/src/bluetooth/qprivatelinearbuffer_p.h
@@ -1,40 +1,32 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $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
+** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** 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
+** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +34,17 @@
#ifndef QPRIVATELINEARBUFFER_P_H
#define QPRIVATELINEARBUFFER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
// This is QIODevice's read buffer, optimised for read(), isEmpty() and getChar()
class QPrivateLinearBuffer
{