diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/changelog qtconnectivity-opensource-src-5.2.1/debian/changelog --- qtconnectivity-opensource-src-5.0~git20130802/debian/changelog 2013-08-16 04:41:24.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/changelog 2014-04-25 04:54:22.000000000 +0000 @@ -1,5 +1,16 @@ -qtconnectivity-opensource-src (5.0~git20130802-0ubuntu1~precise1~test3) precise; urgency=low +qtconnectivity-opensource-src (5.2.1-1~precise1~test1) precise; urgency=medium - * Initial release + [ Timo Jyrinki ] + * New upstream release + * Move mkspecs to the new location + * Make private headers cleaning non version specific + * Add examples package + * Add dependencies to build against the 5.2.1 versions - -- Timo Jyrinki Tue, 29 Jan 2013 15:36:58 +0200 + -- Lisandro Damián Nicanor Pérez Meyer Sun, 23 Feb 2014 00:01:49 -0300 + +qtconnectivity-opensource-src (5.2.0-1~precise1~test1) precise; urgency=low + + * Initial release (Closes: #697509). + + -- Lisandro Damián Nicanor Pérez Meyer Thu, 30 Jan 2014 00:07:32 -0300 diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/control qtconnectivity-opensource-src-5.2.1/debian/control --- qtconnectivity-opensource-src-5.0~git20130802/debian/control 2013-08-16 04:41:24.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/control 2014-02-23 03:00:09.000000000 +0000 @@ -1,14 +1,21 @@ Source: qtconnectivity-opensource-src Section: libs -Priority: extra -Maintainer: Timo Jyrinki +Priority: optional +Maintainer: Debian Qt/KDE Maintainers +Uploaders: Sune Vuorela , + Pino Toscano , + Lisandro Damián Nicanor Pérez Meyer , + Felix Geyer , + Timo Jyrinki , + Dmitry Shachnev Build-Depends: debhelper (>= 9.0.0), - qtbase5-dev, - qtdeclarative5-private-dev, - qt5-default, pkg-kde-tools, -Standards-Version: 3.9.4 + qtbase5-dev (>= 5.2.1+dfsg~), + qtdeclarative5-private-dev (>= 5.2.1~) +Standards-Version: 3.9.5 Homepage: http://qt-project.org/ +Vcs-Git: git://anonscm.debian.org/pkg-kde/qt/qtconnectivity.git +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-kde/qt/qtconnectivity.git;a=summary Package: libqt5bluetooth5 Architecture: any @@ -20,10 +27,6 @@ is its rich set of widgets that provide standard GUI functionality. . This package contains the Bluetooth part of the Qt Connectivity module. - . - WARNING: This module is not an official part of Qt 5, but instead a git - snapshot of an ongoing development. The package is very likely to - change in a binary incompatible way, and no guarantees are given. Package: qtdeclarative5-qtbluetooth-plugin Architecture: any @@ -35,10 +38,6 @@ is its rich set of widgets that provide standard GUI functionality. . This package contains the Bluetooth QML plugin from the Qt Connectivity module. - . - WARNING: This module is not an official part of Qt 5, but instead a git - snapshot of an ongoing development. The package is very likely to - change in a binary incompatible way, and no guarantees are given. Package: libqt5nfc5 Architecture: any @@ -50,10 +49,6 @@ is its rich set of widgets that provide standard GUI functionality. . This package contains the NFC part of the Qt Connectivity module. - . - WARNING: This module is not an official part of Qt 5, but instead a git - snapshot of an ongoing development. The package is very likely to - change in a binary incompatible way, and no guarantees are given. Package: qtdeclarative5-qtnfc-plugin Architecture: any @@ -65,61 +60,39 @@ is its rich set of widgets that provide standard GUI functionality. . This package contains the NFC QML plugin from the Qt Connectivity module. - . - WARNING: This module is not an official part of Qt 5, but instead a git - snapshot of an ongoing development. The package is very likely to - change in a binary incompatible way, and no guarantees are given. Package: qtconnectivity5-dev Section: libdevel Architecture: any -Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends} -Depends: libqt5bluetooth5 (= ${binary:Version}), ${misc:Depends} +Depends: libqt5bluetooth5 (= ${binary:Version}), qtbase5-dev, ${misc:Depends} Description: Qt Connectivity development files Qt is a cross-platform C++ application framework. Qt's primary feature is its rich set of widgets that provide standard GUI functionality. . This package contains the header development files used for building Qt 5 applications using Qt Connectivity libraries. - . - WARNING: This module is not an official part of Qt 5, but instead a git - snapshot of an ongoing development. The package is very likely to - change in a binary incompatible way, and no guarantees are given. -Package: qtconnectivity5-private-dev +Package: qtconnectivity5-examples Architecture: any -Section: libdevel -Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends} -Depends: qtconnectivity5-dev (= ${binary:Version}), - ${misc:Depends}, - ${shlibs:Depends} -Description: Qt Connectivity private development files +Multi-Arch: same +Section: x11 +Pre-Depends: dpkg (>= 1.15.6~) +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Qt 5 Connectivity examples Qt is a cross-platform C++ application framework. Qt's primary feature is its rich set of widgets that provide standard GUI functionality. . - This package contains the private header development files for building some - Qt 5 applications using connectivity private headers. - . - Use at your own risk. - . - WARNING: This module is not an official part of Qt 5, but instead a git - snapshot of an ongoing development. The package is very likely to - change in a binary incompatible way, and no guarantees are given. + This package contains Qt 5 Connectivity examples. Package: qtconnectivity5-dbg Priority: extra Architecture: any +Multi-Arch: same Section: debug -Depends: libqt5bluetooth5 (= ${binary:Version}), - ${misc:Depends} +Depends: libqt5bluetooth5 (= ${binary:Version}), ${misc:Depends} Description: Qt Connectivity library debugging symbols Qt is a cross-platform C++ application framework. Qt's primary feature is its rich set of widgets that provide standard GUI functionality. . This package contains the debugging symbols for the Qt 5 Connectivity libraries. - . - WARNING: This module is not an official part of Qt 5, but instead a git - snapshot of an ongoing development. The package is very likely to - change in a binary incompatible way, and no guarantees are given. - diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/copyright qtconnectivity-opensource-src-5.2.1/debian/copyright --- qtconnectivity-opensource-src-5.0~git20130802/debian/copyright 2013-08-16 04:41:24.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/copyright 2014-01-30 03:06:09.000000000 +0000 @@ -1,20 +1,96 @@ -Format: http://dep.debian.net/deps/dep5 +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: qtconnectivity-opensource-src Source: http://qt.gitorious.org/qt/qtconnectivity Files: * -Copyright: 2012 Digia Plc and/or its subsidiary(-ies) +Copyright: 2013 Digia Plc and/or its subsidiary(-ies) License: LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3 +Files: examples/* + src/nfc/doc/snippets/* + src/bluetooth/doc/snippets/* +Copyright: 2013 Digia Plc and/or its subsidiary(-ies) +License: BSD-3-clause + +Files: *.qdoc +Copyright: 2012 Digia Plc and/or its subsidiary(-ies). +License: GFDL-1.3 + Files: debian/* Copyright: 2007-2012 Fathi Boudra 2007-2012 Sune Vuorela 2008-2012 Modestas Vainius 2007-2009 Ana Beatriz Guerrero Lopez 2005-2007 Brian Nelson - 2012 Timo Jyrinki + 2012-2013 Timo Jyrinki License: LGPL-2.1 +Files: examples/bluetooth/bttennis/tennisserver.h + examples/bluetooth/bttennis/tennisserver.cpp + examples/bluetooth/bttennis/tennisview.h + examples/bluetooth/bttennis/tennisclient.h + examples/bluetooth/bttennis/main.cpp + examples/bluetooth/bttennis/tennis.h + examples/bluetooth/bttennis/tennisclient.cpp + examples/bluetooth/bttennis/tennis.cpp + examples/bluetooth/bttennis/controller.h + examples/bluetooth/bttennis/board.h + examples/bluetooth/bttennis/controller.cpp + examples/bluetooth/bttennis/tennisview.cpp + examples/bluetooth/bttennis/handover.cpp + examples/bluetooth/bttennis/handover.h + examples/bluetooth/bttennis/board.cpp +Copyright: 2013 Digia Plc and/or its subsidiary(-ies) +License: LGPL-2.1 with Digia Qt LGPL Exception 1.1 + +Files: examples/bluetooth/scanner/doc/src/scanner.qdoc + src/nfc/doc/src/nfc-cpp.qdoc + src/nfc/doc/src/nfc-qml.qdoc + src/nfc/doc/src/examples.qdoc + src/nfc/doc/src/nfc-index.qdoc + src/nfc/doc/src/nfc-overview.qdoc +Copyright: 2013 Aaron McCarthy +License: GFDL-1.3 + +Files: src/nfc/doc/snippets/doc_src_qtnfc.qml + src/nfc/doc/snippets/doc_src_qtnfc.cpp + src/nfc/doc/snippets/doc_src_qtnfc.pro +Copyright: 2013 Aaron McCarthy +License: BSD-3-clause + +Files: src/nfc/qndefnfcsmartposterrecord.cpp + src/nfc/qllcpserver_qnx_p.h + src/nfc/qnearfieldtarget_qnx_p.h + src/nfc/qllcpsocket_qnx_p.cpp + src/nfc/qndefnfcsmartposterrecord.h + src/nfc/qnx/qnxnfcmanager_p.h + src/nfc/qnx/qnxnfceventfilter_p.h + src/nfc/qnx/qnxnfcmanager.cpp + src/nfc/qnx/qnxnfceventfilter.cpp + src/nfc/qnearfieldmanager_qnx.cpp + src/nfc/qllcpserver_qnx_p.cpp + src/nfc/qndefnfcsmartposterrecord_p.h + src/nfc/qllcpsocket_qnx_p.h + src/nfc/qnearfieldmanager_qnx_p.h + src/bluetooth/qbluetoothtransferreply_qnx_p.h + src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp + src/bluetooth/qbluetoothtransfermanager_qnx.cpp + src/bluetooth/qnx/ppshelpers.cpp + src/bluetooth/qnx/ppshelpers_p.h + src/bluetooth/qbluetoothlocaldevice_qnx.cpp + src/bluetooth/qbluetoothtransferreply_qnx.cpp + src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp + src/bluetooth/qbluetoothserviceinfo_qnx.cpp + src/bluetooth/qbluetoothsocket_qnx.cpp + src/bluetooth/qrfcommserver_qnx.cpp + tests/auto/qndefnfcsmartposterrecord/tst_qndefnfcsmartposterrecord.cpp +Copyright: 2011-2013 Research In Motion (aka Blackberry) +License: LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3 + +Files: tests/auto/cmake/test_modules/main.cpp +Copyright: 2012 Klarälvdalens Datakonsult AB, a KDAB Group company +License: LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3 + License: LGPL-2.1 with Digia Qt LGPL Exception 1.1 GNU Lesser General Public License version 2.1: This file may be used under the terms of the GNU Lesser General Public @@ -77,10 +153,6 @@ On Debian systems, the complete text of the LGPL-2.1 license can be found in `/usr/share/common-licenses/LGPL-2.1`, -Files: examples/* -Copyright: 2012-2013 Digia Plc and/or its subsidiary(-ies) - 2008-2012 Nokia Corporation and/or its subsidiary(-ies) - 1994-2008 Trolltech ASA. License: BSD-3-clause You may use this file under the terms of the BSD license as follows: . @@ -109,10 +181,6 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -Files: *.qdoc -Copyright: 2012 Digia Plc and/or its subsidiary(-ies). -License: GFDL-1.3 - License: GFDL-1.3 GNU Free Documentation License Usage Alternatively, this file may be used under the terms of the GNU Free @@ -124,4 +192,3 @@ . On Debian systems, the complete text of the GFDL-1.3 license can be found in `/usr/share/common-licenses/GFDL-1.3`, - diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/libqt5bluetooth5.symbols qtconnectivity-opensource-src-5.2.1/debian/libqt5bluetooth5.symbols --- qtconnectivity-opensource-src-5.0~git20130802/debian/libqt5bluetooth5.symbols 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/libqt5bluetooth5.symbols 2014-01-30 02:59:14.000000000 +0000 @@ -0,0 +1,311 @@ +# SymbolsHelper-Confirmed: 5.2.0 amd64 +libQt5Bluetooth.so.5 libqt5bluetooth5 #MINVER# + _ZN14QBluetoothUuidC1E8quint128@Base 5.2.0 + _ZN14QBluetoothUuidC1ENS_12ProtocolUuidE@Base 5.2.0 + _ZN14QBluetoothUuidC1ENS_16ServiceClassUuidE@Base 5.2.0 + _ZN14QBluetoothUuidC1ERK5QUuid@Base 5.2.0 + _ZN14QBluetoothUuidC1ERK7QString@Base 5.2.0 + _ZN14QBluetoothUuidC1ERKS_@Base 5.2.0 + _ZN14QBluetoothUuidC1Ej@Base 5.2.0 + _ZN14QBluetoothUuidC1Et@Base 5.2.0 + _ZN14QBluetoothUuidC1Ev@Base 5.2.0 + _ZN14QBluetoothUuidC2E8quint128@Base 5.2.0 + _ZN14QBluetoothUuidC2ENS_12ProtocolUuidE@Base 5.2.0 + _ZN14QBluetoothUuidC2ENS_16ServiceClassUuidE@Base 5.2.0 + _ZN14QBluetoothUuidC2ERK5QUuid@Base 5.2.0 + _ZN14QBluetoothUuidC2ERK7QString@Base 5.2.0 + _ZN14QBluetoothUuidC2ERKS_@Base 5.2.0 + _ZN14QBluetoothUuidC2Ej@Base 5.2.0 + _ZN14QBluetoothUuidC2Et@Base 5.2.0 + _ZN14QBluetoothUuidC2Ev@Base 5.2.0 + _ZN14QBluetoothUuidD1Ev@Base 5.2.0 + _ZN14QBluetoothUuidD2Ev@Base 5.2.0 + _ZN16QBluetoothServer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN16QBluetoothServer11qt_metacastEPKc@Base 5.2.0 + _ZN16QBluetoothServer13newConnectionEv@Base 5.2.0 + _ZN16QBluetoothServer16setSecurityFlagsE6QFlagsIN10QBluetooth8SecurityEE@Base 5.2.0 + _ZN16QBluetoothServer16staticMetaObjectE@Base 5.2.0 + _ZN16QBluetoothServer21nextPendingConnectionEv@Base 5.2.0 + _ZN16QBluetoothServer24setMaxPendingConnectionsEi@Base 5.2.0 + _ZN16QBluetoothServer5closeEv@Base 5.2.0 + _ZN16QBluetoothServer5errorENS_5ErrorE@Base 5.2.0 + _ZN16QBluetoothServer6listenERK14QBluetoothUuidRK7QString@Base 5.2.0 + _ZN16QBluetoothServer6listenERK17QBluetoothAddresst@Base 5.2.0 + _ZN16QBluetoothServerC1EN21QBluetoothServiceInfo8ProtocolEP7QObject@Base 5.2.0 + _ZN16QBluetoothServerC2EN21QBluetoothServiceInfo8ProtocolEP7QObject@Base 5.2.0 + _ZN16QBluetoothServerD0Ev@Base 5.2.0 + _ZN16QBluetoothServerD1Ev@Base 5.2.0 + _ZN16QBluetoothServerD2Ev@Base 5.2.0 + _ZN16QBluetoothSocket11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN16QBluetoothSocket11qt_metacastEPKc@Base 5.2.0 + _ZN16QBluetoothSocket12disconnectedEv@Base 5.2.0 + _ZN16QBluetoothSocket12stateChangedENS_11SocketStateE@Base 5.2.0 + _ZN16QBluetoothSocket14setSocketErrorENS_11SocketErrorE@Base 5.2.0 + _ZN16QBluetoothSocket14setSocketStateENS_11SocketStateE@Base 5.2.0 + _ZN16QBluetoothSocket16connectToServiceERK17QBluetoothAddressRK14QBluetoothUuid6QFlagsIN9QIODevice12OpenModeFlagEE@Base 5.2.0 + _ZN16QBluetoothSocket16connectToServiceERK17QBluetoothAddresst6QFlagsIN9QIODevice12OpenModeFlagEE@Base 5.2.0 + _ZN16QBluetoothSocket16connectToServiceERK21QBluetoothServiceInfo6QFlagsIN9QIODevice12OpenModeFlagEE@Base 5.2.0 + _ZN16QBluetoothSocket16staticMetaObjectE@Base 5.2.0 + _ZN16QBluetoothSocket17discoveryFinishedEv@Base 5.2.0 + _ZN16QBluetoothSocket17doDeviceDiscoveryERK21QBluetoothServiceInfo6QFlagsIN9QIODevice12OpenModeFlagEE@Base 5.2.0 + _ZN16QBluetoothSocket17serviceDiscoveredERK21QBluetoothServiceInfo@Base 5.2.0 + _ZN16QBluetoothSocket19setSocketDescriptorEiN21QBluetoothServiceInfo8ProtocolENS_11SocketStateE6QFlagsIN9QIODevice12OpenModeFlagEE@Base 5.2.0 + _ZN16QBluetoothSocket21disconnectFromServiceEv@Base 5.2.0 + _ZN16QBluetoothSocket5abortEv@Base 5.2.0 + _ZN16QBluetoothSocket5closeEv@Base 5.2.0 + _ZN16QBluetoothSocket5errorENS_11SocketErrorE@Base 5.2.0 + _ZN16QBluetoothSocket8readDataEPcx@Base 5.2.0 + _ZN16QBluetoothSocket9connectedEv@Base 5.2.0 + _ZN16QBluetoothSocket9writeDataEPKcx@Base 5.2.0 + _ZN16QBluetoothSocketC1EN21QBluetoothServiceInfo8ProtocolEP7QObject@Base 5.2.0 + _ZN16QBluetoothSocketC1EP7QObject@Base 5.2.0 + _ZN16QBluetoothSocketC2EN21QBluetoothServiceInfo8ProtocolEP7QObject@Base 5.2.0 + _ZN16QBluetoothSocketC2EP7QObject@Base 5.2.0 + _ZN16QBluetoothSocketD0Ev@Base 5.2.0 + _ZN16QBluetoothSocketD1Ev@Base 5.2.0 + _ZN16QBluetoothSocketD2Ev@Base 5.2.0 + _ZN17QBluetoothAddress5clearEv@Base 5.2.0 + _ZN17QBluetoothAddressC1ERK7QString@Base 5.2.0 + _ZN17QBluetoothAddressC1ERKS_@Base 5.2.0 + _ZN17QBluetoothAddressC1Ev@Base 5.2.0 + _ZN17QBluetoothAddressC1Ey@Base 5.2.0 + _ZN17QBluetoothAddressC2ERK7QString@Base 5.2.0 + _ZN17QBluetoothAddressC2ERKS_@Base 5.2.0 + _ZN17QBluetoothAddressC2Ev@Base 5.2.0 + _ZN17QBluetoothAddressC2Ey@Base 5.2.0 + _ZN17QBluetoothAddressD1Ev@Base 5.2.0 + _ZN17QBluetoothAddressD2Ev@Base 5.2.0 + _ZN17QBluetoothAddressaSERKS_@Base 5.2.0 + _ZN18QBluetoothHostInfo10setAddressERK17QBluetoothAddress@Base 5.2.0 + _ZN18QBluetoothHostInfo7setNameERK7QString@Base 5.2.0 + _ZN18QBluetoothHostInfoC1ERKS_@Base 5.2.0 + _ZN18QBluetoothHostInfoC1Ev@Base 5.2.0 + _ZN18QBluetoothHostInfoC2ERKS_@Base 5.2.0 + _ZN18QBluetoothHostInfoC2Ev@Base 5.2.0 + _ZN18QBluetoothHostInfoD1Ev@Base 5.2.0 + _ZN18QBluetoothHostInfoD2Ev@Base 5.2.0 + _ZN20QBluetoothDeviceInfo15setServiceUuidsERK5QListI14QBluetoothUuidENS_16DataCompletenessE@Base 5.2.0 + _ZN20QBluetoothDeviceInfo7setRssiEs@Base 5.2.0 + _ZN20QBluetoothDeviceInfo9setCachedEb@Base 5.2.0 + _ZN20QBluetoothDeviceInfoC1ERK17QBluetoothAddressRK7QStringj@Base 5.2.0 + _ZN20QBluetoothDeviceInfoC1ERKS_@Base 5.2.0 + _ZN20QBluetoothDeviceInfoC1Ev@Base 5.2.0 + _ZN20QBluetoothDeviceInfoC2ERK17QBluetoothAddressRK7QStringj@Base 5.2.0 + _ZN20QBluetoothDeviceInfoC2ERKS_@Base 5.2.0 + _ZN20QBluetoothDeviceInfoC2Ev@Base 5.2.0 + _ZN20QBluetoothDeviceInfoD1Ev@Base 5.2.0 + _ZN20QBluetoothDeviceInfoD2Ev@Base 5.2.0 + _ZN20QBluetoothDeviceInfoaSERKS_@Base 5.2.0 + _ZN21QBluetoothLocalDevice10allDevicesEv@Base 5.2.0 + _ZN21QBluetoothLocalDevice11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN21QBluetoothLocalDevice11qt_metacastEPKc@Base 5.2.0 + _ZN21QBluetoothLocalDevice11setHostModeENS_8HostModeE@Base 5.2.0 + _ZN21QBluetoothLocalDevice14requestPairingERK17QBluetoothAddressNS_7PairingE@Base 5.2.0 + _ZN21QBluetoothLocalDevice15pairingFinishedERK17QBluetoothAddressNS_7PairingE@Base 5.2.0 + _ZN21QBluetoothLocalDevice16staticMetaObjectE@Base 5.2.0 + _ZN21QBluetoothLocalDevice19pairingConfirmationEb@Base 5.2.0 + _ZN21QBluetoothLocalDevice20hostModeStateChangedENS_8HostModeE@Base 5.2.0 + _ZN21QBluetoothLocalDevice21pairingDisplayPinCodeERK17QBluetoothAddress7QString@Base 5.2.0 + _ZN21QBluetoothLocalDevice26pairingDisplayConfirmationERK17QBluetoothAddress7QString@Base 5.2.0 + _ZN21QBluetoothLocalDevice5errorENS_5ErrorE@Base 5.2.0 + _ZN21QBluetoothLocalDevice7powerOnEv@Base 5.2.0 + _ZN21QBluetoothLocalDeviceC1EP7QObject@Base 5.2.0 + _ZN21QBluetoothLocalDeviceC1ERK17QBluetoothAddressP7QObject@Base 5.2.0 + _ZN21QBluetoothLocalDeviceC2EP7QObject@Base 5.2.0 + _ZN21QBluetoothLocalDeviceC2ERK17QBluetoothAddressP7QObject@Base 5.2.0 + _ZN21QBluetoothLocalDeviceD0Ev@Base 5.2.0 + _ZN21QBluetoothLocalDeviceD1Ev@Base 5.2.0 + _ZN21QBluetoothLocalDeviceD2Ev@Base 5.2.0 + _ZN21QBluetoothServiceInfo12setAttributeEtRK8QVariant@Base 5.2.0 + _ZN21QBluetoothServiceInfo15registerServiceERK17QBluetoothAddress@Base 5.2.0 + _ZN21QBluetoothServiceInfo15removeAttributeEt@Base 5.2.0 + _ZN21QBluetoothServiceInfo17unregisterServiceEv@Base 5.2.0 + _ZN21QBluetoothServiceInfo9setDeviceERK20QBluetoothDeviceInfo@Base 5.2.0 + _ZN21QBluetoothServiceInfoC1ERKS_@Base 5.2.0 + _ZN21QBluetoothServiceInfoC1Ev@Base 5.2.0 + _ZN21QBluetoothServiceInfoC2ERKS_@Base 5.2.0 + _ZN21QBluetoothServiceInfoC2Ev@Base 5.2.0 + _ZN21QBluetoothServiceInfoD1Ev@Base 5.2.0 + _ZN21QBluetoothServiceInfoD2Ev@Base 5.2.0 + _ZN21QBluetoothServiceInfoaSERKS_@Base 5.2.0 + _ZN23QBluetoothTransferReply10setManagerEP25QBluetoothTransferManager@Base 5.2.0 + _ZN23QBluetoothTransferReply10setRequestERK25QBluetoothTransferRequest@Base 5.2.0 + _ZN23QBluetoothTransferReply11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN23QBluetoothTransferReply11qt_metacastEPKc@Base 5.2.0 + _ZN23QBluetoothTransferReply16staticMetaObjectE@Base 5.2.0 + _ZN23QBluetoothTransferReply16transferProgressExx@Base 5.2.0 + _ZN23QBluetoothTransferReply5abortEv@Base 5.2.0 + _ZN23QBluetoothTransferReply8finishedEPS_@Base 5.2.0 + _ZN23QBluetoothTransferReplyC1EP7QObject@Base 5.2.0 + _ZN23QBluetoothTransferReplyC2EP7QObject@Base 5.2.0 + _ZN23QBluetoothTransferReplyD0Ev@Base 5.2.0 + _ZN23QBluetoothTransferReplyD1Ev@Base 5.2.0 + _ZN23QBluetoothTransferReplyD2Ev@Base 5.2.0 + _ZN25QBluetoothTransferManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN25QBluetoothTransferManager11qt_metacastEPKc@Base 5.2.0 + _ZN25QBluetoothTransferManager16staticMetaObjectE@Base 5.2.0 + _ZN25QBluetoothTransferManager3putERK25QBluetoothTransferRequestP9QIODevice@Base 5.2.0 + _ZN25QBluetoothTransferManager8finishedEP23QBluetoothTransferReply@Base 5.2.0 + _ZN25QBluetoothTransferManagerC1EP7QObject@Base 5.2.0 + _ZN25QBluetoothTransferManagerC2EP7QObject@Base 5.2.0 + _ZN25QBluetoothTransferManagerD0Ev@Base 5.2.0 + _ZN25QBluetoothTransferManagerD1Ev@Base 5.2.0 + _ZN25QBluetoothTransferManagerD2Ev@Base 5.2.0 + _ZN25QBluetoothTransferRequest12setAttributeENS_9AttributeERK8QVariant@Base 5.2.0 + _ZN25QBluetoothTransferRequestC1ERK17QBluetoothAddress@Base 5.2.0 + _ZN25QBluetoothTransferRequestC1ERKS_@Base 5.2.0 + _ZN25QBluetoothTransferRequestC2ERK17QBluetoothAddress@Base 5.2.0 + _ZN25QBluetoothTransferRequestC2ERKS_@Base 5.2.0 + _ZN25QBluetoothTransferRequestD1Ev@Base 5.2.0 + _ZN25QBluetoothTransferRequestD2Ev@Base 5.2.0 + _ZN25QBluetoothTransferRequestaSERKS_@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgent11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgent11qt_metacastEPKc@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgent14setInquiryTypeENS_11InquiryTypeE@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgent16deviceDiscoveredERK20QBluetoothDeviceInfo@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgent16staticMetaObjectE@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgent4stopEv@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgent5errorENS_5ErrorE@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgent5startEv@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgent8canceledEv@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgent8finishedEv@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgentC1EP7QObject@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgentC1ERK17QBluetoothAddressP7QObject@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgentC2EP7QObject@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgentC2ERK17QBluetoothAddressP7QObject@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgentD0Ev@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgentD1Ev@Base 5.2.0 + _ZN30QBluetoothDeviceDiscoveryAgentD2Ev@Base 5.2.0 + _ZN30QBluetoothTransferReplyPrivateC1Ev@Base 5.2.0 + _ZN30QBluetoothTransferReplyPrivateC2Ev@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent11qt_metacastEPKc@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent13setUuidFilterERK14QBluetoothUuid@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent13setUuidFilterERK5QListI14QBluetoothUuidE@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent16setRemoteAddressERK17QBluetoothAddress@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent16staticMetaObjectE@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent17serviceDiscoveredERK21QBluetoothServiceInfo@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent4stopEv@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent5clearEv@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent5errorENS_5ErrorE@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent5startENS_13DiscoveryModeE@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent8canceledEv@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgent8finishedEv@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgentC1EP7QObject@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgentC1ERK17QBluetoothAddressP7QObject@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgentC2EP7QObject@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgentC2ERK17QBluetoothAddressP7QObject@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgentD0Ev@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgentD1Ev@Base 5.2.0 + _ZN31QBluetoothServiceDiscoveryAgentD2Ev@Base 5.2.0 + _ZNK14QBluetoothUuid11minimumSizeEv@Base 5.2.0 + _ZNK14QBluetoothUuid8toUInt16EPb@Base 5.2.0 + _ZNK14QBluetoothUuid8toUInt32EPb@Base 5.2.0 + _ZNK14QBluetoothUuid9toUInt128Ev@Base 5.2.0 + _ZNK14QBluetoothUuideqERKS_@Base 5.2.0 + _ZNK16QBluetoothServer10metaObjectEv@Base 5.2.0 + _ZNK16QBluetoothServer10serverPortEv@Base 5.2.0 + _ZNK16QBluetoothServer10serverTypeEv@Base 5.2.0 + _ZNK16QBluetoothServer11isListeningEv@Base 5.2.0 + _ZNK16QBluetoothServer13securityFlagsEv@Base 5.2.0 + _ZNK16QBluetoothServer13serverAddressEv@Base 5.2.0 + _ZNK16QBluetoothServer21hasPendingConnectionsEv@Base 5.2.0 + _ZNK16QBluetoothServer21maxPendingConnectionsEv@Base 5.2.0 + _ZNK16QBluetoothServer5errorEv@Base 5.2.0 + _ZNK16QBluetoothSocket10metaObjectEv@Base 5.2.0 + _ZNK16QBluetoothSocket10socketTypeEv@Base 5.2.0 + _ZNK16QBluetoothSocket11canReadLineEv@Base 5.2.0 + _ZNK16QBluetoothSocket11errorStringEv@Base 5.2.0 + _ZNK16QBluetoothSocket11peerAddressEv@Base 5.2.0 + _ZNK16QBluetoothSocket12bytesToWriteEv@Base 5.2.0 + _ZNK16QBluetoothSocket12isSequentialEv@Base 5.2.0 + _ZNK16QBluetoothSocket12localAddressEv@Base 5.2.0 + _ZNK16QBluetoothSocket14bytesAvailableEv@Base 5.2.0 + _ZNK16QBluetoothSocket16socketDescriptorEv@Base 5.2.0 + _ZNK16QBluetoothSocket5errorEv@Base 5.2.0 + _ZNK16QBluetoothSocket5stateEv@Base 5.2.0 + _ZNK16QBluetoothSocket8peerNameEv@Base 5.2.0 + _ZNK16QBluetoothSocket8peerPortEv@Base 5.2.0 + _ZNK16QBluetoothSocket9localNameEv@Base 5.2.0 + _ZNK16QBluetoothSocket9localPortEv@Base 5.2.0 + _ZNK17QBluetoothAddress6isNullEv@Base 5.2.0 + _ZNK17QBluetoothAddress8toStringEv@Base 5.2.0 + _ZNK17QBluetoothAddress8toUInt64Ev@Base 5.2.0 + _ZNK17QBluetoothAddresseqERKS_@Base 5.2.0 + _ZNK17QBluetoothAddressltERKS_@Base 5.2.0 + _ZNK18QBluetoothHostInfo4nameEv@Base 5.2.0 + _ZNK18QBluetoothHostInfo7addressEv@Base 5.2.0 + _ZNK20QBluetoothDeviceInfo12serviceUuidsEPNS_16DataCompletenessE@Base 5.2.0 + _ZNK20QBluetoothDeviceInfo14serviceClassesEv@Base 5.2.0 + _ZNK20QBluetoothDeviceInfo16majorDeviceClassEv@Base 5.2.0 + _ZNK20QBluetoothDeviceInfo16minorDeviceClassEv@Base 5.2.0 + _ZNK20QBluetoothDeviceInfo24serviceUuidsCompletenessEv@Base 5.2.0 + _ZNK20QBluetoothDeviceInfo4nameEv@Base 5.2.0 + _ZNK20QBluetoothDeviceInfo4rssiEv@Base 5.2.0 + _ZNK20QBluetoothDeviceInfo7addressEv@Base 5.2.0 + _ZNK20QBluetoothDeviceInfo7isValidEv@Base 5.2.0 + _ZNK20QBluetoothDeviceInfo8isCachedEv@Base 5.2.0 + _ZNK20QBluetoothDeviceInfoeqERKS_@Base 5.2.0 + _ZNK20QBluetoothDeviceInfoneERKS_@Base 5.2.0 + _ZNK21QBluetoothLocalDevice10metaObjectEv@Base 5.2.0 + _ZNK21QBluetoothLocalDevice13pairingStatusERK17QBluetoothAddress@Base 5.2.0 + _ZNK21QBluetoothLocalDevice4nameEv@Base 5.2.0 + _ZNK21QBluetoothLocalDevice7addressEv@Base 5.2.0 + _ZNK21QBluetoothLocalDevice7isValidEv@Base 5.2.0 + _ZNK21QBluetoothLocalDevice8hostModeEv@Base 5.2.0 + _ZNK21QBluetoothServiceInfo10attributesEv@Base 5.2.0 + _ZNK21QBluetoothServiceInfo10isCompleteEv@Base 5.2.0 + _ZNK21QBluetoothServiceInfo12isRegisteredEv@Base 5.2.0 + _ZNK21QBluetoothServiceInfo13serverChannelEv@Base 5.2.0 + _ZNK21QBluetoothServiceInfo14socketProtocolEv@Base 5.2.0 + _ZNK21QBluetoothServiceInfo18protocolDescriptorEN14QBluetoothUuid12ProtocolUuidE@Base 5.2.0 + _ZNK21QBluetoothServiceInfo26protocolServiceMultiplexerEv@Base 5.2.0 + _ZNK21QBluetoothServiceInfo6deviceEv@Base 5.2.0 + _ZNK21QBluetoothServiceInfo7isValidEv@Base 5.2.0 + _ZNK21QBluetoothServiceInfo8containsEt@Base 5.2.0 + _ZNK21QBluetoothServiceInfo9attributeEt@Base 5.2.0 + _ZNK23QBluetoothTransferReply10metaObjectEv@Base 5.2.0 + _ZNK23QBluetoothTransferReply7managerEv@Base 5.2.0 + _ZNK23QBluetoothTransferReply7requestEv@Base 5.2.0 + _ZNK25QBluetoothTransferManager10metaObjectEv@Base 5.2.0 + _ZNK25QBluetoothTransferRequest7addressEv@Base 5.2.0 + _ZNK25QBluetoothTransferRequest9attributeENS_9AttributeERK8QVariant@Base 5.2.0 + _ZNK25QBluetoothTransferRequesteqERKS_@Base 5.2.0 + _ZNK25QBluetoothTransferRequestneERKS_@Base 5.2.0 + _ZNK30QBluetoothDeviceDiscoveryAgent10metaObjectEv@Base 5.2.0 + _ZNK30QBluetoothDeviceDiscoveryAgent11errorStringEv@Base 5.2.0 + _ZNK30QBluetoothDeviceDiscoveryAgent11inquiryTypeEv@Base 5.2.0 + _ZNK30QBluetoothDeviceDiscoveryAgent17discoveredDevicesEv@Base 5.2.0 + _ZNK30QBluetoothDeviceDiscoveryAgent5errorEv@Base 5.2.0 + _ZNK30QBluetoothDeviceDiscoveryAgent8isActiveEv@Base 5.2.0 + _ZNK31QBluetoothServiceDiscoveryAgent10metaObjectEv@Base 5.2.0 + _ZNK31QBluetoothServiceDiscoveryAgent10uuidFilterEv@Base 5.2.0 + _ZNK31QBluetoothServiceDiscoveryAgent11errorStringEv@Base 5.2.0 + _ZNK31QBluetoothServiceDiscoveryAgent13remoteAddressEv@Base 5.2.0 + _ZNK31QBluetoothServiceDiscoveryAgent18discoveredServicesEv@Base 5.2.0 + _ZNK31QBluetoothServiceDiscoveryAgent5errorEv@Base 5.2.0 + _ZNK31QBluetoothServiceDiscoveryAgent8isActiveEv@Base 5.2.0 + _ZTI16QBluetoothServer@Base 5.2.0 + _ZTI16QBluetoothSocket@Base 5.2.0 + _ZTI21QBluetoothLocalDevice@Base 5.2.0 + _ZTI23QBluetoothTransferReply@Base 5.2.0 + _ZTI25QBluetoothTransferManager@Base 5.2.0 + _ZTI30QBluetoothDeviceDiscoveryAgent@Base 5.2.0 + _ZTI31QBluetoothServiceDiscoveryAgent@Base 5.2.0 + _ZTS16QBluetoothServer@Base 5.2.0 + _ZTS16QBluetoothSocket@Base 5.2.0 + _ZTS21QBluetoothLocalDevice@Base 5.2.0 + _ZTS23QBluetoothTransferReply@Base 5.2.0 + _ZTS25QBluetoothTransferManager@Base 5.2.0 + _ZTS30QBluetoothDeviceDiscoveryAgent@Base 5.2.0 + _ZTS31QBluetoothServiceDiscoveryAgent@Base 5.2.0 + _ZTV16QBluetoothServer@Base 5.2.0 + _ZTV16QBluetoothSocket@Base 5.2.0 + _ZTV21QBluetoothLocalDevice@Base 5.2.0 + _ZTV23QBluetoothTransferReply@Base 5.2.0 + _ZTV25QBluetoothTransferManager@Base 5.2.0 + _ZTV30QBluetoothDeviceDiscoveryAgent@Base 5.2.0 + _ZTV31QBluetoothServiceDiscoveryAgent@Base 5.2.0 + _Zls6QDebugN16QBluetoothSocket11SocketErrorE@Base 5.2.0 + _Zls6QDebugN16QBluetoothSocket11SocketStateE@Base 5.2.0 + _Zls6QDebugRK21QBluetoothServiceInfo@Base 5.2.0 diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/libqt5nfc5.symbols qtconnectivity-opensource-src-5.2.1/debian/libqt5nfc5.symbols --- qtconnectivity-opensource-src-5.0~git20130802/debian/libqt5nfc5.symbols 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/libqt5nfc5.symbols 2014-01-30 03:00:03.000000000 +0000 @@ -0,0 +1,253 @@ +# SymbolsHelper-Confirmed: 5.2.0 amd64 +libQt5Nfc.so.5 libqt5nfc5 #MINVER# + _Z12qNfcChecksumPKcj@Base 5.2.0 + _Z29qRegisterNdefRecordTypeHelperPK11QMetaObjectN11QNdefRecord14TypeNameFormatERK10QByteArray@Base 5.2.0 + _Z38qNewDeclarativeNdefRecordForNdefRecordRK11QNdefRecord@Base 5.2.0 + _Z5qHashRK11QNdefRecord@Base 5.2.0 + _ZN11QLlcpServer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN11QLlcpServer11qt_metacastEPKc@Base 5.2.0 + _ZN11QLlcpServer13newConnectionEv@Base 5.2.0 + _ZN11QLlcpServer16staticMetaObjectE@Base 5.2.0 + _ZN11QLlcpServer21nextPendingConnectionEv@Base 5.2.0 + _ZN11QLlcpServer5closeEv@Base 5.2.0 + _ZN11QLlcpServer6listenERK7QString@Base 5.2.0 + _ZN11QLlcpServerC1EP7QObject@Base 5.2.0 + _ZN11QLlcpServerC2EP7QObject@Base 5.2.0 + _ZN11QLlcpServerD0Ev@Base 5.2.0 + _ZN11QLlcpServerD1Ev@Base 5.2.0 + _ZN11QLlcpServerD2Ev@Base 5.2.0 + _ZN11QLlcpSocket11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN11QLlcpSocket11qt_metacastEPKc@Base 5.2.0 + _ZN11QLlcpSocket12disconnectedEv@Base 5.2.0 + _ZN11QLlcpSocket12readDatagramEPcxPP16QNearFieldTargetPh@Base 5.2.0 + _ZN11QLlcpSocket12stateChangedENS_11SocketStateE@Base 5.2.0 + _ZN11QLlcpSocket13writeDatagramEPKcx@Base 5.2.0 + _ZN11QLlcpSocket13writeDatagramEPKcxP16QNearFieldTargeth@Base 5.2.0 + _ZN11QLlcpSocket13writeDatagramERK10QByteArray@Base 5.2.0 + _ZN11QLlcpSocket13writeDatagramERK10QByteArrayP16QNearFieldTargeth@Base 5.2.0 + _ZN11QLlcpSocket16connectToServiceEP16QNearFieldTargetRK7QString@Base 5.2.0 + _ZN11QLlcpSocket16staticMetaObjectE@Base 5.2.0 + _ZN11QLlcpSocket16waitForConnectedEi@Base 5.2.0 + _ZN11QLlcpSocket16waitForReadyReadEi@Base 5.2.0 + _ZN11QLlcpSocket19waitForBytesWrittenEi@Base 5.2.0 + _ZN11QLlcpSocket19waitForDisconnectedEi@Base 5.2.0 + _ZN11QLlcpSocket21disconnectFromServiceEv@Base 5.2.0 + _ZN11QLlcpSocket4bindEh@Base 5.2.0 + _ZN11QLlcpSocket5closeEv@Base 5.2.0 + _ZN11QLlcpSocket5errorENS_11SocketErrorE@Base 5.2.0 + _ZN11QLlcpSocket8readDataEPcx@Base 5.2.0 + _ZN11QLlcpSocket9connectedEv@Base 5.2.0 + _ZN11QLlcpSocket9writeDataEPKcx@Base 5.2.0 + _ZN11QLlcpSocketC1EP18QLlcpSocketPrivateP7QObject@Base 5.2.0 + _ZN11QLlcpSocketC1EP7QObject@Base 5.2.0 + _ZN11QLlcpSocketC2EP18QLlcpSocketPrivateP7QObject@Base 5.2.0 + _ZN11QLlcpSocketC2EP7QObject@Base 5.2.0 + _ZN11QLlcpSocketD0Ev@Base 5.2.0 + _ZN11QLlcpSocketD1Ev@Base 5.2.0 + _ZN11QLlcpSocketD2Ev@Base 5.2.0 + _ZN11QNdefFilter12appendRecordEN11QNdefRecord14TypeNameFormatERK10QByteArrayjj@Base 5.2.0 + _ZN11QNdefFilter12appendRecordERKNS_6RecordE@Base 5.2.0 + _ZN11QNdefFilter13setOrderMatchEb@Base 5.2.0 + _ZN11QNdefFilter5clearEv@Base 5.2.0 + _ZN11QNdefFilterC1ERKS_@Base 5.2.0 + _ZN11QNdefFilterC1Ev@Base 5.2.0 + _ZN11QNdefFilterC2ERKS_@Base 5.2.0 + _ZN11QNdefFilterC2Ev@Base 5.2.0 + _ZN11QNdefFilterD1Ev@Base 5.2.0 + _ZN11QNdefFilterD2Ev@Base 5.2.0 + _ZN11QNdefFilteraSERKS_@Base 5.2.0 + _ZN11QNdefRecord10setPayloadERK10QByteArray@Base 5.2.0 + _ZN11QNdefRecord17setTypeNameFormatENS_14TypeNameFormatE@Base 5.2.0 + _ZN11QNdefRecord5setIdERK10QByteArray@Base 5.2.0 + _ZN11QNdefRecord7setTypeERK10QByteArray@Base 5.2.0 + _ZN11QNdefRecordC1ENS_14TypeNameFormatERK10QByteArray@Base 5.2.0 + _ZN11QNdefRecordC1ERKS_@Base 5.2.0 + _ZN11QNdefRecordC1ERKS_NS_14TypeNameFormatE@Base 5.2.0 + _ZN11QNdefRecordC1ERKS_NS_14TypeNameFormatERK10QByteArray@Base 5.2.0 + _ZN11QNdefRecordC1Ev@Base 5.2.0 + _ZN11QNdefRecordC2ENS_14TypeNameFormatERK10QByteArray@Base 5.2.0 + _ZN11QNdefRecordC2ERKS_@Base 5.2.0 + _ZN11QNdefRecordC2ERKS_NS_14TypeNameFormatE@Base 5.2.0 + _ZN11QNdefRecordC2ERKS_NS_14TypeNameFormatERK10QByteArray@Base 5.2.0 + _ZN11QNdefRecordC2Ev@Base 5.2.0 + _ZN11QNdefRecordD1Ev@Base 5.2.0 + _ZN11QNdefRecordD2Ev@Base 5.2.0 + _ZN11QNdefRecordaSERKS_@Base 5.2.0 + _ZN12QNdefMessage13fromByteArrayERK10QByteArray@Base 5.2.0 + _ZN14QQmlNdefRecord11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN14QQmlNdefRecord11qt_metacastEPKc@Base 5.2.0 + _ZN14QQmlNdefRecord11typeChangedEv@Base 5.2.0 + _ZN14QQmlNdefRecord13recordChangedEv@Base 5.2.0 + _ZN14QQmlNdefRecord16staticMetaObjectE@Base 5.2.0 + _ZN14QQmlNdefRecord17setTypeNameFormatENS_14TypeNameFormatE@Base 5.2.0 + _ZN14QQmlNdefRecord21typeNameFormatChangedEv@Base 5.2.0 + _ZN14QQmlNdefRecord7setTypeERK7QString@Base 5.2.0 + _ZN14QQmlNdefRecord9setRecordERK11QNdefRecord@Base 5.2.0 + _ZN14QQmlNdefRecordC1EP7QObject@Base 5.2.0 + _ZN14QQmlNdefRecordC1ERK11QNdefRecordP7QObject@Base 5.2.0 + _ZN14QQmlNdefRecordC2EP7QObject@Base 5.2.0 + _ZN14QQmlNdefRecordC2ERK11QNdefRecordP7QObject@Base 5.2.0 + _ZN14QQmlNdefRecordD0Ev@Base 5.2.0 + _ZN14QQmlNdefRecordD1Ev@Base 5.2.0 + _ZN14QQmlNdefRecordD2Ev@Base 5.2.0 + _ZN16QNearFieldTarget11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN16QNearFieldTarget11qt_metacastEPKc@Base 5.2.0 + _ZN16QNearFieldTarget11sendCommandERK10QByteArray@Base 5.2.0 + _ZN16QNearFieldTarget12disconnectedEv@Base 5.2.0 + _ZN16QNearFieldTarget12sendCommandsERK5QListI10QByteArrayE@Base 5.2.0 + _ZN16QNearFieldTarget14handleResponseERKNS_9RequestIdERK10QByteArray@Base 5.2.0 + _ZN16QNearFieldTarget14hasNdefMessageEv@Base 5.2.0 + _ZN16QNearFieldTarget15ndefMessageReadERK12QNdefMessage@Base 5.2.0 + _ZN16QNearFieldTarget15requestResponseERKNS_9RequestIdE@Base 5.2.0 + _ZN16QNearFieldTarget16readNdefMessagesEv@Base 5.2.0 + _ZN16QNearFieldTarget16requestCompletedERKNS_9RequestIdE@Base 5.2.0 + _ZN16QNearFieldTarget16staticMetaObjectE@Base 5.2.0 + _ZN16QNearFieldTarget17writeNdefMessagesERK5QListI12QNdefMessageE@Base 5.2.0 + _ZN16QNearFieldTarget19ndefMessagesWrittenEv@Base 5.2.0 + _ZN16QNearFieldTarget21setResponseForRequestERKNS_9RequestIdERK8QVariantb@Base 5.2.0 + _ZN16QNearFieldTarget23waitForRequestCompletedERKNS_9RequestIdEi@Base 5.2.0 + _ZN16QNearFieldTarget5errorENS_5ErrorERKNS_9RequestIdE@Base 5.2.0 + _ZN16QNearFieldTarget9RequestIdC1EPNS_16RequestIdPrivateE@Base 5.2.0 + _ZN16QNearFieldTarget9RequestIdC1ERKS0_@Base 5.2.0 + _ZN16QNearFieldTarget9RequestIdC1Ev@Base 5.2.0 + _ZN16QNearFieldTarget9RequestIdC2EPNS_16RequestIdPrivateE@Base 5.2.0 + _ZN16QNearFieldTarget9RequestIdC2ERKS0_@Base 5.2.0 + _ZN16QNearFieldTarget9RequestIdC2Ev@Base 5.2.0 + _ZN16QNearFieldTarget9RequestIdD1Ev@Base 5.2.0 + _ZN16QNearFieldTarget9RequestIdD2Ev@Base 5.2.0 + _ZN16QNearFieldTarget9RequestIdaSERKS0_@Base 5.2.0 + _ZN16QNearFieldTargetC1EP7QObject@Base 5.2.0 + _ZN16QNearFieldTargetC2EP7QObject@Base 5.2.0 + _ZN16QNearFieldTargetD0Ev@Base 5.2.0 + _ZN16QNearFieldTargetD1Ev@Base 5.2.0 + _ZN16QNearFieldTargetD2Ev@Base 5.2.0 + _ZN17QNdefNfcUriRecord6setUriERK4QUrl@Base 5.2.0 + _ZN17QNearFieldManager10targetLostEP16QNearFieldTarget@Base 5.2.0 + _ZN17QNearFieldManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.2.0 + _ZN17QNearFieldManager11qt_metacastEPKc@Base 5.2.0 + _ZN17QNearFieldManager14targetDetectedEP16QNearFieldTarget@Base 5.2.0 + _ZN17QNearFieldManager16staticMetaObjectE@Base 5.2.0 + _ZN17QNearFieldManager19stopTargetDetectionEv@Base 5.2.0 + _ZN17QNearFieldManager20setTargetAccessModesE6QFlagsINS_16TargetAccessModeEE@Base 5.2.0 + _ZN17QNearFieldManager20startTargetDetectionEv@Base 5.2.0 + _ZN17QNearFieldManager26registerNdefMessageHandlerEN11QNdefRecord14TypeNameFormatERK10QByteArrayP7QObjectPKc@Base 5.2.0 + _ZN17QNearFieldManager26registerNdefMessageHandlerEP7QObjectPKc@Base 5.2.0 + _ZN17QNearFieldManager26registerNdefMessageHandlerERK11QNdefFilterP7QObjectPKc@Base 5.2.0 + _ZN17QNearFieldManager28unregisterNdefMessageHandlerEi@Base 5.2.0 + _ZN17QNearFieldManagerC1EP24QNearFieldManagerPrivateP7QObject@Base 5.2.0 + _ZN17QNearFieldManagerC1EP7QObject@Base 5.2.0 + _ZN17QNearFieldManagerC2EP24QNearFieldManagerPrivateP7QObject@Base 5.2.0 + _ZN17QNearFieldManagerC2EP7QObject@Base 5.2.0 + _ZN17QNearFieldManagerD0Ev@Base 5.2.0 + _ZN17QNearFieldManagerD1Ev@Base 5.2.0 + _ZN17QNearFieldManagerD2Ev@Base 5.2.0 + _ZN18QNdefNfcIconRecord7setDataERK10QByteArray@Base 5.2.0 + _ZN18QNdefNfcTextRecord11setEncodingENS_8EncodingE@Base 5.2.0 + _ZN18QNdefNfcTextRecord7setTextE7QString@Base 5.2.0 + _ZN18QNdefNfcTextRecord9setLocaleERK7QString@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord10removeIconERK10QByteArray@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord10removeIconERK18QNdefNfcIconRecord@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord10setPayloadERK10QByteArray@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord11removeTitleERK18QNdefNfcTextRecord@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord11removeTitleERK7QString@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord11setTypeInfoERK10QByteArray@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord15addIconInternalERK18QNdefNfcIconRecord@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord16addTitleInternalERK18QNdefNfcTextRecord@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord16convertToPayloadEv@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord6setUriERK17QNdefNfcUriRecord@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord6setUriERK4QUrl@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord7addIconERK10QByteArrayS2_@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord7addIconERK18QNdefNfcIconRecord@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord7cleanupEv@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord7setSizeEj@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord8addTitleERK18QNdefNfcTextRecord@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord8addTitleERK7QStringS2_N18QNdefNfcTextRecord8EncodingE@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord8setIconsERK5QListI18QNdefNfcIconRecordE@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord9setActionENS_6ActionE@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecord9setTitlesERK5QListI18QNdefNfcTextRecordE@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecordC1ERK11QNdefRecord@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecordC1ERKS_@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecordC1Ev@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecordC2ERK11QNdefRecord@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecordC2ERKS_@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecordC2Ev@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecordD1Ev@Base 5.2.0 + _ZN25QNdefNfcSmartPosterRecordD2Ev@Base 5.2.0 + _ZNK11QLlcpServer10metaObjectEv@Base 5.2.0 + _ZNK11QLlcpServer10serverPortEv@Base 5.2.0 + _ZNK11QLlcpServer10serviceUriEv@Base 5.2.0 + _ZNK11QLlcpServer11isListeningEv@Base 5.2.0 + _ZNK11QLlcpServer11serverErrorEv@Base 5.2.0 + _ZNK11QLlcpServer21hasPendingConnectionsEv@Base 5.2.0 + _ZNK11QLlcpSocket10metaObjectEv@Base 5.2.0 + _ZNK11QLlcpSocket11canReadLineEv@Base 5.2.0 + _ZNK11QLlcpSocket12isSequentialEv@Base 5.2.0 + _ZNK11QLlcpSocket14bytesAvailableEv@Base 5.2.0 + _ZNK11QLlcpSocket19hasPendingDatagramsEv@Base 5.2.0 + _ZNK11QLlcpSocket19pendingDatagramSizeEv@Base 5.2.0 + _ZNK11QLlcpSocket5errorEv@Base 5.2.0 + _ZNK11QLlcpSocket5stateEv@Base 5.2.0 + _ZNK11QNdefFilter10orderMatchEv@Base 5.2.0 + _ZNK11QNdefFilter11recordCountEv@Base 5.2.0 + _ZNK11QNdefFilter8recordAtEi@Base 5.2.0 + _ZNK11QNdefRecord14typeNameFormatEv@Base 5.2.0 + _ZNK11QNdefRecord2idEv@Base 5.2.0 + _ZNK11QNdefRecord4typeEv@Base 5.2.0 + _ZNK11QNdefRecord7isEmptyEv@Base 5.2.0 + _ZNK11QNdefRecord7payloadEv@Base 5.2.0 + _ZNK11QNdefRecordeqERKS_@Base 5.2.0 + _ZNK12QNdefMessage11toByteArrayEv@Base 5.2.0 + _ZNK12QNdefMessageeqERKS_@Base 5.2.0 + _ZNK14QQmlNdefRecord10metaObjectEv@Base 5.2.0 + _ZNK14QQmlNdefRecord14typeNameFormatEv@Base 5.2.0 + _ZNK14QQmlNdefRecord4typeEv@Base 5.2.0 + _ZNK14QQmlNdefRecord6recordEv@Base 5.2.0 + _ZNK16QNearFieldTarget10metaObjectEv@Base 5.2.0 + _ZNK16QNearFieldTarget19isProcessingCommandEv@Base 5.2.0 + _ZNK16QNearFieldTarget3urlEv@Base 5.2.0 + _ZNK16QNearFieldTarget9RequestId7isValidEv@Base 5.2.0 + _ZNK16QNearFieldTarget9RequestId8refCountEv@Base 5.2.0 + _ZNK16QNearFieldTarget9RequestIdeqERKS0_@Base 5.2.0 + _ZNK16QNearFieldTarget9RequestIdltERKS0_@Base 5.2.0 + _ZNK16QNearFieldTarget9RequestIdneERKS0_@Base 5.2.0 + _ZNK17QNdefNfcUriRecord3uriEv@Base 5.2.0 + _ZNK17QNearFieldManager10metaObjectEv@Base 5.2.0 + _ZNK17QNearFieldManager11isAvailableEv@Base 5.2.0 + _ZNK17QNearFieldManager17targetAccessModesEv@Base 5.2.0 + _ZNK18QNdefNfcIconRecord4dataEv@Base 5.2.0 + _ZNK18QNdefNfcTextRecord4textEv@Base 5.2.0 + _ZNK18QNdefNfcTextRecord6localeEv@Base 5.2.0 + _ZNK18QNdefNfcTextRecord8encodingEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord10iconRecordEi@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord10titleCountEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord11hasTypeInfoEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord11iconRecordsEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord11titleRecordEi@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord12titleRecordsEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord3uriEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord4iconERK10QByteArray@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord4sizeEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord5titleERK7QString@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord6actionEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord7hasIconERK10QByteArray@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord7hasSizeEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord8hasTitleERK7QString@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord8typeInfoEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord9hasActionEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord9iconCountEv@Base 5.2.0 + _ZNK25QNdefNfcSmartPosterRecord9uriRecordEv@Base 5.2.0 + _ZTI11QLlcpServer@Base 5.2.0 + _ZTI11QLlcpSocket@Base 5.2.0 + _ZTI14QQmlNdefRecord@Base 5.2.0 + _ZTI16QNearFieldTarget@Base 5.2.0 + _ZTI17QNearFieldManager@Base 5.2.0 + _ZTS11QLlcpServer@Base 5.2.0 + _ZTS11QLlcpSocket@Base 5.2.0 + _ZTS14QQmlNdefRecord@Base 5.2.0 + _ZTS16QNearFieldTarget@Base 5.2.0 + _ZTS17QNearFieldManager@Base 5.2.0 + _ZTV11QLlcpServer@Base 5.2.0 + _ZTV11QLlcpSocket@Base 5.2.0 + _ZTV14QQmlNdefRecord@Base 5.2.0 + _ZTV16QNearFieldTarget@Base 5.2.0 + _ZTV17QNearFieldManager@Base 5.2.0 diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/qtconnectivity5-dev.install qtconnectivity-opensource-src-5.2.1/debian/qtconnectivity5-dev.install --- qtconnectivity-opensource-src-5.0~git20130802/debian/qtconnectivity5-dev.install 2013-08-16 04:41:24.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/qtconnectivity5-dev.install 2014-02-23 03:00:09.000000000 +0000 @@ -1,65 +1,61 @@ -usr/lib/*/cmake/* -usr/lib/*/*.prl -usr/lib/*/*.so -usr/lib/*/pkgconfig/* -usr/share/qt5/mkspecs/modules/* -usr/include/qt5/QtBluetooth/qbluetoothdeviceinfo.h -usr/include/qt5/QtBluetooth/qrfcommserver.h +usr/include/qt5/QtBluetooth/QBluetoothAddress +usr/include/qt5/QtBluetooth/QBluetoothDeviceDiscoveryAgent +usr/include/qt5/QtBluetooth/QBluetoothDeviceInfo +usr/include/qt5/QtBluetooth/QBluetoothHostInfo usr/include/qt5/QtBluetooth/QBluetoothLocalDevice +usr/include/qt5/QtBluetooth/QBluetoothServer usr/include/qt5/QtBluetooth/QBluetoothServiceDiscoveryAgent -usr/include/qt5/QtBluetooth/ql2capserver.h -usr/include/qt5/QtBluetooth/QL2capServer +usr/include/qt5/QtBluetooth/QBluetoothServiceInfo +usr/include/qt5/QtBluetooth/QBluetoothSocket usr/include/qt5/QtBluetooth/QBluetoothTransferManager -usr/include/qt5/QtBluetooth/qbluetooth.h -usr/include/qt5/QtBluetooth/QRfcommServer -usr/include/qt5/QtBluetooth/QtBluetoothVersion -usr/include/qt5/QtBluetooth/qbluetoothdevicediscoveryagent.h -usr/include/qt5/QtBluetooth/qbluetoothlocaldevice.h -usr/include/qt5/QtBluetooth/QBluetoothAddress -usr/include/qt5/QtBluetooth/qbluetoothtransferrequest.h -usr/include/qt5/QtBluetooth/QBluetoothUuid -usr/include/qt5/QtBluetooth/QBluetoothDeviceDiscoveryAgent -usr/include/qt5/QtBluetooth/qbluetoothtransfermanager.h -usr/include/qt5/QtBluetooth/qtbluetoothversion.h -usr/include/qt5/QtBluetooth/qbluetoothtransferreply.h usr/include/qt5/QtBluetooth/QBluetoothTransferReply -usr/include/qt5/QtBluetooth/QBluetoothHostInfo usr/include/qt5/QtBluetooth/QBluetoothTransferRequest +usr/include/qt5/QtBluetooth/QBluetoothUuid +usr/include/qt5/QtBluetooth/QtBluetooth +usr/include/qt5/QtBluetooth/QtBluetoothDepends +usr/include/qt5/QtBluetooth/QtBluetoothVersion +usr/include/qt5/QtBluetooth/qbluetooth.h +usr/include/qt5/QtBluetooth/qbluetoothaddress.h +usr/include/qt5/QtBluetooth/qbluetoothdevicediscoveryagent.h +usr/include/qt5/QtBluetooth/qbluetoothdeviceinfo.h +usr/include/qt5/QtBluetooth/qbluetoothglobal.h usr/include/qt5/QtBluetooth/qbluetoothhostinfo.h -usr/include/qt5/QtBluetooth/QBluetoothServiceInfo +usr/include/qt5/QtBluetooth/qbluetoothlocaldevice.h +usr/include/qt5/QtBluetooth/qbluetoothserver.h usr/include/qt5/QtBluetooth/qbluetoothservicediscoveryagent.h -usr/include/qt5/QtBluetooth/qbluetoothsocket.h -usr/include/qt5/QtBluetooth/QtBluetooth -usr/include/qt5/QtBluetooth/QBluetoothSocket usr/include/qt5/QtBluetooth/qbluetoothserviceinfo.h +usr/include/qt5/QtBluetooth/qbluetoothsocket.h +usr/include/qt5/QtBluetooth/qbluetoothtransfermanager.h +usr/include/qt5/QtBluetooth/qbluetoothtransferreply.h +usr/include/qt5/QtBluetooth/qbluetoothtransferrequest.h usr/include/qt5/QtBluetooth/qbluetoothuuid.h -usr/include/qt5/QtBluetooth/qbluetoothaddress.h -usr/include/qt5/QtBluetooth/qbluetoothglobal.h -usr/include/qt5/QtBluetooth/QBluetoothDeviceInfo -usr/include/qt5/QtNfc/qndeffilter.h +usr/include/qt5/QtBluetooth/qtbluetoothversion.h +usr/include/qt5/QtNfc/QNdefFilter +usr/include/qt5/QtNfc/QNdefMessage +usr/include/qt5/QtNfc/QNdefNfcIconRecord +usr/include/qt5/QtNfc/QNdefNfcSmartPosterRecord +usr/include/qt5/QtNfc/QNdefNfcTextRecord usr/include/qt5/QtNfc/QNdefNfcUriRecord -usr/include/qt5/QtNfc/qllcpserver.h +usr/include/qt5/QtNfc/QNdefRecord usr/include/qt5/QtNfc/QNearFieldManager +usr/include/qt5/QtNfc/QNearFieldTarget +usr/include/qt5/QtNfc/QQmlNdefRecord +usr/include/qt5/QtNfc/QtNfc +usr/include/qt5/QtNfc/QtNfcDepends usr/include/qt5/QtNfc/QtNfcVersion +usr/include/qt5/QtNfc/qndeffilter.h usr/include/qt5/QtNfc/qndefmessage.h -usr/include/qt5/QtNfc/QNdefRecord usr/include/qt5/QtNfc/qndefnfcsmartposterrecord.h -usr/include/qt5/QtNfc/QLlcpSocket -usr/include/qt5/QtNfc/QNdefMessage -usr/include/qt5/QtNfc/qnearfieldtarget.h -usr/include/qt5/QtNfc/QNdefFilter -usr/include/qt5/QtNfc/QtNfc usr/include/qt5/QtNfc/qndefnfctextrecord.h -usr/include/qt5/QtNfc/qdeclarativendefrecord.h usr/include/qt5/QtNfc/qndefnfcurirecord.h +usr/include/qt5/QtNfc/qndefrecord.h usr/include/qt5/QtNfc/qnearfieldmanager.h -usr/include/qt5/QtNfc/QNdefNfcSmartPosterRecord -usr/include/qt5/QtNfc/QLlcpServer -usr/include/qt5/QtNfc/QNdefNfcTextRecord -usr/include/qt5/QtNfc/QDeclarativeNdefRecord -usr/include/qt5/QtNfc/qllcpsocket.h +usr/include/qt5/QtNfc/qnearfieldtarget.h usr/include/qt5/QtNfc/qnfcglobal.h +usr/include/qt5/QtNfc/qqmlndefrecord.h usr/include/qt5/QtNfc/qtnfcversion.h -usr/include/qt5/QtNfc/QNearFieldTarget -usr/include/qt5/QtNfc/qndefrecord.h -usr/include/qt5/QtNfc/QNdefNfcIconRecord +usr/lib/*/*.prl +usr/lib/*/*.so +usr/lib/*/cmake/* +usr/lib/*/pkgconfig/* +usr/lib/*/qt5/mkspecs/modules/* diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/qtconnectivity5-examples.install qtconnectivity-opensource-src-5.2.1/debian/qtconnectivity5-examples.install --- qtconnectivity-opensource-src-5.0~git20130802/debian/qtconnectivity5-examples.install 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/qtconnectivity5-examples.install 2014-02-23 03:00:09.000000000 +0000 @@ -0,0 +1,92 @@ +usr/lib/*/qt5/examples/bluetooth/bluetooth.pro +usr/lib/*/qt5/examples/bluetooth/bttennis/tennis.h +usr/lib/*/qt5/examples/bluetooth/bttennis/tennis.cpp +usr/lib/*/qt5/examples/bluetooth/bttennis/tennisserver.h +usr/lib/*/qt5/examples/bluetooth/bttennis/board.cpp +usr/lib/*/qt5/examples/bluetooth/bttennis/tennis.qrc +usr/lib/*/qt5/examples/bluetooth/bttennis/bttennis +usr/lib/*/qt5/examples/bluetooth/bttennis/tennis.ui +usr/lib/*/qt5/examples/bluetooth/bttennis/controller.h +usr/lib/*/qt5/examples/bluetooth/bttennis/tennisclient.cpp +usr/lib/*/qt5/examples/bluetooth/bttennis/controller.cpp +usr/lib/*/qt5/examples/bluetooth/bttennis/tennisclient.h +usr/lib/*/qt5/examples/bluetooth/bttennis/main.cpp +usr/lib/*/qt5/examples/bluetooth/bttennis/tennisserver.cpp +usr/lib/*/qt5/examples/bluetooth/bttennis/connect.png +usr/lib/*/qt5/examples/bluetooth/bttennis/tennisview.h +usr/lib/*/qt5/examples/bluetooth/bttennis/tennisview.cpp +usr/lib/*/qt5/examples/bluetooth/bttennis/board.h +usr/lib/*/qt5/examples/bluetooth/bttennis/bttennis.pro +usr/lib/*/qt5/examples/bluetooth/btchat/chatserver.cpp +usr/lib/*/qt5/examples/bluetooth/btchat/remoteselector.cpp +usr/lib/*/qt5/examples/bluetooth/btchat/chatclient.h +usr/lib/*/qt5/examples/bluetooth/btchat/chat.cpp +usr/lib/*/qt5/examples/bluetooth/btchat/chat.h +usr/lib/*/qt5/examples/bluetooth/btchat/chatclient.cpp +usr/lib/*/qt5/examples/bluetooth/btchat/btchat.pro +usr/lib/*/qt5/examples/bluetooth/btchat/btchat +usr/lib/*/qt5/examples/bluetooth/btchat/main.cpp +usr/lib/*/qt5/examples/bluetooth/btchat/chatserver.h +usr/lib/*/qt5/examples/bluetooth/btchat/remoteselector.ui +usr/lib/*/qt5/examples/bluetooth/btchat/remoteselector.h +usr/lib/*/qt5/examples/bluetooth/btchat/chat.ui +usr/lib/*/qt5/examples/bluetooth/scanner/scanner.pro +usr/lib/*/qt5/examples/bluetooth/scanner/default.png +usr/lib/*/qt5/examples/bluetooth/scanner/Button.qml +usr/lib/*/qt5/examples/bluetooth/scanner/scanner.qrc +usr/lib/*/qt5/examples/bluetooth/scanner/qml_scanner +usr/lib/*/qt5/examples/bluetooth/scanner/qmlscanner.cpp +usr/lib/*/qt5/examples/bluetooth/scanner/btfiletransfer +usr/lib/*/qt5/examples/bluetooth/scanner/scanner.qml +usr/lib/*/qt5/examples/bluetooth/btscanner/service.h +usr/lib/*/qt5/examples/bluetooth/btscanner/service.cpp +usr/lib/*/qt5/examples/bluetooth/btscanner/btscanner.pro +usr/lib/*/qt5/examples/bluetooth/btscanner/service.ui +usr/lib/*/qt5/examples/bluetooth/btscanner/device.h +usr/lib/*/qt5/examples/bluetooth/btscanner/main.cpp +usr/lib/*/qt5/examples/bluetooth/btscanner/btscanner +usr/lib/*/qt5/examples/bluetooth/btscanner/device.cpp +usr/lib/*/qt5/examples/bluetooth/btscanner/device.ui +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/pairing.gif +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/btfiletransfer.qrc +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/progress.h +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/remoteselector.cpp +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/btfiletransfer.pro +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/pindisplay.ui +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/pindisplay.cpp +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/busy.gif +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/pindisplay.h +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/progress.ui +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/main.cpp +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/progress.cpp +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/remoteselector.ui +usr/lib/*/qt5/examples/bluetooth/btfiletransfer/remoteselector.h +usr/lib/*/qt5/examples/nfc/nfc.pro +usr/lib/*/qt5/examples/nfc/annotatedurl/mainwindow.h +usr/lib/*/qt5/examples/nfc/annotatedurl/annotatedurl +usr/lib/*/qt5/examples/nfc/annotatedurl/mainwindow.cpp +usr/lib/*/qt5/examples/nfc/annotatedurl/mainwindow.ui +usr/lib/*/qt5/examples/nfc/annotatedurl/annotatedurl.h +usr/lib/*/qt5/examples/nfc/annotatedurl/main.cpp +usr/lib/*/qt5/examples/nfc/annotatedurl/annotatedurl.pro +usr/lib/*/qt5/examples/nfc/annotatedurl/annotatedurl.cpp +usr/lib/*/qt5/examples/nfc/poster/qmlposter.cpp +usr/lib/*/qt5/examples/nfc/poster/qml_poster +usr/lib/*/qt5/examples/nfc/poster/poster.qrc +usr/lib/*/qt5/examples/nfc/poster/poster.qml +usr/lib/*/qt5/examples/nfc/poster/poster.pro +usr/lib/*/qt5/examples/nfc/ndefeditor/urirecordeditor.h +usr/lib/*/qt5/examples/nfc/ndefeditor/mainwindow.h +usr/lib/*/qt5/examples/nfc/ndefeditor/mimeimagerecordeditor.h +usr/lib/*/qt5/examples/nfc/ndefeditor/mimeimagerecordeditor.cpp +usr/lib/*/qt5/examples/nfc/ndefeditor/ndefeditor.pro +usr/lib/*/qt5/examples/nfc/ndefeditor/textrecordeditor.cpp +usr/lib/*/qt5/examples/nfc/ndefeditor/mimeimagerecordeditor.ui +usr/lib/*/qt5/examples/nfc/ndefeditor/urirecordeditor.ui +usr/lib/*/qt5/examples/nfc/ndefeditor/textrecordeditor.h +usr/lib/*/qt5/examples/nfc/ndefeditor/mainwindow.cpp +usr/lib/*/qt5/examples/nfc/ndefeditor/textrecordeditor.ui +usr/lib/*/qt5/examples/nfc/ndefeditor/mainwindow.ui +usr/lib/*/qt5/examples/nfc/ndefeditor/ndefeditor +usr/lib/*/qt5/examples/nfc/ndefeditor/main.cpp +usr/lib/*/qt5/examples/nfc/ndefeditor/urirecordeditor.cpp diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/qtconnectivity5-private-dev.install qtconnectivity-opensource-src-5.2.1/debian/qtconnectivity5-private-dev.install --- qtconnectivity-opensource-src-5.0~git20130802/debian/qtconnectivity5-private-dev.install 2013-08-16 04:41:24.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/qtconnectivity5-private-dev.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/include/qt5/QtBluetooth/5.2.0/QtBluetooth/private/* -usr/include/qt5/QtNfc/5.2.0/QtNfc/private/* diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/qtdeclarative5-qtbluetooth-plugin.install qtconnectivity-opensource-src-5.2.1/debian/qtdeclarative5-qtbluetooth-plugin.install --- qtconnectivity-opensource-src-5.0~git20130802/debian/qtdeclarative5-qtbluetooth-plugin.install 2013-08-16 04:41:24.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/qtdeclarative5-qtbluetooth-plugin.install 2014-01-30 02:54:21.000000000 +0000 @@ -1,3 +1,3 @@ -usr/lib/*/qt5/qml/QtBluetooth/plugins.qmltypes usr/lib/*/qt5/qml/QtBluetooth/libdeclarative_bluetooth.so +usr/lib/*/qt5/qml/QtBluetooth/plugins.qmltypes usr/lib/*/qt5/qml/QtBluetooth/qmldir diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/qtdeclarative5-qtnfc-plugin.install qtconnectivity-opensource-src-5.2.1/debian/qtdeclarative5-qtnfc-plugin.install --- qtconnectivity-opensource-src-5.0~git20130802/debian/qtdeclarative5-qtnfc-plugin.install 2013-08-16 04:41:24.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/qtdeclarative5-qtnfc-plugin.install 2014-01-30 02:54:21.000000000 +0000 @@ -1,2 +1,3 @@ -usr/lib/*/qt5/qml/QtNfc/qmldir usr/lib/*/qt5/qml/QtNfc/libdeclarative_nfc.so +usr/lib/*/qt5/qml/QtNfc/plugins.qmltypes +usr/lib/*/qt5/qml/QtNfc/qmldir diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/rules qtconnectivity-opensource-src-5.2.1/debian/rules --- qtconnectivity-opensource-src-5.0~git20130802/debian/rules 2013-08-16 04:41:24.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/rules 2014-02-23 03:00:09.000000000 +0000 @@ -6,6 +6,7 @@ export CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) export CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed +export QT_SELECT := qt5 %: dh $@ --fail-missing --parallel --with pkgkde_symbolshelper --dbg-package=qtconnectivity5-dbg @@ -15,9 +16,10 @@ override_dh_auto_install: dh_auto_install - # Remove libtool-like files - rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la -override_dh_builddeb: - dh_builddeb -- -Zxz + # Remove libtool-like files + rm -fv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la + # Remove private headers we are not installing. + rm -rfv debian/tmp/usr/include/qt5/QtNfc/*/QtNfc/private/ + rm -rfv debian/tmp/usr/include/qt5/QtBluetooth/*/QtBluetooth/private/ diff -Nru qtconnectivity-opensource-src-5.0~git20130802/debian/watch qtconnectivity-opensource-src-5.2.1/debian/watch --- qtconnectivity-opensource-src-5.0~git20130802/debian/watch 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/debian/watch 2014-01-30 02:17:31.000000000 +0000 @@ -0,0 +1,2 @@ +version=3 +http://download.qt-project.org/official_releases/qt/([\d\.]*)/([\d\.]*)/submodules/qtconnectivity-opensource-src-([^-]*)\.tar.xz diff -Nru qtconnectivity-opensource-src-5.0~git20130802/dist/changes-5.2.1 qtconnectivity-opensource-src-5.2.1/dist/changes-5.2.1 --- qtconnectivity-opensource-src-5.0~git20130802/dist/changes-5.2.1 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/dist/changes-5.2.1 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,58 @@ +Qt 5.2.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.2.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + http://qt-project.org/doc/qt-5.2 + +The Qt version 5.2 series is binary compatible with the 5.1.x series. +Applications compiled for 5.1 will continue to run with 5.2. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt-project.org/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* General * +**************************************************************************** + +General Improvements +-------------------- + + - Fixed make install rules for all examples + + - Minor code improvements made such as removal of compiler warnings and + code cleanups. + +**************************************************************************** +* Library * +**************************************************************************** + +QtBluetooth +----------- + + - Fixed cases where device and service discovery classes emitted an error + signal but the human readable error string was not adjusted + + - Marked untranslated error strings for translation + + - [QTBUG-32253] + * Utilized new QLoggingCategory API for warnings and debug messages + +QtNfc +------ + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Blackberry +------- + + - Dangling pointer in QBluetoothServiceDiscoveryAgent fixed + diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/btchat.pro qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/btchat.pro --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/btchat.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/btchat.pro 2014-02-01 20:38:03.000000000 +0000 @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = btchat -QT += concurrent bluetooth widgets +QT = core bluetooth widgets SOURCES = \ main.cpp \ @@ -19,3 +19,6 @@ FORMS = \ chat.ui \ remoteselector.ui + +target.path = $$[QT_INSTALL_EXAMPLES]/bluetooth/btchat +INSTALLS += target diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chatclient.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chatclient.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chatclient.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chatclient.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -59,10 +59,10 @@ return; // Connect to service - socket = new QBluetoothSocket(QBluetoothSocket::RfcommSocket); + socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol); qDebug() << "Create socket"; socket->connectToService(remoteService); - qDebug() << "ConnecttoService done"; + qDebug() << "ConnectToService done"; connect(socket, SIGNAL(readyRead()), this, SLOT(readSocket())); connect(socket, SIGNAL(connected()), this, SLOT(connected())); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chatclient.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chatclient.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chatclient.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chatclient.h 2014-02-01 20:38:03.000000000 +0000 @@ -45,11 +45,9 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH -class QBluetoothSocket; -QT_END_NAMESPACE_BLUETOOTH +QT_FORWARD_DECLARE_CLASS(QBluetoothSocket) -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE //! [declaration] class ChatClient : public QObject diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chat.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chat.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chat.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chat.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -44,7 +44,7 @@ #include "chatclient.h" #include -#include +#include #include #include #include @@ -56,7 +56,7 @@ static const QLatin1String serviceUuid("e8e10f95-1a70-4b27-9ccf-02010264e9c8"); Chat::Chat(QWidget *parent) -: QDialog(parent), ui(new Ui_Chat) + : QDialog(parent), currentAdapterIndex(0), ui(new Ui_Chat) { //! [Construct UI] ui->setupUi(this); @@ -66,6 +66,22 @@ connect(ui->sendButton, SIGNAL(clicked()), this, SLOT(sendClicked())); //! [Construct UI] + localAdapters = QBluetoothLocalDevice::allDevices(); + if (localAdapters.count() < 2) { + ui->localAdapterBox->setVisible(false); + } else { + //we ignore more than two adapters + ui->localAdapterBox->setVisible(true); + ui->firstAdapter->setText(tr("Default (%1)", "%1 = Bluetooth address"). + arg(localAdapters.at(0).address().toString())); + ui->secondAdapter->setText(localAdapters.at(1).address().toString()); + ui->firstAdapter->setChecked(true); + connect(ui->firstAdapter, SIGNAL(clicked()), this, SLOT(newAdapterSelected())); + connect(ui->secondAdapter, SIGNAL(clicked()), this, SLOT(newAdapterSelected())); + QBluetoothLocalDevice adapter(localAdapters.at(0).address()); + adapter.setHostMode(QBluetoothLocalDevice::HostDiscoverable); + } + //! [Create Chat Server] server = new ChatServer(this); connect(server, SIGNAL(clientConnected(QString)), this, SLOT(clientConnected(QString))); @@ -104,6 +120,32 @@ { ui->chat->insertPlainText(QString::fromLatin1("Joined chat with %1.\n").arg(name)); } + +void Chat::newAdapterSelected() +{ + const int newAdapterIndex = adapterFromUserSelection(); + if (currentAdapterIndex != newAdapterIndex) { + server->stopServer(); + currentAdapterIndex = newAdapterIndex; + const QBluetoothHostInfo info = localAdapters.at(currentAdapterIndex); + QBluetoothLocalDevice adapter(info.address()); + adapter.setHostMode(QBluetoothLocalDevice::HostDiscoverable); + server->startServer(info.address()); + localName = info.name(); + } +} + +int Chat::adapterFromUserSelection() const +{ + int result = 0; + QBluetoothAddress newAdapter = localAdapters.at(0).address(); + + if (ui->secondAdapter->isChecked()) { + newAdapter = localAdapters.at(1).address(); + result = 1; + } + return result; +} //! [connected] //! [clientDisconnected] @@ -123,7 +165,11 @@ ui->connectButton->setEnabled(false); // scan for services - RemoteSelector remoteSelector; + const QBluetoothAddress adapter = localAdapters.isEmpty() ? + QBluetoothAddress() : + localAdapters.at(currentAdapterIndex).address(); + + RemoteSelector remoteSelector(adapter); remoteSelector.startDiscovery(QBluetoothUuid(serviceUuid)); if (remoteSelector.exec() == QDialog::Accepted) { QBluetoothServiceInfo service = remoteSelector.service(); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chat.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chat.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chat.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chat.h 2014-02-01 20:38:03.000000000 +0000 @@ -44,14 +44,11 @@ #include #include +#include #include -QT_BEGIN_NAMESPACE_BLUETOOTH -class QRfcommServer; -QT_END_NAMESPACE_BLUETOOTH - -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE class ChatServer; class ChatClient; @@ -79,11 +76,16 @@ void clientDisconnected(); void connected(const QString &name); + void newAdapterSelected(); + private: + int adapterFromUserSelection() const; + int currentAdapterIndex; Ui_Chat *ui; ChatServer *server; QList clients; + QList localAdapters; QString localName; }; diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chatserver.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chatserver.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chatserver.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chatserver.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -40,8 +40,9 @@ #include "chatserver.h" -#include +#include #include +#include //! [Service UUID] static const QLatin1String serviceUuid("e8e10f95-1a70-4b27-9ccf-02010264e9c8"); @@ -57,22 +58,31 @@ stopServer(); } -void ChatServer::startServer() +void ChatServer::startServer(const QBluetoothAddress& localAdapter) { if (rfcommServer) return; //! [Create the server] - rfcommServer = new QRfcommServer(this); + rfcommServer = new QBluetoothServer(QBluetoothServiceInfo::RfcommProtocol, this); connect(rfcommServer, SIGNAL(newConnection()), this, SLOT(clientConnected())); - rfcommServer->listen(); + bool result = rfcommServer->listen(localAdapter); + if (!result) { + qWarning() << "Cannot bind chat server to" << localAdapter.toString(); + return; + } //! [Create the server] - serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceRecordHandle, (uint)0x00010010); + //serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceRecordHandle, (uint)0x00010010); //! [Class Uuuid must contain at least 1 entry] QBluetoothServiceInfo::Sequence classId; - classId << QVariant::fromValue(QBluetoothUuid(serviceUuid)); + + classId << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::SerialPort)); + serviceInfo.setAttribute(QBluetoothServiceInfo::BluetoothProfileDescriptorList, + classId); + + classId.prepend(QVariant::fromValue(QBluetoothUuid(serviceUuid))); serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId); //! [Class Uuuid must contain at least 1 entry] @@ -81,7 +91,7 @@ serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceName, tr("Bt Chat Server")); serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceDescription, tr("Example bluetooth chat server")); - serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceProvider, tr("Nokia, QtDF")); + serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceProvider, tr("qt-project.org")); //! [Service name, description and provider] //! [Service UUID set] @@ -107,7 +117,7 @@ //! [Protocol descriptor list] //! [Register service] - serviceInfo.registerService(); + serviceInfo.registerService(localAdapter); //! [Register service] } @@ -146,7 +156,6 @@ connect(socket, SIGNAL(readyRead()), this, SLOT(readSocket())); connect(socket, SIGNAL(disconnected()), this, SLOT(clientDisconnected())); clientSockets.append(socket); - emit clientConnected(socket->peerName()); } //! [clientConnected] diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chatserver.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chatserver.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chatserver.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chatserver.h 2014-02-01 20:38:03.000000000 +0000 @@ -42,16 +42,15 @@ #define CHATSERVER_H #include +#include #include #include -QT_BEGIN_NAMESPACE_BLUETOOTH -class QRfcommServer; -class QBluetoothSocket; -QT_END_NAMESPACE_BLUETOOTH +QT_FORWARD_DECLARE_CLASS(QBluetoothServer) +QT_FORWARD_DECLARE_CLASS(QBluetoothSocket) -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE //! [declaration] class ChatServer : public QObject @@ -62,7 +61,7 @@ explicit ChatServer(QObject *parent = 0); ~ChatServer(); - void startServer(); + void startServer(const QBluetoothAddress &localAdapter = QBluetoothAddress()); void stopServer(); public slots: @@ -79,7 +78,7 @@ void readSocket(); private: - QRfcommServer *rfcommServer; + QBluetoothServer *rfcommServer; QBluetoothServiceInfo serviceInfo; QList clientSockets; }; diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chat.ui qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chat.ui --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/chat.ui 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/chat.ui 2014-02-01 20:38:03.000000000 +0000 @@ -15,6 +15,32 @@ + + + Local Bluetooth Adapter + + + false + + + + + + Default + + + + + + + + + + + + + + Qt::NoFocus diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/doc/src/btchat.qdoc qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/doc/src/btchat.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/doc/src/btchat.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/doc/src/btchat.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -34,36 +34,36 @@ \image btchat-example.png - The Bluetooth Chat example implements a simple chat program between multiple parties. The + The Bluetooth Chat example implements a simple chat program between multiple parties. The application always acts as both a server and a client eliminating the need to determine who should connect to whom. \section1 Chat Server - The chat server is implemented by the ChatServer class. The ChatServer class is declared as: + The chat server is implemented by the ChatServer class. The ChatServer class is declared as: \snippet btchat/chatserver.h declaration The first thing the chat server needs to do is create an instance of QRfcommServer to listen - for incoming Bluetooth connections. Our clientConnected() slot will be called whenever a new + for incoming Bluetooth connections. Our clientConnected() slot will be called whenever a new connection is created. \snippet btchat/chatserver.cpp Create the server - The chat server is only useful if others know that it is there. To enable other devices to - discover it a record describing the service needs to be published in the systems SDP (Service - Discovery Protocol) database. The QBluetoothServiceInfo class encapsulates a service record. + The chat server is only useful if others know that it is there. To enable other devices to + discover it, a record describing the service needs to be published in the systems SDP (Service + Discovery Protocol) database. The QBluetoothServiceInfo class encapsulates a service record. We will publish a service record that contains some textural descriptions of the services, a - UUID that uniquely identifies the service, the discoverability attribute and connection + UUID that uniquely identifies the service, the discoverability attribute, and connection parameters. - The textural description of the service is stored in the ServiceName, ServiceDescription and + The textural description of the service is stored in the ServiceName, ServiceDescription, and ServiceProvider attributes. \snippet btchat/chatserver.cpp Service name, description and provider - Bluetooth uses UUIDs as unique identifiers. Our chat service is uses a randomly generated + Bluetooth uses UUIDs as unique identifiers. The chat service uses a randomly generated UUID. \snippet btchat/chatserver.cpp Service UUID @@ -74,78 +74,78 @@ \snippet btchat/chatserver.cpp Service Discoverability The ProtocolDescriptorList attribute is used to publish the connection parameters that the - remote device requires to connect to our service. Here we specify that the Rfcomm protocol is - used and set the port number to port that our rfcommServer instance is listening to. + remote device requires to connect to our service. Here we specify that the Rfcomm protocol is + used and set the port number to the port that our rfcommServer instance is listening to. \snippet btchat/chatserver.cpp Protocol descriptor list - Finally we register the service record with the system. + Finally, we register the service record with the system. \snippet btchat/chatserver.cpp Register service - As mentioned earlier incoming connections are handled in the clientConnected() slot. In this - slot we get a pointer a QBluetoothSocket representing the next pending connection connect up - slots to the readyRead() and disconnected() signals and emit a signal to notify others that a - new client has connected. + + As mentioned earlier, incoming connections are handled in the clientConnected() slot where + pending connections are connected to the readyRead() and disconnected() signals. The signals + notify others that a new client has connected. \snippet btchat/chatserver.cpp clientConnected - The readSocket() slot is called whenever data is ready to be read from a client socket. The - slot reads individual lines from the socket converts them from UTF-8 and emits the + The readSocket() slot is called whenever data is ready to be read from a client socket. The + slot reads individual lines from the socket, converts them from UTF-8, and emits the messageReceived() signal. \snippet btchat/chatserver.cpp readSocket - The clientDisconnected() slot is called whenever a client disconnects from the service. The - slot emits a signal to notify others that a client has disconnected and deletes the socket. + The clientDisconnected() slot is called whenever a client disconnects from the service. The + slot emits a signal to notify others that a client has disconnected, and deletes the socket. \snippet btchat/chatserver.cpp clientDisconnected - The sendMessage() slot is used to send a message to all connected clients. The message is + The sendMessage() slot is used to send a message to all connected clients. The message is converted into UTF-8 and appended with a newline before being sent to all clients. \snippet btchat/chatserver.cpp sendMessage - When the chat server is stop the service record is removed from the system SDP database, all - connected client sockets are deleted and the QRfcommServer instance is deleted. + When the chat server is stopped the service record is removed from the system SDP database, all + connected client sockets are deleted, and the QRfcommServer instance is deleted. \snippet btchat/chatserver.cpp stopServer \section1 Chat Client - The chat client is implemented by the ChatClient class. The ChatClient class is declared as: + The chat client is implemented by the ChatClient class. The ChatClient class is declared as: \snippet btchat/chatclient.h declaration The client creates a new QBluetoothSocket and connects to the remote service described by the - \e remoteService parameter. Slots are connected to the sockets readyRead(), connected() and + \e remoteService parameter. Slots are connected to the sockets readyRead(), connected() and disconnected() signals. \snippet btchat/chatclient.cpp startClient - On sucessfull socket connection we emit a signal to notify other. + On successful socket connection we emit a signal to notify others. \snippet btchat/chatclient.cpp connected - Similarily to the chat server the readSocket() slot is called when data is available from the - socket. Lines are read individually and converted from UTF-8. The messageReceived() signal + Similarly to the chat server, the readSocket() slot is called when data is available from the + socket. Lines are read individually and converted from UTF-8. The messageReceived() signal is emitted. \snippet btchat/chatclient.cpp readSocket - The sendMessage() slot is used to send a message to the remote device. The message is - converted to UTF-8 and a newline appended. + The sendMessage() slot is used to send a message to the remote device. The message is + converted to UTF-8 and a newline is appended. \snippet btchat/chatclient.cpp sendMessage - To disconnect from the remote chat service the QBluetoothSocket instance is deleted. + To disconnect from the remote chat service, the QBluetoothSocket instance is deleted. \snippet btchat/chatclient.cpp stopClient \section1 Chat Dialog - The main window of this example is the chat dialog, implemented in the Chat class. This class - displays a chat session between a single ChatServer and zero or more ChatClients. The Chat + The main window of this example is the chat dialog, implemented in the Chat class. This class + displays a chat session between a single ChatServer and zero or more ChatClients. The Chat class is declared as: \snippet btchat/chat.h declaration @@ -155,27 +155,27 @@ \snippet btchat/chat.cpp Construct UI We create an instance of the ChatServer and respond to its clientConnected(), - clientDiconnected() and messageReceived() signals. + clientDiconnected(), and messageReceived() signals. \snippet btchat/chat.cpp Create Chat Server - In response to the clientConnected() and clientDisconnected() signals of the ChatServer we - display the typical "foo has joined chat." and "foo has left." messages in the chat session. + In response to the clientConnected() and clientDisconnected() signals of the ChatServer, we + display the typical "X has joined chat." and "Y has left." messages in the chat session. \snippet btchat/chat.cpp clientConnected clientDisconnected Incoming messages from clients connected to the ChatServer are handled in the showMessage() - slot. The message text tagged with the remote device name is displayed in the chat session. + slot. The message text tagged with the remote device name is displayed in the chat session. \snippet btchat/chat.cpp showMessage - In response to the connect button being clicked the application starts service discovery and - presents a list of discovered chat services on remote devices. A ChatClient for the service - selected by the user. + In response to the connect button being clicked, the application starts service discovery and + presents a list of discovered chat services on remote devices. A ChatClient for the service + is selected by the user. \snippet btchat/chat.cpp Connect to remote service - In reponse to connected() signals from ChatClient we display the a "Joined chat with foo." + In reponse to the connected() signals from ChatClient, we display the a "Joined chat with X." message in the chat session. \snippet btchat/chat.cpp connected diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/remoteselector.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/remoteselector.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/remoteselector.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/remoteselector.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,27 +43,32 @@ #include #include +#include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE -RemoteSelector::RemoteSelector(QWidget *parent) -: QDialog(parent), ui(new Ui::RemoteSelector), - m_discoveryAgent(new QBluetoothServiceDiscoveryAgent) +RemoteSelector::RemoteSelector(const QBluetoothAddress &localAdapter, QWidget *parent) +: QDialog(parent), ui(new Ui::RemoteSelector) { ui->setupUi(this); + m_discoveryAgent = new QBluetoothServiceDiscoveryAgent(localAdapter); + connect(m_discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)), this, SLOT(serviceDiscovered(QBluetoothServiceInfo))); connect(m_discoveryAgent, SIGNAL(finished()), this, SLOT(discoveryFinished())); + connect(m_discoveryAgent, SIGNAL(canceled()), this, SLOT(discoveryFinished())); } RemoteSelector::~RemoteSelector() { delete ui; + delete m_discoveryAgent; } void RemoteSelector::startDiscovery(const QBluetoothUuid &uuid) { + ui->status->setText(tr("Scanning...")); if (m_discoveryAgent->isActive()) m_discoveryAgent->stop(); @@ -72,7 +77,6 @@ m_discoveryAgent->setUuidFilter(uuid); m_discoveryAgent->start(); - ui->status->setText(tr("Scanning...")); } void RemoteSelector::stopDiscovery() diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/remoteselector.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/remoteselector.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btchat/remoteselector.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btchat/remoteselector.h 2014-02-01 20:38:03.000000000 +0000 @@ -50,7 +50,7 @@ QT_FORWARD_DECLARE_CLASS(QModelIndex) QT_FORWARD_DECLARE_CLASS(QListWidgetItem) -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE QT_BEGIN_NAMESPACE namespace Ui { @@ -63,7 +63,7 @@ Q_OBJECT public: - explicit RemoteSelector(QWidget *parent = 0); + explicit RemoteSelector(const QBluetoothAddress &localAdapter, QWidget *parent = 0); ~RemoteSelector(); void startDiscovery(const QBluetoothUuid &uuid); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btfiletransfer/btfiletransfer.pro qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btfiletransfer/btfiletransfer.pro --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btfiletransfer/btfiletransfer.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btfiletransfer/btfiletransfer.pro 2014-02-01 20:38:03.000000000 +0000 @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = btfiletransfer -QT += concurrent bluetooth widgets +QT = core bluetooth widgets SOURCES = \ main.cpp \ @@ -25,3 +25,6 @@ RESOURCES += \ btfiletransfer.qrc + +target.path = $$[QT_INSTALL_EXAMPLES]/bluetooth/scanner +INSTALLS += target diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btfiletransfer/progress.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btfiletransfer/progress.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btfiletransfer/progress.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btfiletransfer/progress.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -46,7 +46,7 @@ #include #include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE Progress::Progress(QWidget *parent) : QDialog(parent), diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btfiletransfer/progress.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btfiletransfer/progress.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btfiletransfer/progress.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btfiletransfer/progress.h 2014-02-01 20:38:03.000000000 +0000 @@ -45,11 +45,9 @@ #include #include -QT_BEGIN_NAMESPACE_BLUETOOTH -class QBluetoothTransferReply; -QT_END_NAMESPACE_BLUETOOTH +QT_FORWARD_DECLARE_CLASS(QBluetoothTransferReply) -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE QT_BEGIN_NAMESPACE namespace Ui { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btfiletransfer/remoteselector.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btfiletransfer/remoteselector.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btfiletransfer/remoteselector.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btfiletransfer/remoteselector.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -55,17 +55,32 @@ #include "progress.h" #include "pindisplay.h" -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE RemoteSelector::RemoteSelector(QWidget *parent) : QDialog(parent), ui(new Ui::RemoteSelector), - m_discoveryAgent(new QBluetoothServiceDiscoveryAgent), m_localDevice(new QBluetoothLocalDevice), m_pindisplay(0) + m_localDevice(new QBluetoothLocalDevice), m_pindisplay(0) { ui->setupUi(this); + //Using default Bluetooth adapter + QBluetoothAddress adapterAddress = m_localDevice->address(); + + /* + * In case of multiple Bluetooth adapters it is possible to + * set which adapter will be used by providing MAC Address. + * Example code: + * + * QBluetoothAddress adapterAddress("XX:XX:XX:XX:XX:XX"); + * m_discoveryAgent = new QBluetoothServiceDiscoveryAgent(adapterAddress); + */ + + m_discoveryAgent = new QBluetoothServiceDiscoveryAgent(adapterAddress); + connect(m_discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)), this, SLOT(serviceDiscovered(QBluetoothServiceInfo))); connect(m_discoveryAgent, SIGNAL(finished()), this, SLOT(discoveryFinished())); + connect(m_discoveryAgent, SIGNAL(canceled()), this, SLOT(discoveryFinished())); ui->remoteDevices->setColumnWidth(3, 75); ui->remoteDevices->setColumnWidth(4, 100); @@ -221,10 +236,13 @@ p->show(); QBluetoothTransferReply *reply = mgr.put(req, m_file); + //mgr is default parent + //ensure that mgr doesn't take reply down when leaving scope + reply->setParent(this); if (reply->error()){ qDebug() << "Failed to send file"; - delete reply; p->finished(reply); + reply->deleteLater(); return; } diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btfiletransfer/remoteselector.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btfiletransfer/remoteselector.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btfiletransfer/remoteselector.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btfiletransfer/remoteselector.h 2014-02-01 20:38:03.000000000 +0000 @@ -55,7 +55,7 @@ class pinDisplay; -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE QT_BEGIN_NAMESPACE namespace Ui { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btscanner/btscanner.pro qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btscanner/btscanner.pro --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btscanner/btscanner.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btscanner/btscanner.pro 2014-02-01 20:38:03.000000000 +0000 @@ -1,6 +1,6 @@ TARGET = btscanner -QT += concurrent bluetooth widgets +QT = core bluetooth widgets TEMPLATE = app SOURCES = \ @@ -16,3 +16,5 @@ device.ui \ service.ui +target.path = $$[QT_INSTALL_EXAMPLES]/bluetooth/btscanner +INSTALLS += target diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btscanner/device.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btscanner/device.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btscanner/device.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btscanner/device.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -48,12 +48,22 @@ #include DeviceDiscoveryDialog::DeviceDiscoveryDialog(QWidget *parent) -: QDialog(parent), discoveryAgent(new QBluetoothDeviceDiscoveryAgent), - localDevice(new QBluetoothLocalDevice), +: QDialog(parent), localDevice(new QBluetoothLocalDevice), ui(new Ui_DeviceDiscovery) { ui->setupUi(this); + /* + * In case of multiple Bluetooth adapters it is possible to set adapter + * which will be used. Example code: + * + * QBluetoothAddress address("XX:XX:XX:XX:XX:XX"); + * discoveryAgent = new QBluetoothDeviceDiscoveryAgent(address); + * + **/ + + discoveryAgent = new QBluetoothDeviceDiscoveryAgent(); + connect(ui->inquiryType, SIGNAL(toggled(bool)), this, SLOT(setGeneralUnlimited(bool))); connect(ui->scan, SIGNAL(clicked()), this, SLOT(startScan())); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btscanner/device.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btscanner/device.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btscanner/device.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btscanner/device.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,12 +48,10 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH -class QBluetoothDeviceDiscoveryAgent; -class QBluetoothDeviceInfo; -QT_END_NAMESPACE_BLUETOOTH +QT_FORWARD_DECLARE_CLASS(QBluetoothDeviceDiscoveryAgent) +QT_FORWARD_DECLARE_CLASS(QBluetoothDeviceInfo) -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE class DeviceDiscoveryDialog : public QDialog { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btscanner/service.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btscanner/service.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btscanner/service.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btscanner/service.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,15 +43,32 @@ #include #include #include +#include ServiceDiscoveryDialog::ServiceDiscoveryDialog(const QString &name, const QBluetoothAddress &address, QWidget *parent) -: QDialog(parent), discoveryAgent(new QBluetoothServiceDiscoveryAgent(address)), - ui(new Ui_ServiceDiscovery) +: QDialog(parent), ui(new Ui_ServiceDiscovery) { ui->setupUi(this); + //Using default Bluetooth adapter + QBluetoothLocalDevice localDevice; + QBluetoothAddress adapterAddress = localDevice.address(); + + /* + * In case of multiple Bluetooth adapters it is possible to + * set which adapter will be used by providing MAC Address. + * Example code: + * + * QBluetoothAddress adapterAddress("XX:XX:XX:XX:XX:XX"); + * discoveryAgent = new QBluetoothServiceDiscoveryAgent(adapterAddress); + */ + + discoveryAgent = new QBluetoothServiceDiscoveryAgent(adapterAddress); + + discoveryAgent->setRemoteAddress(address); + setWindowTitle(name); connect(discoveryAgent, SIGNAL(serviceDiscovered(const QBluetoothServiceInfo&)), diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btscanner/service.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btscanner/service.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/btscanner/service.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/btscanner/service.h 2014-02-01 20:38:03.000000000 +0000 @@ -44,16 +44,13 @@ #include "ui_service.h" #include - #include -QT_BEGIN_NAMESPACE_BLUETOOTH -class QBluetoothServiceDiscoveryAgent; -class QBluetoothServiceInfo; -class QBluetoothAddress; -QT_END_NAMESPACE_BLUETOOTH +QT_FORWARD_DECLARE_CLASS(QBluetoothAddress) +QT_FORWARD_DECLARE_CLASS(QBluetoothServiceInfo) +QT_FORWARD_DECLARE_CLASS(QBluetoothServiceDiscoveryAgent) -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE class ServiceDiscoveryDialog : public QDialog { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/bttennis.pro qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/bttennis.pro --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/bttennis.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/bttennis.pro 2014-02-01 20:38:03.000000000 +0000 @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = bttennis -QT += concurrent bluetooth widgets +QT = core bluetooth widgets #QT += nfc SOURCES = \ @@ -28,3 +28,9 @@ RESOURCES += \ tennis.qrc + +OTHER_FILES = \ + connect.png + +target.path = $$[QT_INSTALL_EXAMPLES]/bluetooth/bttennis +INSTALLS += target diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/handover.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/handover.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/handover.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/handover.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,15 +48,12 @@ #include #include -QT_BEGIN_NAMESPACE_NFC -class QNearFieldManager; -class QNearFieldTarget; -class QLlcpServer; -class QLlcpSocket; -QT_END_NAMESPACE_NFC +QT_FORWARD_DECLARE_CLASS(QNearFieldManager) +QT_FORWARD_DECLARE_CLASS(QNearFieldTarget) +QT_FORWARD_DECLARE_CLASS(QLlcpServer) +QT_FORWARD_DECLARE_CLASS(QLlcpSocket) -QT_USE_NAMESPACE_NFC -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE class Handover : public QObject { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennisclient.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennisclient.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennisclient.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennisclient.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -69,7 +69,7 @@ serviceInfo = remoteService; // Connect to service - socket = new QBluetoothSocket(QBluetoothSocket::L2capSocket); + socket = new QBluetoothSocket(QBluetoothServiceInfo::L2capProtocol); qDebug() << "Create socket"; socket->connectToService(remoteService); qDebug() << "ConnecttoService done"; diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennisclient.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennisclient.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennisclient.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennisclient.h 2014-02-01 20:38:03.000000000 +0000 @@ -49,15 +49,10 @@ #include #include -QT_BEGIN_NAMESPACE_BLUETOOTH -class QBluetoothSocket; -QT_END_NAMESPACE_BLUETOOTH +QT_FORWARD_DECLARE_CLASS(QBluetoothSocket) +QT_FORWARD_DECLARE_CLASS(QDataStream) -QT_BEGIN_NAMESPACE -class QDataStream; -QT_END_NAMESPACE - -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE //! [declaration] class TennisClient : public QObject diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennis.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennis.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennis.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennis.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -66,8 +66,8 @@ //#include Tennis::Tennis(QWidget *parent) -: QDialog(parent), ui(new Ui_Tennis), board(new Board), controller(new Controller), socket(0), - m_discoveryAgent(new QBluetoothServiceDiscoveryAgent)//, m_handover(0) +: QDialog(parent), ui(new Ui_Tennis), board(new Board), controller(new Controller), socket(0) + //, m_handover(0) { // start Bluetooth if not started QBluetoothLocalDevice *device = new QBluetoothLocalDevice(); @@ -75,6 +75,21 @@ delete device; device = 0; + //Using default Bluetooth adapter + QBluetoothLocalDevice localDevice; + QBluetoothAddress adapterAddress = localDevice.address(); + + /* + * In case of multiple Bluetooth adapters it is possible to + * set which adapter will be used by providing MAC Address. + * Example code: + * + * QBluetoothAddress adapterAddress("XX:XX:XX:XX:XX:XX"); + * m_discoveryAgent = new QBluetoothServiceDiscoveryAgent(adapterAddress); + */ + + m_discoveryAgent = new QBluetoothServiceDiscoveryAgent(adapterAddress, this); + //! [Construct UI] ui->setupUi(this); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennis.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennis.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennis.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennis.h 2014-02-01 20:38:03.000000000 +0000 @@ -55,11 +55,9 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH -class QBluetoothServiceDiscoveryAgent; -QT_END_NAMESPACE_BLUETOOTH +QT_FORWARD_DECLARE_CLASS(QBluetoothServiceDiscoveryAgent) -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE static const QLatin1String serviceUuid("e8e10f95-1a70-4b27-9ccf-02010264e9c9"); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennisserver.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennisserver.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennisserver.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennisserver.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,7 +42,7 @@ #include "tennisserver.h" #include "tennis.h" -#include +#include #include #include @@ -74,7 +74,7 @@ return; //! [Create the server] - l2capServer = new QL2capServer(this); + l2capServer = new QBluetoothServer(QBluetoothServiceInfo::L2capProtocol, this); connect(l2capServer, SIGNAL(newConnection()), this, SLOT(clientConnected())); l2capServer->listen(); //! [Create the server] diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennisserver.h qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennisserver.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/bttennis/tennisserver.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/bttennis/tennisserver.h 2014-02-01 20:38:03.000000000 +0000 @@ -51,13 +51,11 @@ #include #include -QT_BEGIN_NAMESPACE_BLUETOOTH -class QL2capServer; -class QBluetoothSocket; -class QBluetoothServiceInfo; -QT_END_NAMESPACE_BLUETOOTH +QT_FORWARD_DECLARE_CLASS(QBluetoothServer) +QT_FORWARD_DECLARE_CLASS(QBluetoothSocket) +QT_FORWARD_DECLARE_CLASS(QBluetoothServiceInfo) -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE //! [declaration] class TennisServer : public QObject @@ -92,7 +90,7 @@ void socketError(QBluetoothSocket::SocketError err); private: - QL2capServer *l2capServer; + QBluetoothServer *l2capServer; QBluetoothServiceInfo serviceInfo; QBluetoothSocket *clientSocket; QDataStream *stream; diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/scanner/Button.qml qtconnectivity-opensource-src-5.2.1/examples/bluetooth/scanner/Button.qml --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/scanner/Button.qml 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/scanner/Button.qml 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,79 @@ +/*************************************************************************** +** +** Copyright (C) 2013 BlackBerry Limited. All rights reserved. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the examples of the QtBluetooth module. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + id: button + + property bool active: buttonGroup.activeButton == button + property bool fullDiscovery: false + property alias text: label.text + + signal clicked() + + height: 60 + width: 105 + + color: active ? "#1c56f3" : "white" + + radius: 5 + border.width: 2 + + Text { + id: label + text: "Full Discovery" + font.bold: true + anchors.fill: parent + wrapMode: Text.WordWrap + horizontalAlignment: Text.AlignHCenter + } + + MouseArea { + anchors.fill: parent + onClicked: { + button.clicked() + //Reset the model + btModel.running = false + btModel.running = true + buttonGroup.activeButton = button + } + } +} Binary files /tmp/hwsUnuRqDj/qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/scanner/default.png and /tmp/zQLhvKxBpp/qtconnectivity-opensource-src-5.2.1/examples/bluetooth/scanner/default.png differ diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/scanner/qmlscanner.cpp qtconnectivity-opensource-src-5.2.1/examples/bluetooth/scanner/qmlscanner.cpp --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/scanner/qmlscanner.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/scanner/qmlscanner.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -41,9 +41,11 @@ #include #include #include +#include int main(int argc, char *argv[]) { + //QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true")); QGuiApplication application(argc, argv); const QString mainQmlApp = QLatin1String("qrc:/scanner.qml"); QQuickView view; diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/scanner/scanner.pro qtconnectivity-opensource-src-5.2.1/examples/bluetooth/scanner/scanner.pro --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/scanner/scanner.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/scanner/scanner.pro 2014-02-01 20:38:03.000000000 +0000 @@ -1,4 +1,4 @@ -QT += concurrent network bluetooth quick +QT = core bluetooth quick SOURCES += qmlscanner.cpp TARGET = qml_scanner @@ -8,6 +8,11 @@ scanner.qrc OTHER_FILES += \ - scanner.qml + scanner.qml \ + Button.qml \ + default.png #DEFINES += QMLJSDEBUGGER + +target.path = $$[QT_INSTALL_EXAMPLES]/bluetooth/scanner +INSTALLS += target diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/scanner/scanner.qml qtconnectivity-opensource-src-5.2.1/examples/bluetooth/scanner/scanner.qml --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/scanner/scanner.qml 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/scanner/scanner.qml 2014-02-01 20:38:03.000000000 +0000 @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 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 examples of the QtBluetooth module. @@ -39,7 +40,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtBluetooth 5.0 +import QtBluetooth 5.2 Item { id: top @@ -47,25 +48,29 @@ property BluetoothService currentService BluetoothDiscoveryModel { - id: myModel - minimalDiscovery: true - onDiscoveryChanged: console.log("Discovery mode: " + discovery) - onNewServiceDiscovered: console.log("Found new service " + service.deviceAddress + " " + service.deviceName + " " + service.serviceName); + id: btModel + running: true + discoveryMode: BluetoothDiscoveryModel.DeviceDiscovery + onDiscoveryModeChanged: console.log("Discovery mode: " + discoveryMode) + onServiceDiscovered: console.log("Found new service " + service.deviceAddress + " " + service.deviceName + " " + service.serviceName); + onDeviceDiscovered: console.log("New device: " + device) } Rectangle { id: busy - width: top.width/1.2; - x: top.width/2-width/2 + width: top.width * 0.7; + anchors.horizontalCenter: parent.horizontalCenter anchors.top: top.top; - height: 20; + height: 30; radius: 5 color: "#1c56f3" + visible: btModel.running Text { id: text - text: "Scanning" + text: "Scanning" + font.bold: true anchors.centerIn: parent } @@ -75,163 +80,103 @@ ColorAnimation { easing.type: Easing.InOutSine; to: "#1c56f3"; from: "white"; duration: 1000 } loops: Animation.Infinite } - states: [ - State { - name: "stopped" - when: !myModel.discovery - PropertyChanges { target: busy; height: 0; } - PropertyChanges { target: busyThrobber; running: false } - PropertyChanges { target: busy; visible: false } - } - ] - transitions: [ - Transition { - from: "*" - to: "stopped" - reversible: true - NumberAnimation { property: "height"; to: 0; duration: 200 } - } - ] } - Component { - id: del; - - Item { - id: item - - property int text_height: 5+(bticon.height > bttext.height ? bticon.height : bttext.height) - - height: text_height + ListView { + id: mainList + width: top.width + anchors.top: busy.bottom + anchors.bottom: buttonGroup.top + anchors.bottomMargin: 10 + anchors.topMargin: 10 + clip: true + + model: btModel + delegate: Rectangle { + id: btDelegate width: parent.width + height: column.height + 10 + + property bool expended: false; + clip: true + Image { + id: bticon + source: "qrc:/default.png"; + width: bttext.height; + height: bttext.height; + anchors.top: parent.top + anchors.left: parent.left + anchors.margins: 5 + } Column { - anchors.fill: item - Row { - width: parent.width - Image { - id: bticon - source: icon; - width: del.height; - } - Text { - id: bttext - text: name; - font.family: "FreeSerif" - font.pointSize: 12 - } + id: column + anchors.left: bticon.right + anchors.leftMargin: 5 + Text { + id: bttext + text: name; + font.family: "FreeSerif" + font.pointSize: 12 } + Text { + id: details function get_details(s) { - var str = "Address: " + s.deviceAddress; - if (s.serviceName) { str += "
Service: " + s.serviceName; } - if (s.serviceDescription) { str += "
Description: " + s.serviceDescription; } - if (s.serviceProtocol) { str += "
Port: " + s.serviceProtocol; } - if (s.servicePort) { str += "
Port: " + s.servicePort; } - return str; + if (btModel.discoveryMode == BluetoothDiscoveryModel.DeviceDiscovery) { + //We are doing a device discovery + var str = "Address: " + remoteAddress; + return str; + } else { + var str = "Address: " + s.deviceAddress; + if (s.serviceName) { str += "
Service: " + s.serviceName; } + if (s.serviceDescription) { str += "
Description: " + s.serviceDescription; } + if (s.serviceProtocol) { str += "
Protocol: " + s.serviceProtocol; } + return str; + } } - - id: details - opacity: 0.0 + visible: opacity !== 0 + opacity: btDelegate.expended ? 1 : 0.0 text: get_details(service) font: bttext.font - x: bticon.width + Behavior on opacity { + NumberAnimation { duration: 200} + } } } + Behavior on height { NumberAnimation { duration: 200} } MouseArea { anchors.fill: parent - onClicked: item.state = ((item.state == "details") ? "" : "details") + onClicked: btDelegate.expended = !btDelegate.expended } - - states: [ - State { - name: "details" - PropertyChanges { target: item; height: item.text_height+details.height; } - PropertyChanges { target: details; opacity: 1.0 } - } - ] - transitions: [ - Transition { - from: "*" - to: "details" - reversible: true - NumberAnimation { target: item; property: "height"; duration: 200 } - NumberAnimation { target: details; property: "lopacity"; duration: 200 } - } - ] } - } - - Component { - id: highlightBox - - Rectangle { - id: background - border.color: "#34ca57" - radius: 5 - border.width: 2 - } - } - - ListView { - id: mainList - width: top.width - anchors.top: busy.bottom - anchors.bottom: fullbutton.top - - model: myModel - highlight: highlightBox - delegate: del focus: true } - Rectangle { - id: fullbutton - - function button_clicked() { - myModel.minimalDiscovery = !myModel.minimalDiscovery; - fullbutton.state = fullbutton.state == "clicked" ? "" : "clicked"; - //reset discovery since we changed the discovery mode - myModel.discovery = false; - myModel.discovery = true; - } - - anchors.bottom: top.bottom - anchors.margins: 3 - - width: top.width-6 - x: 3 - height: 20 - - radius: 5 - border.width: 1 - color: "white" + Row { + id: buttonGroup + property var activeButton: devButton + + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + spacing: 20 - Text { - id: label + Button { + id: fdButton text: "Full Discovery" - anchors.centerIn: parent + onClicked: btModel.discoveryMode = BluetoothDiscoveryModel.FullServiceDiscovery } - - MouseArea { - anchors.fill: parent - onClicked: fullbutton.button_clicked(); + Button { + id: mdButton + text: "Minimal Discovery" + onClicked: btModel.discoveryMode = BluetoothDiscoveryModel.MinimalServiceDiscovery + } + Button { + id: devButton + text: "Device Discovery" + onClicked: btModel.discoveryMode = BluetoothDiscoveryModel.DeviceDiscovery } - - states: [ - State { - name: "clicked" - PropertyChanges { target: fullbutton; color: "#1c56f3" } - } - ] - transitions: [ - Transition { - from: "*" - to: "details" - reversible: true - ColorAnimation { duration: 200 } - } - ] } + } diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/scanner/scanner.qrc qtconnectivity-opensource-src-5.2.1/examples/bluetooth/scanner/scanner.qrc --- qtconnectivity-opensource-src-5.0~git20130802/examples/bluetooth/scanner/scanner.qrc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/bluetooth/scanner/scanner.qrc 2014-02-01 20:38:03.000000000 +0000 @@ -1,5 +1,7 @@ scanner.qml + default.png + Button.qml diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/annotatedurl/annotatedurl.h qtconnectivity-opensource-src-5.2.1/examples/nfc/annotatedurl/annotatedurl.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/annotatedurl/annotatedurl.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/nfc/annotatedurl/annotatedurl.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,12 +48,12 @@ QT_FORWARD_DECLARE_CLASS(QUrl) QT_FORWARD_DECLARE_CLASS(QPixmap) -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNearFieldTarget; class QNdefMessage; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE class AnnotatedUrl : public QObject { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/annotatedurl/annotatedurl.pro qtconnectivity-opensource-src-5.2.1/examples/nfc/annotatedurl/annotatedurl.pro --- qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/annotatedurl/annotatedurl.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/nfc/annotatedurl/annotatedurl.pro 2014-02-01 20:38:03.000000000 +0000 @@ -13,3 +13,5 @@ FORMS += mainwindow.ui +target.path = $$[QT_INSTALL_EXAMPLES]/nfc/annotatedurl +INSTALLS += target diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/annotatedurl/doc/src/annotatedurl.qdoc qtconnectivity-opensource-src-5.2.1/examples/nfc/annotatedurl/doc/src/annotatedurl.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/annotatedurl/doc/src/annotatedurl.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/nfc/annotatedurl/doc/src/annotatedurl.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -29,8 +29,8 @@ \example annotatedurl \title Annotated URL Example -The Annotated URL example displays the contents of specifically formated NDEF messages read from -an NFC Tag. The NDEF message should contain a URI record, an optional image/* MIME record and one +The Annotated URL example displays the contents of specifically formatted NDEF messages read from +an NFC Tag. The NDEF message should contain a URI record, an optional image/* MIME record, and one or more localized Text records. \image annotatedurl.png diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/ndefeditor/mainwindow.h qtconnectivity-opensource-src-5.2.1/examples/nfc/ndefeditor/mainwindow.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/ndefeditor/mainwindow.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/nfc/ndefeditor/mainwindow.h 2014-02-01 20:38:03.000000000 +0000 @@ -47,12 +47,12 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNearFieldManager; class QNdefMessage; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE QT_BEGIN_NAMESPACE namespace Ui { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/ndefeditor/mimeimagerecordeditor.h qtconnectivity-opensource-src-5.2.1/examples/nfc/ndefeditor/mimeimagerecordeditor.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/ndefeditor/mimeimagerecordeditor.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/nfc/ndefeditor/mimeimagerecordeditor.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE QT_BEGIN_NAMESPACE namespace Ui { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/ndefeditor/ndefeditor.pro qtconnectivity-opensource-src-5.2.1/examples/nfc/ndefeditor/ndefeditor.pro --- qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/ndefeditor/ndefeditor.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/nfc/ndefeditor/ndefeditor.pro 2014-02-01 20:38:03.000000000 +0000 @@ -21,3 +21,6 @@ textrecordeditor.ui \ urirecordeditor.ui \ mimeimagerecordeditor.ui + +target.path = $$[QT_INSTALL_EXAMPLES]/nfc/ndefeditor +INSTALLS += target diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/ndefeditor/textrecordeditor.h qtconnectivity-opensource-src-5.2.1/examples/nfc/ndefeditor/textrecordeditor.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/ndefeditor/textrecordeditor.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/nfc/ndefeditor/textrecordeditor.h 2014-02-01 20:38:03.000000000 +0000 @@ -51,7 +51,7 @@ } QT_END_NAMESPACE -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE class TextRecordEditor : public QWidget { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/ndefeditor/urirecordeditor.h qtconnectivity-opensource-src-5.2.1/examples/nfc/ndefeditor/urirecordeditor.h --- qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/ndefeditor/urirecordeditor.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/nfc/ndefeditor/urirecordeditor.h 2014-02-01 20:38:03.000000000 +0000 @@ -52,7 +52,7 @@ } QT_END_NAMESPACE -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE class UriRecordEditor : public QWidget { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/poster/doc/src/poster.qdoc qtconnectivity-opensource-src-5.2.1/examples/nfc/poster/doc/src/poster.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/poster/doc/src/poster.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/nfc/poster/doc/src/poster.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -29,8 +29,8 @@ \example poster \title QML Poster Example -The QML Poster example displays the contents of specifically formated NDEF messages read from an -NFC Tag. The NDEF message should contain a URI record, an optional image/* MIME record and one +The QML Poster example displays the contents of specifically formatted NDEF messages read from an +NFC Tag. The NDEF message should contain a URI record, an optional image/* MIME record, and one or more localized Text records. \image qml-poster-example.png diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/poster/poster.pro qtconnectivity-opensource-src-5.2.1/examples/nfc/poster/poster.pro --- qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/poster/poster.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/nfc/poster/poster.pro 2014-02-01 20:38:03.000000000 +0000 @@ -11,3 +11,6 @@ OTHER_FILES += \ poster.qml + +target.path = $$[QT_INSTALL_EXAMPLES]/nfc/poster +INSTALLS += target diff -Nru qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/poster/poster.qml qtconnectivity-opensource-src-5.2.1/examples/nfc/poster/poster.qml --- qtconnectivity-opensource-src-5.0~git20130802/examples/nfc/poster/poster.qml 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/examples/nfc/poster/poster.qml 2014-02-01 20:38:03.000000000 +0000 @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtNfc 5.0 +import QtNfc 5.2 Rectangle { id: root @@ -50,8 +50,8 @@ id: nearfield filter: [ - NdefFilter { type: "urn:nfc:wkt:U"; minimum: 1; maximum: 1 }, - NdefFilter { type: "urn:nfc:wkt:T"; minimum: 1 } + NdefFilter { type: "U"; typeNameFormat: NearFiledRecord.NfcRtd; minimum: 1; maximum: 1 }, + NdefFilter { type: "T"; typeNameFormat: NearFiledRecord.NfcRtd; minimum: 1 } ] onMessageRecordsChanged: { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/adapter_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/adapter_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/adapter_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/adapter_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/bluez/adapter_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/agent_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/agent_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/agent_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/agent_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/bluez/agent_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/device_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/device_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/device_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/device_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/bluez/device_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/manager_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/manager_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/manager_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/manager_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/bluez/manager_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_agent_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_agent_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_agent_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_agent_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/bluez/obex_agent_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_client_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_client_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_client_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_client_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/bluez/obex_client_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_manager_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_manager_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_manager_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_manager_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/bluez/obex_manager_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_transfer_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_transfer_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_transfer_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/obex_transfer_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/bluez/obex_transfer_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/ppshelpers_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/ppshelpers_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/ppshelpers_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/ppshelpers_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qnx/ppshelpers_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothaddress_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothaddress_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothaddress_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothaddress_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothaddress_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothdevicediscoveryagent_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothdevicediscoveryagent_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothdevicediscoveryagent_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothdevicediscoveryagent_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothdevicediscoveryagent_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothdeviceinfo_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothdeviceinfo_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothdeviceinfo_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothdeviceinfo_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothdeviceinfo_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothhostinfo_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothhostinfo_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothhostinfo_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothhostinfo_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothhostinfo_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothlocaldevice_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothlocaldevice_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothlocaldevice_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothlocaldevice_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothlocaldevice_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothserver_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothserver_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothserver_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothserver_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothserver_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothservicediscoveryagent_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothservicediscoveryagent_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothservicediscoveryagent_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothservicediscoveryagent_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothservicediscoveryagent_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothserviceinfo_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothserviceinfo_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothserviceinfo_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothserviceinfo_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothserviceinfo_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothsocket_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothsocket_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothsocket_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothsocket_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothsocket_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_bluez_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_bluez_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_bluez_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_bluez_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothtransferreply_bluez_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothtransferreply_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_qnx_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_qnx_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_qnx_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferreply_qnx_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothtransferreply_qnx_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferrequest_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferrequest_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferrequest_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qbluetoothtransferrequest_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qbluetoothtransferrequest_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qprivatelinearbuffer_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qprivatelinearbuffer_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/qprivatelinearbuffer_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/qprivatelinearbuffer_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/qprivatelinearbuffer_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/servicemap_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/servicemap_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/servicemap_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/servicemap_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/bluez/servicemap_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/service_p.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/service_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/5.2.1/QtBluetooth/private/service_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/5.2.1/QtBluetooth/private/service_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/bluetooth/bluez/service_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/headers.pri qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/headers.pri --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/headers.pri 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/headers.pri 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,4 @@ +SYNCQT.HEADER_FILES = qbluetooth.h qbluetoothaddress.h qbluetoothdevicediscoveryagent.h qbluetoothdeviceinfo.h qbluetoothglobal.h qbluetoothhostinfo.h qbluetoothlocaldevice.h qbluetoothserver.h qbluetoothservicediscoveryagent.h qbluetoothserviceinfo.h qbluetoothsocket.h qbluetoothtransfermanager.h qbluetoothtransferreply.h qbluetoothtransferrequest.h qbluetoothuuid.h ../../include/QtBluetooth/qtbluetoothversion.h ../../include/QtBluetooth/QtBluetooth +SYNCQT.HEADER_CLASSES = ../../include/QtBluetooth/QBluetoothAddress ../../include/QtBluetooth/QBluetoothDeviceDiscoveryAgent ../../include/QtBluetooth/QBluetoothDeviceInfo ../../include/QtBluetooth/QBluetoothHostInfo ../../include/QtBluetooth/QBluetoothLocalDevice ../../include/QtBluetooth/QBluetoothServer ../../include/QtBluetooth/QBluetoothServiceDiscoveryAgent ../../include/QtBluetooth/QBluetoothServiceInfo ../../include/QtBluetooth/QBluetoothSocket ../../include/QtBluetooth/QBluetoothTransferManager ../../include/QtBluetooth/QBluetoothTransferReply ../../include/QtBluetooth/QBluetoothTransferRequest ../../include/QtBluetooth/QBluetoothUuid ../../include/QtBluetooth/QtBluetoothVersion +SYNCQT.PRIVATE_HEADER_FILES = qbluetoothaddress_p.h qbluetoothdevicediscoveryagent_p.h qbluetoothdeviceinfo_p.h qbluetoothhostinfo_p.h qbluetoothlocaldevice_p.h qbluetoothserver_p.h qbluetoothservicediscoveryagent_p.h qbluetoothserviceinfo_p.h qbluetoothsocket_p.h qbluetoothtransferreply_bluez_p.h qbluetoothtransferreply_p.h qbluetoothtransferreply_qnx_p.h qbluetoothtransferrequest_p.h qprivatelinearbuffer_p.h bluez/adapter_p.h bluez/agent_p.h bluez/device_p.h bluez/manager_p.h bluez/obex_agent_p.h bluez/obex_client_p.h bluez/obex_manager_p.h bluez/obex_transfer_p.h bluez/service_p.h bluez/servicemap_p.h qnx/ppshelpers_p.h +SYNCQT.QPA_HEADER_FILES = diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothAddress qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothAddress --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothAddress 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothAddress 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothaddress.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothaddress.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothaddress.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothaddress.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothaddress.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothaddress.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothDeviceDiscoveryAgent qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothDeviceDiscoveryAgent --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothDeviceDiscoveryAgent 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothDeviceDiscoveryAgent 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothdevicediscoveryagent.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothdevicediscoveryagent.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothdevicediscoveryagent.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothdevicediscoveryagent.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothdevicediscoveryagent.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothdevicediscoveryagent.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothDeviceInfo qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothDeviceInfo --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothDeviceInfo 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothDeviceInfo 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothdeviceinfo.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothdeviceinfo.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothdeviceinfo.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothdeviceinfo.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothdeviceinfo.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothdeviceinfo.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothglobal.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothglobal.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothglobal.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothglobal.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothglobal.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetooth.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetooth.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetooth.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetooth.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetooth.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothHostInfo qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothHostInfo --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothHostInfo 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothHostInfo 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothhostinfo.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothhostinfo.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothhostinfo.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothhostinfo.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothhostinfo.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothhostinfo.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothLocalDevice qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothLocalDevice --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothLocalDevice 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothLocalDevice 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothlocaldevice.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothlocaldevice.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothlocaldevice.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothlocaldevice.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothlocaldevice.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothlocaldevice.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothServer qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothServer --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothServer 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothServer 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothserver.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothserver.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothserver.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothserver.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothserver.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothserver.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothServiceDiscoveryAgent qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothServiceDiscoveryAgent --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothServiceDiscoveryAgent 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothServiceDiscoveryAgent 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothservicediscoveryagent.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothservicediscoveryagent.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothservicediscoveryagent.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothservicediscoveryagent.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothservicediscoveryagent.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothservicediscoveryagent.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothServiceInfo qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothServiceInfo --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothServiceInfo 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothServiceInfo 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothserviceinfo.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothserviceinfo.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothserviceinfo.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothserviceinfo.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothserviceinfo.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothserviceinfo.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothSocket qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothSocket --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothSocket 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothSocket 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothsocket.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothsocket.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothsocket.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothsocket.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothsocket.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothsocket.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothTransferManager qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothTransferManager --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothTransferManager 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothTransferManager 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothtransfermanager.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothtransfermanager.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothtransfermanager.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothtransfermanager.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothtransfermanager.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothtransfermanager.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothTransferReply qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothTransferReply --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothTransferReply 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothTransferReply 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothtransferreply.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothtransferreply.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothtransferreply.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothtransferreply.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothtransferreply.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothtransferreply.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothTransferRequest qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothTransferRequest --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothTransferRequest 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothTransferRequest 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothtransferrequest.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothtransferrequest.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothtransferrequest.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothtransferrequest.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothtransferrequest.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothtransferrequest.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothUuid qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothUuid --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QBluetoothUuid 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QBluetoothUuid 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qbluetoothuuid.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothuuid.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothuuid.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qbluetoothuuid.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qbluetoothuuid.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/bluetooth/qbluetoothuuid.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QtBluetooth qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QtBluetooth --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QtBluetooth 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QtBluetooth 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,20 @@ +#ifndef QT_QTBLUETOOTH_MODULE_H +#define QT_QTBLUETOOTH_MODULE_H +#include +#include "qbluetooth.h" +#include "qbluetoothaddress.h" +#include "qbluetoothdevicediscoveryagent.h" +#include "qbluetoothdeviceinfo.h" +#include "qbluetoothglobal.h" +#include "qbluetoothhostinfo.h" +#include "qbluetoothlocaldevice.h" +#include "qbluetoothserver.h" +#include "qbluetoothservicediscoveryagent.h" +#include "qbluetoothserviceinfo.h" +#include "qbluetoothsocket.h" +#include "qbluetoothtransfermanager.h" +#include "qbluetoothtransferreply.h" +#include "qbluetoothtransferrequest.h" +#include "qbluetoothuuid.h" +#include "qtbluetoothversion.h" +#endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QtBluetoothVersion qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QtBluetoothVersion --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/QtBluetoothVersion 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/QtBluetoothVersion 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qtbluetoothversion.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qtbluetoothversion.h qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qtbluetoothversion.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtBluetooth/qtbluetoothversion.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtBluetooth/qtbluetoothversion.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,9 @@ +/* This file was generated by syncqt. */ +#ifndef QT_QTBLUETOOTH_VERSION_H +#define QT_QTBLUETOOTH_VERSION_H + +#define QTBLUETOOTH_VERSION_STR "5.2.1" + +#define QTBLUETOOTH_VERSION 0x050201 + +#endif // QT_QTBLUETOOTH_VERSION_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qllcpserver_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_p_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_p_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_p_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_p_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qllcpserver_p_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_qnx_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_qnx_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_qnx_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_qnx_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qllcpserver_qnx_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_simulator_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_simulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_simulator_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpserver_simulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qllcpserver_simulator_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qllcpsocket_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_p_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_p_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_p_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_p_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qllcpsocket_p_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_qnx_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_qnx_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_qnx_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_qnx_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qllcpsocket_qnx_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_simulator_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_simulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_simulator_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qllcpsocket_simulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qllcpsocket_simulator_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qndefnfcsmartposterrecord_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qndefnfcsmartposterrecord_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qndefnfcsmartposterrecord_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qndefnfcsmartposterrecord_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qndefnfcsmartposterrecord_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qndefrecord_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qndefrecord_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qndefrecord_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qndefrecord_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qndefrecord_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_emulator_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_emulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_emulator_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_emulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldmanager_emulator_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanagerimpl_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanagerimpl_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanagerimpl_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanagerimpl_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldmanagerimpl_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldmanager_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_qnx_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_qnx_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_qnx_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_qnx_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldmanager_qnx_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_simulator_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_simulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_simulator_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanager_simulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldmanager_simulator_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanagervirtualbase_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanagervirtualbase_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanagervirtualbase_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldmanagervirtualbase_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldmanagervirtualbase_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype1_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype1_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype1_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype1_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldtagtype1_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype2_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype2_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype2_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype2_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldtagtype2_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype3_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype3_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype3_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype3_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldtagtype3_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype4_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype4_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype4_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtagtype4_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldtagtype4_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_emulator_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_emulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_emulator_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_emulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldtarget_emulator_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldtarget_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_qnx_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_qnx_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_qnx_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnearfieldtarget_qnx_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnearfieldtarget_qnx_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnxnfceventfilter_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnxnfceventfilter_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnxnfceventfilter_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnxnfceventfilter_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnx/qnxnfceventfilter_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnxnfcmanager_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnxnfcmanager_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qnxnfcmanager_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qnxnfcmanager_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qnx/qnxnfcmanager_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qtlv_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qtlv_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/qtlv_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/qtlv_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/qtlv_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/targetemulator_p.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/targetemulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/5.2.1/QtNfc/private/targetemulator_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/5.2.1/QtNfc/private/targetemulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../../../../src/nfc/targetemulator_p.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/headers.pri qtconnectivity-opensource-src-5.2.1/include/QtNfc/headers.pri --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/headers.pri 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/headers.pri 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,4 @@ +SYNCQT.HEADER_FILES = qndeffilter.h qndefmessage.h qndefnfcsmartposterrecord.h qndefnfctextrecord.h qndefnfcurirecord.h qndefrecord.h qnearfieldmanager.h qnearfieldtarget.h qnfcglobal.h qqmlndefrecord.h ../../include/QtNfc/qtnfcversion.h ../../include/QtNfc/QtNfc +SYNCQT.HEADER_CLASSES = ../../include/QtNfc/QNdefFilter ../../include/QtNfc/QNdefMessage ../../include/QtNfc/QNdefNfcIconRecord ../../include/QtNfc/QNdefNfcSmartPosterRecord ../../include/QtNfc/QNdefNfcTextRecord ../../include/QtNfc/QNdefNfcUriRecord ../../include/QtNfc/QNdefRecord ../../include/QtNfc/QNearFieldManager ../../include/QtNfc/QNearFieldTarget ../../include/QtNfc/QQmlNdefRecord ../../include/QtNfc/QtNfcVersion +SYNCQT.PRIVATE_HEADER_FILES = qllcpserver_p.h qllcpserver_p_p.h qllcpserver_qnx_p.h qllcpserver_simulator_p.h qllcpsocket_p.h qllcpsocket_p_p.h qllcpsocket_qnx_p.h qllcpsocket_simulator_p.h qndefnfcsmartposterrecord_p.h qndefrecord_p.h qnearfieldmanager_emulator_p.h qnearfieldmanager_p.h qnearfieldmanager_qnx_p.h qnearfieldmanager_simulator_p.h qnearfieldmanagerimpl_p.h qnearfieldmanagervirtualbase_p.h qnearfieldtagtype1_p.h qnearfieldtagtype2_p.h qnearfieldtagtype3_p.h qnearfieldtagtype4_p.h qnearfieldtarget_emulator_p.h qnearfieldtarget_p.h qnearfieldtarget_qnx_p.h qtlv_p.h targetemulator_p.h qnx/qnxnfceventfilter_p.h qnx/qnxnfcmanager_p.h +SYNCQT.QPA_HEADER_FILES = diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefFilter qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefFilter --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefFilter 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefFilter 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qndeffilter.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndeffilter.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndeffilter.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndeffilter.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndeffilter.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/nfc/qndeffilter.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefMessage qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefMessage --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefMessage 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefMessage 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qndefmessage.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndefmessage.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndefmessage.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndefmessage.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndefmessage.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/nfc/qndefmessage.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefNfcIconRecord qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefNfcIconRecord --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefNfcIconRecord 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefNfcIconRecord 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qndefnfcsmartposterrecord.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefNfcSmartPosterRecord qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefNfcSmartPosterRecord --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefNfcSmartPosterRecord 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefNfcSmartPosterRecord 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qndefnfcsmartposterrecord.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndefnfcsmartposterrecord.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndefnfcsmartposterrecord.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndefnfcsmartposterrecord.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndefnfcsmartposterrecord.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/nfc/qndefnfcsmartposterrecord.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefNfcTextRecord qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefNfcTextRecord --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefNfcTextRecord 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefNfcTextRecord 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qndefnfctextrecord.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndefnfctextrecord.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndefnfctextrecord.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndefnfctextrecord.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndefnfctextrecord.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/nfc/qndefnfctextrecord.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefNfcUriRecord qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefNfcUriRecord --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefNfcUriRecord 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefNfcUriRecord 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qndefnfcurirecord.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndefnfcurirecord.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndefnfcurirecord.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndefnfcurirecord.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndefnfcurirecord.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/nfc/qndefnfcurirecord.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefRecord qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefRecord --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNdefRecord 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNdefRecord 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qndefrecord.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndefrecord.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndefrecord.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qndefrecord.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/qndefrecord.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/nfc/qndefrecord.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNearFieldManager qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNearFieldManager --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNearFieldManager 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNearFieldManager 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qnearfieldmanager.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qnearfieldmanager.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/qnearfieldmanager.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qnearfieldmanager.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/qnearfieldmanager.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/nfc/qnearfieldmanager.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNearFieldTarget qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNearFieldTarget --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QNearFieldTarget 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QNearFieldTarget 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qnearfieldtarget.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qnearfieldtarget.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/qnearfieldtarget.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qnearfieldtarget.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/qnearfieldtarget.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/nfc/qnearfieldtarget.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qnfcglobal.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/qnfcglobal.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qnfcglobal.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/qnfcglobal.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/nfc/qnfcglobal.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QQmlNdefRecord qtconnectivity-opensource-src-5.2.1/include/QtNfc/QQmlNdefRecord --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QQmlNdefRecord 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QQmlNdefRecord 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qqmlndefrecord.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qqmlndefrecord.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/qqmlndefrecord.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qqmlndefrecord.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/qqmlndefrecord.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "../../src/nfc/qqmlndefrecord.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QtNfc qtconnectivity-opensource-src-5.2.1/include/QtNfc/QtNfc --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QtNfc 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QtNfc 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,15 @@ +#ifndef QT_QTNFC_MODULE_H +#define QT_QTNFC_MODULE_H +#include +#include "qndeffilter.h" +#include "qndefmessage.h" +#include "qndefnfcsmartposterrecord.h" +#include "qndefnfctextrecord.h" +#include "qndefnfcurirecord.h" +#include "qndefrecord.h" +#include "qnearfieldmanager.h" +#include "qnearfieldtarget.h" +#include "qnfcglobal.h" +#include "qqmlndefrecord.h" +#include "qtnfcversion.h" +#endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QtNfcVersion qtconnectivity-opensource-src-5.2.1/include/QtNfc/QtNfcVersion --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/QtNfcVersion 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/QtNfcVersion 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +#include "qtnfcversion.h" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qtnfcversion.h qtconnectivity-opensource-src-5.2.1/include/QtNfc/qtnfcversion.h --- qtconnectivity-opensource-src-5.0~git20130802/include/QtNfc/qtnfcversion.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/include/QtNfc/qtnfcversion.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,9 @@ +/* This file was generated by syncqt. */ +#ifndef QT_QTNFC_VERSION_H +#define QT_QTNFC_VERSION_H + +#define QTNFC_VERSION_STR "5.2.1" + +#define QTNFC_VERSION 0x050201 + +#endif // QT_QTNFC_VERSION_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/LGPL_EXCEPTION.txt qtconnectivity-opensource-src-5.2.1/LGPL_EXCEPTION.txt --- qtconnectivity-opensource-src-5.0~git20130802/LGPL_EXCEPTION.txt 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/LGPL_EXCEPTION.txt 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,22 @@ +Digia Qt LGPL Exception version 1.1 + +As an additional permission to the GNU Lesser General Public License version +2.1, the object code form of a "work that uses the Library" may incorporate +material from a header file that is part of the Library. You may distribute +such object code under terms of your choice, provided that: + (i) the header files of the Library have not been modified; and + (ii) the incorporated material is limited to numerical parameters, data + structure layouts, accessors, macros, inline functions and + templates; and + (iii) you comply with the terms of Section 6 of the GNU Lesser General + Public License version 2.1. + +Moreover, you may apply this exception to a modified version of the Library, +provided that such modification does not involve copying material from the +Library into the modified Library's header files unless such material is +limited to (i) numerical parameters; (ii) data structure layouts; +(iii) accessors; and (iv) small macros, templates and inline functions of +five lines or less in length. + +Furthermore, you are not required to apply this additional permission to a +modified version of the Library. diff -Nru qtconnectivity-opensource-src-5.0~git20130802/LICENSE.FDL qtconnectivity-opensource-src-5.2.1/LICENSE.FDL --- qtconnectivity-opensource-src-5.0~git20130802/LICENSE.FDL 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/LICENSE.FDL 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,450 @@ + GNU Free Documentation License + Version 1.3, 3 November 2008 + + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document "free" in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The "Document", below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as "you". You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML, PostScript or PDF designed for human modification. Examples of +transparent image formats include PNG, XCF and JPG. Opaque formats +include proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML, PostScript or PDF produced by some word +processors for output purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +The "publisher" means any person or entity that distributes copies of +the Document to the public. + +A section "Entitled XYZ" means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as "Acknowledgements", +"Dedications", "Endorsements", or "History".) To "Preserve the Title" +of such a section when you modify the Document means that it remains a +section "Entitled XYZ" according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no +other conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to +give them a chance to provide you with an updated version of the +Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement. +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section Entitled "History", Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section to be Entitled "Endorsements" + or to conflict in title with any Invariant Section. +O. Preserve any Warranty Disclaimers. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled "History" +in the various original documents, forming one section Entitled +"History"; likewise combine any sections Entitled "Acknowledgements", +and any sections Entitled "Dedications". You must delete all sections +Entitled "Endorsements". + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other +documents released under this License, and replace the individual +copies of this License in the various documents with a single copy +that is included in the collection, provided that you follow the rules +of this License for verbatim copying of each of the documents in all +other respects. + +You may extract a single document from such a collection, and +distribute it individually under this License, provided you insert a +copy of this License into the extracted document, and follow this +License in all other respects regarding verbatim copying of that +document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an "aggregate" if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled "Acknowledgements", +"Dedications", or "History", the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions of the +GNU Free Documentation License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +11. RELICENSING + +"Massive Multiauthor Collaboration Site" (or "MMC Site") means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +"Massive Multiauthor Collaboration" (or "MMC") contained in the site +means any set of copyrightable works thus published on the MMC site. + +"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +"Incorporate" means to publish or republish a Document, in whole or in +part, as part of another Document. + +An MMC is "eligible for relicensing" if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole or +in part into the MMC, (1) had no cover texts or invariant sections, and +(2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff -Nru qtconnectivity-opensource-src-5.0~git20130802/LICENSE.GPL qtconnectivity-opensource-src-5.2.1/LICENSE.GPL --- qtconnectivity-opensource-src-5.0~git20130802/LICENSE.GPL 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/LICENSE.GPL 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff -Nru qtconnectivity-opensource-src-5.0~git20130802/LICENSE.LGPL qtconnectivity-opensource-src-5.2.1/LICENSE.LGPL --- qtconnectivity-opensource-src-5.0~git20130802/LICENSE.LGPL 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/LICENSE.LGPL 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,514 @@ + GNU LESSER GENERAL PUBLIC LICENSE + + The Qt Toolkit is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). + Contact: http://www.qt-project.org/legal + + You may use, distribute and copy the Qt GUI Toolkit under the terms of + GNU Lesser General Public License version 2.1, which is displayed below. + +------------------------------------------------------------------------- + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff -Nru qtconnectivity-opensource-src-5.0~git20130802/.qmake.conf qtconnectivity-opensource-src-5.2.1/.qmake.conf --- qtconnectivity-opensource-src-5.0~git20130802/.qmake.conf 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/.qmake.conf 2014-02-01 20:38:03.000000000 +0000 @@ -1,3 +1,4 @@ load(qt_build_config) +CONFIG += qt_example_installs -MODULE_VERSION = 5.2.0 +MODULE_VERSION = 5.2.1 diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/bluetooth.pro qtconnectivity-opensource-src-5.2.1/src/bluetooth/bluetooth.pro --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/bluetooth.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/bluetooth.pro 2014-02-01 20:38:03.000000000 +0000 @@ -17,8 +17,7 @@ qbluetoothdevicediscoveryagent.h\ qbluetoothservicediscoveryagent.h\ qbluetoothsocket.h\ - qrfcommserver.h \ - ql2capserver.h \ + qbluetoothserver.h \ qbluetooth.h \ qbluetoothlocaldevice.h \ qbluetoothtransfermanager.h \ @@ -33,8 +32,7 @@ qbluetoothdevicediscoveryagent_p.h\ qbluetoothservicediscoveryagent_p.h\ qbluetoothsocket_p.h\ - qrfcommserver_p.h \ - ql2capserver_p.h \ + qbluetoothserver_p.h\ qbluetoothtransferreply_p.h \ qbluetoothtransferrequest_p.h \ qprivatelinearbuffer_p.h \ @@ -49,8 +47,7 @@ qbluetoothdevicediscoveryagent.cpp\ qbluetoothservicediscoveryagent.cpp\ qbluetoothsocket.cpp\ - qrfcommserver.cpp \ - ql2capserver.cpp \ + qbluetoothserver.cpp \ qbluetoothlocaldevice.cpp \ qbluetooth.cpp \ qbluetoothtransfermanager.cpp \ @@ -71,14 +68,12 @@ qbluetoothdevicediscoveryagent_bluez.cpp\ qbluetoothservicediscoveryagent_bluez.cpp \ qbluetoothsocket_bluez.cpp \ - qrfcommserver_bluez.cpp \ + qbluetoothserver_bluez.cpp \ qbluetoothlocaldevice_bluez.cpp \ - qbluetoothtransferreply_bluez.cpp \ - qbluetoothtransfermanager_bluez.cpp \ - ql2capserver_bluez.cpp + qbluetoothtransferreply_bluez.cpp -} else:qnx{ - DEFINES += QTM_QNX_BLUETOOTH #BT_BBPPSDEBUG +} else:CONFIG(blackberry) { + DEFINES += QT_QNX_BLUETOOTH include(qnx/qnx.pri) @@ -91,9 +86,7 @@ qbluetoothserviceinfo_qnx.cpp \ qbluetoothservicediscoveryagent_qnx.cpp \ qbluetoothsocket_qnx.cpp \ - ql2capserver_p.cpp \ - qrfcommserver_qnx.cpp \ - qbluetoothtransfermanager_qnx.cpp \ + qbluetoothserver_qnx.cpp \ qbluetoothtransferreply_qnx.cpp } else { @@ -105,9 +98,7 @@ qbluetoothserviceinfo_p.cpp \ qbluetoothservicediscoveryagent_p.cpp \ qbluetoothsocket_p.cpp \ - ql2capserver_p.cpp \ - qrfcommserver_p.cpp \ - qbluetoothtransfermanager_p.cpp + qbluetoothserver_p.cpp } diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/qtbluetooth.qdocconf qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/qtbluetooth.qdocconf --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/qtbluetooth.qdocconf 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/qtbluetooth.qdocconf 2014-02-01 20:38:03.000000000 +0000 @@ -2,7 +2,7 @@ project = QtBluetooth description = Qt Bluetooth Reference Documentation -url = http://qt-project.org/doc/qt-$QT_VER/qtbluetooth +url = http://qt-project.org/doc/qt-$QT_VER version = $QT_VERSION examplesinstallpath = bluetooth diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,7 +43,7 @@ //! [include] //! [namespace] -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE //! [namespace] //! [turningon] diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/snippets/doc_src_qtbluetooth.qml qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/snippets/doc_src_qtbluetooth.qml --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/snippets/doc_src_qtbluetooth.qml 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/snippets/doc_src_qtbluetooth.qml 2014-02-01 20:38:03.000000000 +0000 @@ -39,7 +39,7 @@ ****************************************************************************/ //! [import] -import QtBluetooth 5.0 +import QtBluetooth 5.2 //! [import] //! [service] diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/src/bluetooth-cpp.qdoc qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/src/bluetooth-cpp.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/src/bluetooth-cpp.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/src/bluetooth-cpp.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -29,9 +29,10 @@ \module QtBluetooth \title Qt Bluetooth C++ Classes -\brief An API enabling basic Bluetooth operations like scanning for devices -and connecting them. +\brief Enables basic Bluetooth operations like scanning for devices and connecting them. \ingroup modules +\qtvariable bluetooth +\since 5.2 The \l{Qt Bluetooth} C++ API enables an application to scan for devices and diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/src/bluetooth-overview.qdoc qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/src/bluetooth-overview.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/src/bluetooth-overview.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/src/bluetooth-overview.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -59,7 +59,7 @@ \section1 Scanning for Bluetooth Devices Similar to the QBluetoothLocalDevice, the API offers QBluetoothDeviceInfo which provides - that information for remote devices. While you can just create QBluetoothDeviceInfo objects on + that information for remote devices. Although you can just create QBluetoothDeviceInfo objects on your own and fill them with data, the easier way is to use the QBluetoothDeviceDiscoveryAgent to start an automated search for visible Bluetooth devices within the connectable range. @@ -69,7 +69,7 @@ Once the desired device is found, there are two main use cases provided by Qt Bluetooth. The simpler is to send files via the Obex Object Push Profile (OPP). As the name describes, this - profile can only push files from one device to another but not pull files or browse the remote + profile can only push files from one device to another, but not pull files or browse the remote file system. Because of this limitation, this profile does not require the two devices to be paired before exchanging data. To push files to remote devices, create a QBluetoothTransferRequest and ask the QBluetoothTransferManager to push the file contained in @@ -79,7 +79,7 @@ \section1 Exchanging Data Between Devices - The more flexible approach to do communication between two Bluetooth enabled devices, is to + The more flexible approach for communication between two Bluetooth enabled devices, is to create a virtual serial port connection and freely exchange data over that connection. This can be done by the Serial Port Profile (SPP). The Serial Port Profile emulates a serial connection over the Bluetooth transport protocol RFCOMM. @@ -95,7 +95,7 @@ \snippet btchat/chatclient.cpp startClient Using such a connection allows to exchange any form of data in both directions. - It is perfectly suited for use cases like gaming or syncing the state between two instances of + It is perfectly suited for gaming or for syncing the state between two instances of an application on two devices. For more detailed descriptions on how to configure the server and client, please refer to the detailed description sections in the QRfcommServer and QBluetoothSocket classes. A good example to start with SPP is the \l{btchat}{Bluetooth Chat} diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/src/bluetooth-qml.qdoc qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/src/bluetooth-qml.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/src/bluetooth-qml.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/src/bluetooth-qml.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -28,13 +28,13 @@ /*! -\qmlmodule QtBluetooth 5.0 +\qmlmodule QtBluetooth 5.2 \title Qt Bluetooth QML Types \ingroup qmlmodules -\brief Provides QML types for basic Bluetooth operations on devices +\brief Provides QML types for basic Bluetooth operations on devices. -The Qt Bluetooth QML Types enable an application to scan for devices and connect and -interact with them in an easier way than the C++ Classes. However, it is a bit +The Qt Bluetooth QML Types enable an application to scan for devices and connect +and interact with them in an easier way than the C++ Classes. However, it is a bit more limited than the C++ API. You can always use the C++ API to create QML plugins with the flexibility you need. diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/src/examples.qdoc qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/src/examples.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/doc/src/examples.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/doc/src/examples.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -29,12 +29,15 @@ \ingroup all-examples \page bluetooth-examples.html \title Qt Bluetooth Examples - \brief Examples for the QtBluetooth module + \brief Examples for the Qt Bluetooth module. - This is a variety of examples that cover the entire range of the the Qt Bluetooth API. You will find them in their own documentation but are also accessible from here. + This is a variety of examples that cover the entire range of the the Qt + Bluetooth API. You will find them in their own documentation but they are also + accessible from here. \section2 C++ Tutorial - The \l{btchat}{Bluetooth Chat} example contains a tutorial on how to use the C++ API to create a RFCOMM server and client and exchange data between them. + The \l{btchat}{Bluetooth Chat} example contains a tutorial on how to use the + C++ API to create a RFCOMM server and client, and exchange data between them. \section2 C++ Examples \table 80% @@ -60,8 +63,8 @@ \li Description \row \li \l{bttennis}{QML Bluetooth Tennis} - \li The tennis game using a QML interface to the Bluetooth API. It must connect to an - instance of the C++ \l{bttennis}{Bluetooth Tennis} game to play. + \li The tennis game using a QML interface to the Bluetooth API. It + must connect to an instance of the C++ \l{bttennis}{Bluetooth Tennis} game to play. \row \li \l{btscanner}{QML Bluetooth Scanner} \li A QML implementation of the Bluetooth device scanner. diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothaddress.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothaddress.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothaddress.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothaddress.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,7 +42,7 @@ #include "qbluetoothaddress.h" #include "qbluetoothaddress_p.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE /*! \class QBluetoothAddress @@ -216,4 +216,4 @@ m_address = 0; } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothaddress.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothaddress.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothaddress.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothaddress.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothAddressPrivate; @@ -79,8 +79,8 @@ QBluetoothAddressPrivate *d_ptr; }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE -Q_DECLARE_METATYPE(QtBluetooth::QBluetoothAddress) +Q_DECLARE_METATYPE(QBluetoothAddress) #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothaddress_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothaddress_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothaddress_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothaddress_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -44,7 +44,7 @@ #include "qbluetoothaddress.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothAddressPrivate { @@ -56,6 +56,6 @@ }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetooth.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetooth.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetooth.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetooth.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -39,9 +39,10 @@ ** ****************************************************************************/ +#include #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE namespace QBluetooth { @@ -76,4 +77,8 @@ */ } -QT_END_NAMESPACE_BLUETOOTH +Q_LOGGING_CATEGORY(QT_BT, "qt.bluetooth") +Q_LOGGING_CATEGORY(QT_BT_BLUEZ, "qt.bluetooth.bluez") +Q_LOGGING_CATEGORY(QT_BT_QNX, "qt.bluetooth.qnx") + +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include #include "qbluetoothdevicediscoveryagent.h" #include "qbluetoothdevicediscoveryagent_p.h" #include "qbluetoothaddress.h" @@ -48,12 +49,13 @@ #include "bluez/adapter_p.h" #include "bluez/device_p.h" -//#define QT_DEVICEDISCOVERY_DEBUG +QT_BEGIN_NAMESPACE -QT_BEGIN_NAMESPACE_BLUETOOTH +Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ) -QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate() - : lastError(QBluetoothDeviceDiscoveryAgent::NoError), pendingCancel(false), pendingStart(false), adapter(0) +QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(const QBluetoothAddress &deviceAdapter) + : lastError(QBluetoothDeviceDiscoveryAgent::NoError), m_adapterAddress(deviceAdapter), pendingCancel(false), pendingStart(false), + adapter(0) { manager = new OrgBluezManagerInterface(QLatin1String("org.bluez"), QLatin1String("/"), QDBusConnection::systemBus()); @@ -83,15 +85,18 @@ } discoveredDevices.clear(); + QDBusPendingReply reply; - QDBusPendingReply reply = manager->DefaultAdapter(); + if (m_adapterAddress.isNull()) + reply = manager->DefaultAdapter(); + else + reply = manager->FindAdapter(m_adapterAddress.toString()); reply.waitForFinished(); + if (reply.isError()) { errorString = reply.error().message(); -#ifdef QT_DEVICEDISCOVERY_DEBUG - qDebug() << Q_FUNC_INFO << "ERROR: " << errorString; -#endif - lastError = QBluetoothDeviceDiscoveryAgent::IOFailure; + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO << "ERROR: " << errorString; + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; Q_Q(QBluetoothDeviceDiscoveryAgent); emit q->error(lastError); return; @@ -109,11 +114,9 @@ QDBusPendingReply propertiesReply = adapter->GetProperties(); propertiesReply.waitForFinished(); if(propertiesReply.isError()) { -#ifdef QT_DEVICEDISCOVERY_DEBUG - qDebug() << Q_FUNC_INFO << "ERROR: " << errorString; -#endif errorString = propertiesReply.error().message(); - lastError = QBluetoothDeviceDiscoveryAgent::IOFailure; + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO << "ERROR: " << errorString; + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; Q_Q(QBluetoothDeviceDiscoveryAgent); emit q->error(lastError); return; @@ -124,12 +127,10 @@ delete adapter; adapter = 0; errorString = discoveryReply.error().message(); - lastError = QBluetoothDeviceDiscoveryAgent::IOFailure; + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; Q_Q(QBluetoothDeviceDiscoveryAgent); emit q->error(lastError); -#ifdef QT_DEVICEDISCOVERY_DEBUG - qDebug() << Q_FUNC_INFO << "ERROR: " << errorString; -#endif + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO << "ERROR: " << errorString; return; } } @@ -137,9 +138,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::stop() { if (adapter) { -#ifdef QT_DEVICEDISCOVERY_DEBUG - qDebug() << Q_FUNC_INFO; -#endif + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO; pendingCancel = true; pendingStart = false; QDBusPendingReply<> reply = adapter->StopDiscovery(); @@ -154,13 +153,11 @@ const QString btName = dict.value(QLatin1String("Name")).toString(); quint32 btClass = dict.value(QLatin1String("Class")).toUInt(); -#ifdef QT_DEVICEDISCOVERY_DEBUG - qDebug() << "Discovered: " << address << btName + qCDebug(QT_BT_BLUEZ) << "Discovered: " << address << btName << "Num UUIDs" << dict.value(QLatin1String("UUIDs")).toStringList().count() << "total device" << discoveredDevices.count() << "cached" << dict.value(QLatin1String("Cached")).toBool() << "RSSI" << dict.value(QLatin1String("RSSI")).toInt(); -#endif QBluetoothDeviceInfo device(btAddress, btName, btClass); if(dict.value(QLatin1String("RSSI")).isValid()) @@ -174,24 +171,18 @@ for(int i = 0; i < discoveredDevices.size(); i++){ if(discoveredDevices[i].address() == device.address()) { if(discoveredDevices[i] == device) { -#ifdef QT_DEVICEDISCOVERY_DEBUG - qDebug() << "Duplicate: " << address; -#endif + qCDebug(QT_BT_BLUEZ) << "Duplicate: " << address; return; } discoveredDevices.replace(i, device); Q_Q(QBluetoothDeviceDiscoveryAgent); -#ifdef QT_DEVICEDISCOVERY_DEBUG - qDebug() << "Updated: " << address; -#endif + qCDebug(QT_BT_BLUEZ) << "Updated: " << address; emit q->deviceDiscovered(device); return; // this works if the list doesn't contain duplicates. Don't let it. } } -#ifdef QT_DEVICEDISCOVERY_DEBUG - qDebug() << "Emit: " << address; -#endif + qCDebug(QT_BT_BLUEZ) << "Emit: " << address; discoveredDevices.append(device); Q_Q(QBluetoothDeviceDiscoveryAgent); emit q->deviceDiscovered(device); @@ -200,9 +191,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_propertyChanged(const QString &name, const QDBusVariant &value) { -#ifdef QT_DEVICEDISCOVERY_DEBUG - qDebug() << Q_FUNC_INFO << name << value.variant(); -#endif + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO << name << value.variant(); if (name == QLatin1String("Discovering") && !value.variant().toBool()) { Q_Q(QBluetoothDeviceDiscoveryAgent); @@ -223,4 +212,4 @@ } } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,7 +42,7 @@ #include "qbluetoothdevicediscoveryagent.h" #include "qbluetoothdevicediscoveryagent_p.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE /*! \class QBluetoothDeviceDiscoveryAgent @@ -69,8 +69,8 @@ Indicates all possible error conditions found during Bluetooth device discovery. \value NoError No error has occurred. - \value PoweredOff The Bluetooth adaptor is powered off, power it on before doing discovery. - \value IOFailure Writing or reading from the device resulted in an error. + \value PoweredOffError The Bluetooth adaptor is powered off, power it on before doing discovery. + \value InputOutputError Writing or reading from the device resulted in an error. \value UnknownError An unknown error has occurred. */ @@ -128,7 +128,18 @@ Constructs a new Bluetooth device discovery agent with parent \a parent. */ QBluetoothDeviceDiscoveryAgent::QBluetoothDeviceDiscoveryAgent(QObject *parent) -: QObject(parent), d_ptr(new QBluetoothDeviceDiscoveryAgentPrivate) + : QObject(parent), d_ptr(new QBluetoothDeviceDiscoveryAgentPrivate(QBluetoothAddress())) +{ + d_ptr->q_ptr = this; +} + +/*! + Constructs a new Bluetooth device discovery agent with parent \a parent and uses the adapter \a deviceAdapter + for the device search. If \a deviceAdapter is default constructed the resulting + QBluetoothDeviceDiscoveryAgent object will use the local default Bluetooth adapter. +*/ +QBluetoothDeviceDiscoveryAgent::QBluetoothDeviceDiscoveryAgent(const QBluetoothAddress &deviceAdapter, QObject *parent) + : QObject(parent), d_ptr(new QBluetoothDeviceDiscoveryAgentPrivate(deviceAdapter)) { d_ptr->q_ptr = this; } @@ -228,5 +239,5 @@ #include "moc_qbluetoothdevicediscoveryagent.cpp" -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,9 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH +#include + +QT_BEGIN_NAMESPACE class QBluetoothDeviceDiscoveryAgentPrivate; @@ -62,17 +64,18 @@ // FIXME: add bluez error handling enum Error { NoError, - IOFailure, - PoweredOff, - UnknownError = 100 + InputOutputError, + PoweredOffError, + UnknownError = 100 //New errors must be added before Unknown error }; enum InquiryType { GeneralUnlimitedInquiry, - LimitedInquiry, + LimitedInquiry }; QBluetoothDeviceDiscoveryAgent(QObject *parent = 0); + explicit QBluetoothDeviceDiscoveryAgent(const QBluetoothAddress &deviceAdapter, QObject *parent = 0); ~QBluetoothDeviceDiscoveryAgent(); QBluetoothDeviceDiscoveryAgent::InquiryType inquiryType() const; @@ -105,6 +108,6 @@ #endif }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -46,12 +46,13 @@ #define QT_DEVICEDISCOVERY_DEBUG -QT_BEGIN_NAMESPACE_BLUETOOTH - -QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate() +QT_BEGIN_NAMESPACE +QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(const QBluetoothAddress &deviceAdapter) { + Q_UNUSED(deviceAdapter); inquiryType = QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry; + lastError = QBluetoothDeviceDiscoveryAgent::NoError; } QBluetoothDeviceDiscoveryAgentPrivate::~QBluetoothDeviceDiscoveryAgentPrivate() @@ -66,9 +67,9 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start() { Q_Q(QBluetoothDeviceDiscoveryAgent); - lastError = QBluetoothDeviceDiscoveryAgent::IOFailure; - errorString = QStringLiteral("No Bluetooth device available"); - emit q->error(QBluetoothDeviceDiscoveryAgent::IOFailure); + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; + errorString = QBluetoothDeviceDiscoveryAgent::tr("No Bluetooth device available"); + emit q->error(QBluetoothDeviceDiscoveryAgent::InputOutputError); } void QBluetoothDeviceDiscoveryAgentPrivate::stop() @@ -90,4 +91,4 @@ } #endif -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -46,6 +46,10 @@ #include +#include + +#include + #ifdef QT_BLUEZ_BLUETOOTH class OrgBluezManagerInterface; class OrgBluezAdapterInterface; @@ -53,15 +57,15 @@ QT_BEGIN_NAMESPACE class QDBusVariant; QT_END_NAMESPACE -#elif defined(QTM_QNX_BLUETOOTH) +#elif defined(QT_QNX_BLUETOOTH) #include "qnx/ppshelpers_p.h" #include #endif -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothDeviceDiscoveryAgentPrivate -#if defined(QTM_QNX_BLUETOOTH) +#if defined(QT_QNX_BLUETOOTH) : public QObject { Q_OBJECT #else @@ -69,7 +73,7 @@ #endif Q_DECLARE_PUBLIC(QBluetoothDeviceDiscoveryAgent) public: - QBluetoothDeviceDiscoveryAgentPrivate(); + QBluetoothDeviceDiscoveryAgentPrivate(const QBluetoothAddress &deviceAdapter); ~QBluetoothDeviceDiscoveryAgentPrivate(); void start(); @@ -88,34 +92,41 @@ QBluetoothDeviceDiscoveryAgent::Error lastError; QString errorString; +#ifdef QT_BLUEZ_BLUETOOTH + QBluetoothAddress m_adapterAddress; bool pendingCancel; bool pendingStart; - -#ifdef QT_BLUEZ_BLUETOOTH OrgBluezManagerInterface *manager; OrgBluezAdapterInterface *adapter; -#elif defined(QTM_QNX_BLUETOOTH) +#elif defined(QT_QNX_BLUETOOTH) private Q_SLOTS: void finished(); void remoteDevicesChanged(int); void controlReply(ppsResult result); void controlEvent(ppsResult result); + void startDeviceSearch(); private: - void abort(); - QSocketNotifier *m_rdNotifier; QTimer m_finishedTimer; - bool m_controlRegistered; - int m_rdfd; + bool m_active; + enum Ops{ + None, + Cancel, + Start + }; + Ops m_nextOp; + Ops m_currentOp; + void processNextOp(); + bool isFinished; #endif QBluetoothDeviceDiscoveryAgent *q_ptr; }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -47,81 +47,113 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE -QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(): - QObject(0), lastError(QBluetoothDeviceDiscoveryAgent::NoError), pendingCancel(false), pendingStart(false), m_rdfd(-1) -{ +QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(const QBluetoothAddress &deviceAdapter): + QObject(0), lastError(QBluetoothDeviceDiscoveryAgent::NoError), + m_rdfd(-1), m_active(false), m_nextOp(None), m_currentOp(None) +{ + Q_UNUSED(deviceAdapter); + inquiryType = QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry; + ppsRegisterControl(); + ppsRegisterForEvent(QStringLiteral("device_added"), this); + ppsRegisterForEvent(QStringLiteral("device_search"), this); + connect(&m_finishedTimer, SIGNAL(timeout()), this, SLOT(finished())); } QBluetoothDeviceDiscoveryAgentPrivate::~QBluetoothDeviceDiscoveryAgentPrivate() { - if (pendingStart) + if (m_active) stop(); - - ppsUnreguisterForEvent(QStringLiteral("device_added"), this); - ppsUnreguisterForEvent(QStringLiteral("device_search"), this); + ppsUnregisterForEvent(QStringLiteral("device_added"), this); + ppsUnregisterForEvent(QStringLiteral("device_search"), this); + ppsUnregisterControl(this); } bool QBluetoothDeviceDiscoveryAgentPrivate::isActive() const { - return pendingStart; + return m_active; } void QBluetoothDeviceDiscoveryAgentPrivate::start() { - qBBBluetoothDebug() << "Starting device discovery"; Q_Q(QBluetoothDeviceDiscoveryAgent); - if (pendingStart) - return; - pendingStart = true; + m_active = true; + isFinished = false; discoveredDevices.clear(); - if (m_rdfd != -1 || (m_rdfd = qt_safe_open("/pps/services/bluetooth/remote_devices/.all", O_RDONLY)) == -1) { - qWarning() << Q_FUNC_INFO << "rdfd - failed to open /pps/services/bluetooth/remote_devices/.all"; - lastError = QBluetoothDeviceDiscoveryAgent::IOFailure; + if (m_currentOp == Cancel) { + m_nextOp = Start; + return; + } + if (m_nextOp == Cancel) { + m_nextOp = None; + } + m_currentOp = Start; + + if (m_rdfd != -1) { + qCDebug(QT_BT_QNX) << "RDev FD still open"; + } else if ((m_rdfd = qt_safe_open("/pps/services/bluetooth/remote_devices/.all", O_RDONLY)) == -1) { + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "rdfd - failed to open /pps/services/bluetooth/remote_devices/.all" + << m_rdfd; + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; + errorString = QBluetoothDeviceDiscoveryAgent::tr("Cannot open remote device socket"); emit q->error(lastError); stop(); return; } else { m_rdNotifier = new QSocketNotifier(m_rdfd, QSocketNotifier::Read, this); - if (m_rdNotifier) { - connect(m_rdNotifier, SIGNAL(activated(int)), this, SLOT(remoteDevicesChanged(int))); - } else { - qWarning() << Q_FUNC_INFO << "failed to connect to m_rdNotifier"; - lastError = QBluetoothDeviceDiscoveryAgent::IOFailure; + if (!m_rdNotifier) { + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "failed to connect to m_rdNotifier"; + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; + errorString = QBluetoothDeviceDiscoveryAgent::tr("Cannot connect to Bluetooth socket notifier"); emit q->error(lastError); stop(); return; } } - //If there is no new results after 7 seconds, the device inquire will be stopped - m_finishedTimer.start(7000); - connect(&m_finishedTimer, SIGNAL(timeout()), this, SLOT(finished())); - - if (!m_controlRegistered) { - ppsRegisterControl(); - m_controlRegistered = true; + if (ppsSendControlMessage("device_search", this)) { + //If there is no new results after 7 seconds, the device inquire will be stopped + m_finishedTimer.start(10000); + connect(m_rdNotifier, SIGNAL(activated(int)), this, SLOT(remoteDevicesChanged(int))); + } else { + qCWarning(QT_BT_QNX) << "Could not write to control FD"; + m_active = false; + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; + errorString = QBluetoothDeviceDiscoveryAgent::tr("Cannot start device inquiry"); + q->error(QBluetoothDeviceDiscoveryAgent::InputOutputError); + return; } - - ppsSendControlMessage("device_search", this); - ppsRegisterForEvent(QStringLiteral("device_added"), this); - - ppsRegisterForEvent(QStringLiteral("device_search"), this); } void QBluetoothDeviceDiscoveryAgentPrivate::stop() { - Q_Q(QBluetoothDeviceDiscoveryAgent); - qBBBluetoothDebug() << "Stopping device search"; + m_active = false; + m_finishedTimer.stop(); + if (m_currentOp == Start) { + m_nextOp = Cancel; + return; + } + m_currentOp = Cancel; + + qCDebug(QT_BT_QNX) << "Stopping device search"; ppsSendControlMessage("cancel_device_search",this); - emit q->canceled(); - abort(); + + if (m_rdNotifier) { + delete m_rdNotifier; + m_rdNotifier = 0; + } + if (m_rdfd != -1) { + qt_safe_close(m_rdfd); + m_rdfd = -1; + } } void QBluetoothDeviceDiscoveryAgentPrivate::remoteDevicesChanged(int fd) { + if (!m_active) + return; pps_decoder_t ppsDecoder; pps_decoder_initialize(&ppsDecoder, NULL); @@ -146,9 +178,11 @@ QBluetoothDeviceInfo deviceInfo(deviceAddr, deviceName, cod); deviceInfo.setRssi(rssi); + bool updated = false; //Prevent a device from beeing listed twice for (int i=0; i < discoveredDevices.size(); i++) { if (discoveredDevices.at(i).address() == deviceInfo.address()) { + updated = true; if (discoveredDevices.at(i) == deviceInfo) { return; } else { @@ -159,71 +193,87 @@ } //Starts the timer again m_finishedTimer.start(7000); - if (!deviceAddr.isNull()) { + qCDebug(QT_BT_QNX) << "Device discovered: " << deviceName << deviceAddr.toString(); discoveredDevices.append(deviceInfo); - qBBBluetoothDebug() << "Device discovered: " << deviceName << deviceAddr.toString(); - emit q_ptr->deviceDiscovered(discoveredDevices.last()); + if (!updated)//We are not allowed to emit a signal with the updated version + emit q_ptr->deviceDiscovered(discoveredDevices.last()); } } void QBluetoothDeviceDiscoveryAgentPrivate::controlReply(ppsResult result) { - if (result.msg == QStringLiteral("device_search")) { + Q_Q(QBluetoothDeviceDiscoveryAgent); + if (result.msg == QStringLiteral("device_search") && m_currentOp == Start) { if (result.dat.size() > 0 && result.dat.first() == QStringLiteral("EOK")) { //Do nothing. We can not be certain, that the device search is over yet - } - else { - qWarning() << "A PPS Bluetooth error occured:" << result.errorMsg; - q_ptr->error(QBluetoothDeviceDiscoveryAgent::UnknownError); - lastError = QBluetoothDeviceDiscoveryAgent::UnknownError; + } else if (result.error == 16) { + qCDebug(QT_BT_QNX) << "Could not start device inquire bc resource is busy"; + if (m_nextOp == None) { //We try again + ppsSendControlMessage("cancel_device_search",this); + QTimer::singleShot(5000, this, SLOT(startDeviceSearch())); + m_finishedTimer.start(20000); + } + return; + } else { + qCWarning(QT_BT_QNX) << "A PPS Bluetooth error occurred:"; + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; errorString = result.errorMsg; + Q_EMIT q_ptr->error(QBluetoothDeviceDiscoveryAgent::InputOutputError); stop(); } - } else if (result.msg == QStringLiteral("cancel_device_search")) { - qBBBluetoothDebug() << "Cancel device search"; - if (result.error == 16) { - qWarning() << Q_FUNC_INFO << "Resource is busy. Is Bluetooth enabled?"; - lastError = QBluetoothDeviceDiscoveryAgent::PoweredOff; - errorString = result.errorMsg; - } - //stop(); + processNextOp(); + } else if (result.msg == QStringLiteral("cancel_device_search") && m_currentOp == Cancel && !isFinished) { + qCDebug(QT_BT_QNX) << "Cancel device search"; +// if (!result.errorMsg.isEmpty()) { +// lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; +// errorString = result.errorMsg; +// q_ptr->error(QBluetoothDeviceDiscoveryAgent::InputOutputError); +// } + emit q->canceled(); + processNextOp(); } } void QBluetoothDeviceDiscoveryAgentPrivate::controlEvent(ppsResult result) { if (result.msg == QStringLiteral("device_added")) { - qBBBluetoothDebug() << "Device was added" << result.dat.first(); + qCDebug(QT_BT_QNX) << "Device was added" << result.dat.first(); } } - void QBluetoothDeviceDiscoveryAgentPrivate::finished() { - qBBBluetoothDebug() << "Device discovery finished"; - m_finishedTimer.stop(); - stop(); - q_ptr->finished(); + if (m_active) { + qCDebug(QT_BT_QNX) << "Device discovery finished"; + isFinished = true; + stop(); + q_ptr->finished(); + } } -void QBluetoothDeviceDiscoveryAgentPrivate::abort() +void QBluetoothDeviceDiscoveryAgentPrivate::startDeviceSearch() { - if (m_controlRegistered) { - ppsUnregisterControl(this); - m_controlRegistered = false; + if (m_currentOp == Start) { + ppsSendControlMessage("device_search", this); //Try again } +} - pendingStart = false; - if (m_rdNotifier) { - delete m_rdNotifier; - m_rdNotifier = 0; +void QBluetoothDeviceDiscoveryAgentPrivate::processNextOp() +{ + if (m_currentOp == m_nextOp) { + m_currentOp = None; + m_nextOp = None; } - if (m_rdfd != -1) { - qt_safe_close(m_rdfd); - m_rdfd = -1; + m_currentOp = m_nextOp; + m_nextOp = None; + + if (m_currentOp == Start) { + start(); + } else if (m_currentOp == Cancel) { + stop(); } } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdeviceinfo.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdeviceinfo.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdeviceinfo.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdeviceinfo.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,9 +42,7 @@ #include "qbluetoothdeviceinfo.h" #include "qbluetoothdeviceinfo_p.h" -#include - -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE /*! \class QBluetoothDeviceInfo @@ -500,24 +498,6 @@ } /*! - Sets the manufacturer-specific data returned by Extended Inquiry Responses to \a data. -*/ -void QBluetoothDeviceInfo::setManufacturerSpecificData(const QByteArray &data) -{ - Q_UNUSED(data); -} - -/*! - Returns the manufacturer-specific data. If \a available is not 0, it is set to true if - manufacturer-specific data is available; otherwise it is set to false. -*/ -QByteArray QBluetoothDeviceInfo::manufacturerSpecificData(bool *available) const -{ - Q_UNUSED(available); - return QByteArray(); -} - -/*! Returns true if the QBluetoothDeviceInfo object is created from cached data. */ bool QBluetoothDeviceInfo::isCached() const @@ -538,4 +518,4 @@ d->cached = cached; } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdeviceinfo.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdeviceinfo.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdeviceinfo.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdeviceinfo.h 2014-02-01 20:38:03.000000000 +0000 @@ -46,7 +46,7 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothDeviceInfoPrivate; class QBluetoothAddress; @@ -66,11 +66,11 @@ WearableDevice = 7, ToyDevice = 8, HealthDevice = 9, - UncategorizedDevice = 31, + UncategorizedDevice = 31 }; enum MinorMiscellaneousClass { - UncategorizedMiscellaneous = 0, + UncategorizedMiscellaneous = 0 }; enum MinorComputerClass { @@ -80,7 +80,7 @@ LaptopComputer = 3, HandheldClamShellComputer = 4, HandheldComputer = 5, - WearableComputer = 6, + WearableComputer = 6 }; enum MinorPhoneClass { @@ -89,7 +89,7 @@ CordlessPhone = 2, SmartPhone = 3, WiredModemOrVoiceGatewayPhone = 4, - CommonIsdnAccessPhone = 5, + CommonIsdnAccessPhone = 5 }; enum MinorNetworkClass { @@ -100,7 +100,7 @@ NetworkLoadFactorFour = 0x20, NetworkLoadFactorFive = 0x28, NetworkLoadFactorSix = 0x30, - NetworkNoService = 0x38, + NetworkNoService = 0x38 }; enum MinorAudioVideoClass { @@ -122,7 +122,7 @@ VideoDisplayAndLoudspeaker = 15, VideoConferencing = 16, // reserved = 17, - GamingDevice = 18, + GamingDevice = 18 }; enum MinorPeripheralClass { @@ -136,7 +136,7 @@ RemoteControlPeripheral = 0x03, SensingDevicePeripheral = 0x04, DigitizerTabletPeripheral = 0x05, - CardReaderPeripheral = 0x06, + CardReaderPeripheral = 0x06 }; enum MinorImagingClass { @@ -153,7 +153,7 @@ WearablePager = 2, WearableJacket = 3, WearableHelmet = 4, - WearableGlasses = 5, + WearableGlasses = 5 }; enum MinorToyClass { @@ -162,7 +162,7 @@ ToyVehicle = 2, ToyDoll = 3, ToyController = 4, - ToyGame = 5, + ToyGame = 5 }; enum MinorHealthClass { @@ -186,14 +186,14 @@ AudioService = 0x0020, TelephonyService = 0x0040, InformationService = 0x0080, - AllServices = 0x07ff, + AllServices = 0x07ff }; Q_DECLARE_FLAGS(ServiceClasses, ServiceClass) enum DataCompleteness { DataComplete, DataIncomplete, - DataUnavailable, + DataUnavailable }; QBluetoothDeviceInfo(); @@ -220,20 +220,10 @@ qint16 rssi() const; void setRssi(qint16 signal); -// bool matchesMinorClass(MinorComputerClass minor) const; -// bool matchesMinorClass(MinorPhoneClass minor) const; -// bool matchesMinorClass(MinorNetworkClass minor) const; -// bool matchesMinorClass(MinorAudioVideoClass minor) const; -// bool matchesMinorClass(MinorPeripheralClass minor) const; -// bool matchesMinorClass(MinorImagingClass minor) const; - void setServiceUuids(const QList &uuids, DataCompleteness completeness); QList serviceUuids(DataCompleteness *completeness = 0) const; DataCompleteness serviceUuidsCompleteness() const; - void setManufacturerSpecificData(const QByteArray &data); - QByteArray manufacturerSpecificData(bool *available = 0) const; - protected: QBluetoothDeviceInfoPrivate *d_ptr; @@ -241,6 +231,6 @@ Q_DECLARE_PRIVATE(QBluetoothDeviceInfo) }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdeviceinfo_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdeviceinfo_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothdeviceinfo_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothdeviceinfo_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothDeviceInfoPrivate { @@ -71,6 +71,6 @@ QList serviceUuids; }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothglobal.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothglobal.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothglobal.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothglobal.h 2014-02-01 20:38:03.000000000 +0000 @@ -43,18 +43,7 @@ #include -#if defined(QT_NAMESPACE) -# define QT_PREPEND_NAMESPACE_BLUETOOTH(name) ::QT_NAMESPACE::QtBluetooth::name -# define QT_BEGIN_NAMESPACE_BLUETOOTH namespace QT_NAMESPACE { namespace QtBluetooth { -# define QT_END_NAMESPACE_BLUETOOTH } } -# define QT_USE_NAMESPACE_BLUETOOTH using namespace QT_NAMESPACE; using namespace QtBluetooth; -#else -# define QT_PREPEND_NAMESPACE_BLUETOOTH(name) ::QtBluetooth::name -# define QT_BEGIN_NAMESPACE_BLUETOOTH namespace QtBluetooth { -# define QT_END_NAMESPACE_BLUETOOTH } -# define QT_USE_NAMESPACE_BLUETOOTH using namespace QtBluetooth; -#endif - +QT_BEGIN_NAMESPACE #ifndef QT_STATIC # if defined(QT_BUILD_BLUETOOTH_LIB) @@ -66,4 +55,6 @@ # define Q_BLUETOOTH_EXPORT #endif +QT_END_NAMESPACE + #endif // QTBLUETOOTH_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetooth.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetooth.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetooth.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetooth.h 2014-02-01 20:38:03.000000000 +0000 @@ -45,7 +45,7 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE namespace QBluetooth { enum Security { @@ -60,6 +60,6 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(SecurityFlags) } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif // QBLUETOOTH_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothhostinfo.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothhostinfo.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothhostinfo.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothhostinfo.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,7 +42,7 @@ #include "qbluetoothhostinfo.h" #include "qbluetoothhostinfo_p.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE /*! \class QBluetoothHostInfo @@ -117,4 +117,4 @@ d->m_name = name; } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothhostinfo.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothhostinfo.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothhostinfo.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothhostinfo.h 2014-02-01 20:38:03.000000000 +0000 @@ -45,7 +45,7 @@ #include #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothHostInfoPrivate; class Q_BLUETOOTH_EXPORT QBluetoothHostInfo @@ -67,6 +67,6 @@ }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothhostinfo_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothhostinfo_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothhostinfo_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothhostinfo_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -44,7 +44,7 @@ #include "qbluetoothhostinfo.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothHostInfoPrivate { @@ -55,6 +55,6 @@ QString m_name; }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice_bluez.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice_bluez.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice_bluez.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice_bluez.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -39,8 +39,8 @@ ** ****************************************************************************/ - -#include +#include +#include #include "qbluetoothlocaldevice.h" #include "qbluetoothaddress.h" @@ -51,7 +51,9 @@ #include "bluez/agent_p.h" #include "bluez/device_p.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE + +Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ) static const QLatin1String agentPath("/qt/agent"); @@ -194,7 +196,7 @@ QDBusPendingReply reply = d_ptr->adapter->FindDevice(address.toString()); reply.waitForFinished(); if(reply.isError()){ - qDebug() << Q_FUNC_INFO << "reply failed" << reply.error(); + qCWarning(QT_BT_BLUEZ) << Q_FUNC_INFO << "reply failed" << reply.error(); return 0; } @@ -230,7 +232,7 @@ if(!res){ QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QBluetoothLocalDevice::Error, QBluetoothLocalDevice::PairingError)); - qDebug() << "Failed to register agent"; + qCWarning(QT_BT_BLUEZ) << "Failed to register agent"; return; } } @@ -245,7 +247,7 @@ QDBusPendingReply<> deviceReply = device->SetProperty(QLatin1String("Trusted"), QDBusVariant(true)); deviceReply.waitForFinished(); if(deviceReply.isError()){ - qDebug() << Q_FUNC_INFO << "reply failed" << deviceReply.error(); + qCWarning(QT_BT_BLUEZ) << Q_FUNC_INFO << "reply failed" << deviceReply.error(); QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QBluetoothLocalDevice::Error, QBluetoothLocalDevice::PairingError)); return; @@ -264,7 +266,7 @@ QDBusPendingReply<> deviceReply = device->SetProperty(QLatin1String("Trusted"), QDBusVariant(false)); deviceReply.waitForFinished(); if(deviceReply.isError()){ - qDebug() << Q_FUNC_INFO << "reply failed" << deviceReply.error(); + qCWarning(QT_BT_BLUEZ) << Q_FUNC_INFO << "reply failed" << deviceReply.error(); QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QBluetoothLocalDevice::Error, QBluetoothLocalDevice::PairingError)); return; @@ -283,14 +285,14 @@ connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), d_ptr, SLOT(pairingCompleted(QDBusPendingCallWatcher*))); if(reply.isError()) - qDebug() << Q_FUNC_INFO << reply.error() << d_ptr->agent_path; + qCWarning(QT_BT_BLUEZ) << Q_FUNC_INFO << reply.error() << d_ptr->agent_path; } } else if(pairing == Unpaired) { QDBusPendingReply reply = this->d_ptr->adapter->FindDevice(address.toString()); reply.waitForFinished(); if(reply.isError()) { - qDebug() << Q_FUNC_INFO << "failed to find device" << reply.error(); + qCWarning(QT_BT_BLUEZ) << Q_FUNC_INFO << "failed to find device" << reply.error(); QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QBluetoothLocalDevice::Error, QBluetoothLocalDevice::PairingError)); return; @@ -298,7 +300,7 @@ QDBusPendingReply<> removeReply = this->d_ptr->adapter->RemoveDevice(reply.value()); removeReply.waitForFinished(); if(removeReply.isError()){ - qDebug() << Q_FUNC_INFO << "failed to remove device" << removeReply.error(); + qCWarning(QT_BT_BLUEZ) << Q_FUNC_INFO << "failed to remove device" << removeReply.error(); QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QBluetoothLocalDevice::Error, QBluetoothLocalDevice::PairingError)); } else { @@ -435,8 +437,9 @@ QString QBluetoothLocalDevicePrivate::RequestPinCode(const QDBusObjectPath &in0) { + Q_UNUSED(in0) Q_Q(QBluetoothLocalDevice); - qDebug() << Q_FUNC_INFO << in0.path(); + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO << in0.path(); // seeded in constructor, 6 digit pin QString pin = QString::fromLatin1("%1").arg(qrand()&1000000); pin = QString::fromLatin1("%1").arg(pin, 6, QLatin1Char('0')); @@ -451,7 +454,7 @@ QDBusPendingReply<> reply = *watcher; if(reply.isError()) { - qDebug() << Q_FUNC_INFO << "failed to create pairing" << reply.error(); + qCWarning(QT_BT_BLUEZ) << Q_FUNC_INFO << "failed to create pairing" << reply.error(); emit q->error(QBluetoothLocalDevice::PairingError); delete watcher; return; @@ -460,7 +463,7 @@ QDBusPendingReply findReply = adapter->FindDevice(address.toString()); findReply.waitForFinished(); if(findReply.isError()) { - qDebug() << Q_FUNC_INFO << "failed to find device" << findReply.error(); + qCWarning(QT_BT_BLUEZ) << Q_FUNC_INFO << "failed to find device" << findReply.error(); emit q->error(QBluetoothLocalDevice::PairingError); delete watcher; return; @@ -483,34 +486,45 @@ void QBluetoothLocalDevicePrivate::Authorize(const QDBusObjectPath &in0, const QString &in1) { - qDebug() << "Got authorize for" << in0.path() << in1; + Q_UNUSED(in0) + Q_UNUSED(in1) + //TODO implement this + qCDebug(QT_BT_BLUEZ) << "Got authorize for" << in0.path() << in1; } void QBluetoothLocalDevicePrivate::Cancel() { - qDebug() << Q_FUNC_INFO; + //TODO implement this + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO; } void QBluetoothLocalDevicePrivate::Release() { - qDebug() << Q_FUNC_INFO; + //TODO implement this + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO; } void QBluetoothLocalDevicePrivate::ConfirmModeChange(const QString &in0) { - qDebug() << Q_FUNC_INFO << in0; + Q_UNUSED(in0) + //TODO implement this + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO << in0; } void QBluetoothLocalDevicePrivate::DisplayPasskey(const QDBusObjectPath &in0, uint in1, uchar in2) { - qDebug() << Q_FUNC_INFO << in0.path() << in1 << in2; + Q_UNUSED(in0) + Q_UNUSED(in1) + Q_UNUSED(in2) + //TODO implement this + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO << in0.path() << in1 << in2; } uint QBluetoothLocalDevicePrivate::RequestPasskey(const QDBusObjectPath &in0) { Q_UNUSED(in0); - qDebug() << Q_FUNC_INFO; + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO; return qrand()&0x1000000; } @@ -529,7 +543,7 @@ QDBusPendingReply reply = adapter->GetProperties(); reply.waitForFinished(); if (reply.isError()){ - qWarning() << "Failed to get bluetooth properties for mode change"; + qCWarning(QT_BT_BLUEZ) << "Failed to get bluetooth properties for mode change"; return; } @@ -569,4 +583,4 @@ #include "moc_qbluetoothlocaldevice_p.cpp" -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -44,9 +44,8 @@ #include "qbluetoothaddress.h" #include -#include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE /*! \class QBluetoothLocalDevice @@ -220,6 +219,7 @@ \fn QBluetoothLocalDevice::requestPairing(const QBluetoothAddress &address, Pairing pairing) Set the \a pairing status with \a address. The results are returned by the signal, pairingFinished(). + On BlackBerry AuthorizedPaired is not possible and will have the same behavior as Paired. Caution: creating a pairing may take minutes, and may require the user to acknowledge. */ @@ -240,9 +240,10 @@ /*! \fn QBluetoothLocalDevice::QBluetoothLocalDevice(const QBluetoothAddress &address, QObject *parent = 0) - Construct new QBluetoothLocalDevice for \a address. + Construct new QBluetoothLocalDevice for \a address. If \a address is default constructed + the resulting local device selects the local default device. */ #include "moc_qbluetoothlocaldevice.cpp" -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice.h 2014-02-01 20:38:03.000000000 +0000 @@ -51,7 +51,7 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothLocalDevicePrivate; @@ -115,10 +115,10 @@ QBluetoothLocalDevicePrivate *d_ptr; }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE -Q_DECLARE_METATYPE(QtBluetooth::QBluetoothLocalDevice::HostMode) -Q_DECLARE_METATYPE(QtBluetooth::QBluetoothLocalDevice::Pairing) -Q_DECLARE_METATYPE(QtBluetooth::QBluetoothLocalDevice::Error) +Q_DECLARE_METATYPE(QBluetoothLocalDevice::HostMode) +Q_DECLARE_METATYPE(QBluetoothLocalDevice::Pairing) +Q_DECLARE_METATYPE(QBluetoothLocalDevice::Error) #endif // QBLUETOOTHLOCALDEVICE_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice_p.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,7 +43,7 @@ #include "qbluetoothlocaldevice.h" #include "qbluetoothaddress.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE QBluetoothLocalDevice::QBluetoothLocalDevice(QObject *parent) : QObject(parent), d_ptr(0) @@ -102,4 +102,4 @@ Q_UNUSED(confirmation); } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -59,12 +59,12 @@ class QDBusPendingCallWatcher; QT_END_NAMESPACE -#elif defined(QTM_QNX_BLUETOOTH) +#elif defined(QT_QNX_BLUETOOTH) #include #include "qnx/ppshelpers_p.h" #endif -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothAddress; @@ -112,14 +112,14 @@ void initializeAdapter(); }; -#elif defined(QTM_QNX_BLUETOOTH) +#elif defined(QT_QNX_BLUETOOTH) class QBluetoothLocalDevicePrivate : public QObject { Q_OBJECT Q_DECLARE_PUBLIC(QBluetoothLocalDevice) public: - QBluetoothLocalDevicePrivate(); + QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *); ~QBluetoothLocalDevicePrivate(); static QString name(); @@ -131,6 +131,8 @@ void setHostMode(QBluetoothLocalDevice::HostMode mode); QBluetoothLocalDevice::HostMode hostMode() const; + void requestPairing(const QBluetoothAddress &address, QBluetoothLocalDevice::Pairing pairing); + void setAccess(int); Q_INVOKABLE void controlReply(ppsResult res); @@ -153,6 +155,6 @@ }; #endif -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif // QBLUETOOTHLOCALDEVICE_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice_qnx.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice_qnx.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothlocaldevice_qnx.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothlocaldevice_qnx.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -44,22 +44,23 @@ #include "qbluetoothlocaldevice_p.h" #include "qnx/ppshelpers_p.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE QBluetoothLocalDevice::QBluetoothLocalDevice(QObject *parent) : QObject(parent) { - this->d_ptr = new QBluetoothLocalDevicePrivate(); + this->d_ptr = new QBluetoothLocalDevicePrivate(this); this->d_ptr->isValidDevice = true; //assume single local device on QNX } QBluetoothLocalDevice::QBluetoothLocalDevice(const QBluetoothAddress &address, QObject *parent) : QObject(parent) { - this->d_ptr = new QBluetoothLocalDevicePrivate(); + this->d_ptr = new QBluetoothLocalDevicePrivate(this); //works since we assume a single local device on QNX - this->d_ptr->isValidDevice = (QBluetoothLocalDevicePrivate::address() == address); + this->d_ptr->isValidDevice = (QBluetoothLocalDevicePrivate::address() == address || + address == QBluetoothAddress()); } QString QBluetoothLocalDevice::name() const @@ -78,7 +79,8 @@ void QBluetoothLocalDevice::powerOn() { - this->d_ptr->powerOn(); + if (hostMode() == QBluetoothLocalDevice::HostPoweredOff) + this->d_ptr->powerOn(); } void QBluetoothLocalDevice::setHostMode(QBluetoothLocalDevice::HostMode mode) @@ -104,9 +106,19 @@ void QBluetoothLocalDevice::requestPairing(const QBluetoothAddress &address, Pairing pairing) { - Q_UNUSED(pairing); - if (isValid()) - ppsSendControlMessage("initiate_pairing", QStringLiteral("{\"addr\":\"%1\"}").arg(address.toString()), 0); + if (address.isNull()) { + QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, + Q_ARG(QBluetoothLocalDevice::Error, QBluetoothLocalDevice::PairingError)); + return; + } + + const Pairing current_pairing = pairingStatus(address); + if (current_pairing == pairing) { + QMetaObject::invokeMethod(this, "pairingFinished", Qt::QueuedConnection, Q_ARG(QBluetoothAddress, address), + Q_ARG(QBluetoothLocalDevice::Pairing, pairing)); + return; + } + d_ptr->requestPairing(address, pairing); } QBluetoothLocalDevice::Pairing QBluetoothLocalDevice::pairingStatus(const QBluetoothAddress &address) const @@ -125,16 +137,23 @@ Q_UNUSED(confirmation); } -QBluetoothLocalDevicePrivate::QBluetoothLocalDevicePrivate() +QBluetoothLocalDevicePrivate::QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *q) + : q_ptr(q) { ppsRegisterControl(); ppsRegisterForEvent(QStringLiteral("access_changed"), this); + ppsRegisterForEvent(QStringLiteral("pairing_complete"), this); + ppsRegisterForEvent(QStringLiteral("device_deleted"), this); + ppsRegisterForEvent(QStringLiteral("radio_shutdown"), this); } QBluetoothLocalDevicePrivate::~QBluetoothLocalDevicePrivate() { ppsUnregisterControl(this); - ppsUnreguisterForEvent(QStringLiteral("access_changed"), this); + ppsUnregisterForEvent(QStringLiteral("access_changed"), this); + ppsUnregisterForEvent(QStringLiteral("pairing_complete"), this); + ppsUnregisterForEvent(QStringLiteral("device_deleted"), this); + ppsUnregisterForEvent(QStringLiteral("radio_shutdown"), this); } bool QBluetoothLocalDevicePrivate::isValid() const @@ -175,7 +194,7 @@ } //If the device is in PowerOff state and the profile is changed then the power has to be turned on if (currentHostMode == QBluetoothLocalDevice::HostPoweredOff) { - qBBBluetoothDebug() << "Powering on"; + qCDebug(QT_BT_QNX) << "Powering on"; powerOn(); } @@ -192,6 +211,19 @@ setAccess(2); } } + +void QBluetoothLocalDevicePrivate::requestPairing(const QBluetoothAddress &address, + QBluetoothLocalDevice::Pairing pairing) +{ + if (pairing == QBluetoothLocalDevice::Paired || pairing == QBluetoothLocalDevice::AuthorizedPaired) { + ppsSendControlMessage("initiate_pairing", QStringLiteral("{\"addr\":\"%1\"}").arg(address.toString()), + this); + } else { + ppsSendControlMessage("remove_device", QStringLiteral("{\"addr\":\"%1\"}").arg(address.toString()), + this); + } +} + QBluetoothLocalDevice::HostMode QBluetoothLocalDevicePrivate::hostMode() const { if (!isValid()) @@ -226,22 +258,52 @@ void QBluetoothLocalDevicePrivate::controlReply(ppsResult result) { - qBBBluetoothDebug() << Q_FUNC_INFO << result.msg << result.dat; + qCDebug(QT_BT_QNX) << Q_FUNC_INFO << result.msg << result.dat; if (!result.errorMsg.isEmpty()) { - qWarning() << Q_FUNC_INFO << result.errorMsg; - q_ptr->error(QBluetoothLocalDevice::UnknownError); + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << result.errorMsg; + if (result.msg == QStringLiteral("initiate_pairing")) + q_ptr->error(QBluetoothLocalDevice::PairingError); + else + q_ptr->error(QBluetoothLocalDevice::UnknownError); } } void QBluetoothLocalDevicePrivate::controlEvent(ppsResult result) { + qCDebug(QT_BT_QNX) << Q_FUNC_INFO << "Control Event" << result.msg; if (result.msg == QStringLiteral("access_changed")) { if (__newHostMode == -1 && result.dat.size() > 1 && result.dat.first() == QStringLiteral("level")) { - qBBBluetoothDebug() << "New Host mode" << hostMode(); - Q_EMIT q_ptr->hostModeStateChanged(hostMode()); + QBluetoothLocalDevice::HostMode newHostMode = hostMode(); + qCDebug(QT_BT_QNX) << "New Host mode" << newHostMode; + Q_EMIT q_ptr->hostModeStateChanged(newHostMode); + } + } else if (result.msg == QStringLiteral("pairing_complete")) { + qCDebug(QT_BT_QNX) << "pairing completed"; + if (result.dat.contains(QStringLiteral("addr"))) { + const QBluetoothAddress address = QBluetoothAddress( + result.dat.at(result.dat.indexOf(QStringLiteral("addr")) + 1)); + + QBluetoothLocalDevice::Pairing pairingStatus = QBluetoothLocalDevice::Paired; + + if (result.dat.contains(QStringLiteral("trusted")) && + result.dat.at(result.dat.indexOf(QStringLiteral("trusted")) + 1) == QStringLiteral("true")) { + pairingStatus = QBluetoothLocalDevice::AuthorizedPaired; + } + qCDebug(QT_BT_QNX) << "pairing completed" << address.toString(); + Q_EMIT q_ptr->pairingFinished(address, pairingStatus); + } + } else if (result.msg == QStringLiteral("device_deleted")) { + qCDebug(QT_BT_QNX) << "device deleted"; + if (result.dat.contains(QStringLiteral("addr"))) { + const QBluetoothAddress address = QBluetoothAddress( + result.dat.at(result.dat.indexOf(QStringLiteral("addr")) + 1)); + Q_EMIT q_ptr->pairingFinished(address, QBluetoothLocalDevice::Unpaired); } + } else if (result.msg == QStringLiteral("radio_shutdown")) { + qCDebug(QT_BT_QNX) << "radio shutdown"; + Q_EMIT q_ptr->hostModeStateChanged(QBluetoothLocalDevice::HostPoweredOff); } } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver_bluez.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver_bluez.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver_bluez.cpp 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver_bluez.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,333 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 "qbluetoothserver.h" +#include "qbluetoothserver_p.h" +#include "qbluetoothsocket.h" + +#include +#include + +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ) + +static inline void convertAddress(quint64 from, quint8 (&to)[6]) +{ + to[0] = (from >> 0) & 0xff; + to[1] = (from >> 8) & 0xff; + to[2] = (from >> 16) & 0xff; + to[3] = (from >> 24) & 0xff; + to[4] = (from >> 32) & 0xff; + to[5] = (from >> 40) & 0xff; +} + +QBluetoothServerPrivate::QBluetoothServerPrivate(QBluetoothServiceInfo::Protocol sType) + : maxPendingConnections(1), serverType(sType), m_lastError(QBluetoothServer::NoError), + socketNotifier(0) +{ + if (sType == QBluetoothServiceInfo::RfcommProtocol) + socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol); + else + socket = new QBluetoothSocket(QBluetoothServiceInfo::L2capProtocol); +} + +QBluetoothServerPrivate::~QBluetoothServerPrivate() +{ + delete socketNotifier; + + delete socket; +} + +void QBluetoothServerPrivate::_q_newConnection() +{ + // disable socket notifier until application calls nextPendingConnection(). + socketNotifier->setEnabled(false); + + emit q_ptr->newConnection(); +} + +void QBluetoothServer::close() +{ + Q_D(QBluetoothServer); + + delete d->socketNotifier; + d->socketNotifier = 0; + + d->socket->close(); +} + +bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port) +{ + Q_D(QBluetoothServer); + + int sock = d->socket->socketDescriptor(); + if (sock < 0) { + d->m_lastError = InputOutputError; + emit error(d->m_lastError); + return false; + } + + if (d->serverType == QBluetoothServiceInfo::RfcommProtocol) { + sockaddr_rc addr; + + addr.rc_family = AF_BLUETOOTH; + addr.rc_channel = port; + + if (!address.isNull()) + convertAddress(address.toUInt64(), addr.rc_bdaddr.b); + else + convertAddress(Q_UINT64_C(0), addr.rc_bdaddr.b); + + + if (::bind(sock, reinterpret_cast(&addr), sizeof(sockaddr_rc)) < 0) { + d->m_lastError = InputOutputError; + emit error(d->m_lastError); + return false; + } + } else { + sockaddr_l2 addr; + + memset(&addr, 0, sizeof(sockaddr_l2)); + addr.l2_family = AF_BLUETOOTH; + addr.l2_psm = port; + + if (!address.isNull()) + convertAddress(address.toUInt64(), addr.l2_bdaddr.b); + else + convertAddress(Q_UINT64_C(0), addr.l2_bdaddr.b); + + if (::bind(sock, reinterpret_cast(&addr), sizeof(sockaddr_l2)) < 0) { + d->m_lastError = InputOutputError; + emit error(d->m_lastError); + return false; + } + } + + if (::listen(sock, d->maxPendingConnections) < 0) { + d->m_lastError = InputOutputError; + emit error(d->m_lastError); + return false; + } + + d->socket->setSocketState(QBluetoothSocket::ListeningState); + + if (!d->socketNotifier) { + d->socketNotifier = new QSocketNotifier(d->socket->socketDescriptor(), + QSocketNotifier::Read); + connect(d->socketNotifier, SIGNAL(activated(int)), this, SLOT(_q_newConnection())); + } + + return true; +} + +void QBluetoothServer::setMaxPendingConnections(int numConnections) +{ + Q_D(QBluetoothServer); + + if (d->socket->state() == QBluetoothSocket::UnconnectedState) + d->maxPendingConnections = numConnections; +} + +bool QBluetoothServer::hasPendingConnections() const +{ + Q_D(const QBluetoothServer); + + if (!d || !d->socketNotifier) + return false; + + // if the socket notifier is disable there is a pending connection waiting for us to accept. + return !d->socketNotifier->isEnabled(); +} + +QBluetoothSocket *QBluetoothServer::nextPendingConnection() +{ + Q_D(QBluetoothServer); + + if (!hasPendingConnections()) + return 0; + + int pending; + if (d->serverType == QBluetoothServiceInfo::RfcommProtocol) { + sockaddr_rc addr; + socklen_t length = sizeof(sockaddr_rc); + pending = ::accept(d->socket->socketDescriptor(), + reinterpret_cast(&addr), &length); + } else { + sockaddr_l2 addr; + socklen_t length = sizeof(sockaddr_l2); + pending = ::accept(d->socket->socketDescriptor(), + reinterpret_cast(&addr), &length); + } + + if (pending >= 0) { + QBluetoothSocket *newSocket = new QBluetoothSocket; + if (d->serverType == QBluetoothServiceInfo::RfcommProtocol) + newSocket->setSocketDescriptor(pending, QBluetoothServiceInfo::RfcommProtocol); + else + newSocket->setSocketDescriptor(pending, QBluetoothServiceInfo::L2capProtocol); + + d->socketNotifier->setEnabled(true); + + return newSocket; + } else { + d->socketNotifier->setEnabled(true); + } + + return 0; +} + +QBluetoothAddress QBluetoothServer::serverAddress() const +{ + Q_D(const QBluetoothServer); + + return d->socket->localAddress(); +} + +quint16 QBluetoothServer::serverPort() const +{ + Q_D(const QBluetoothServer); + + return d->socket->localPort(); +} + +void QBluetoothServer::setSecurityFlags(QBluetooth::SecurityFlags security) +{ + Q_D(QBluetoothServer); + + int lm = 0; + if (security == QBluetooth::NoSecurity) + lm = 0; + + if (d->serverType == QBluetoothServiceInfo::RfcommProtocol) { + if (security.testFlag(QBluetooth::Authorization)) + lm |= RFCOMM_LM_AUTH; + if (security.testFlag(QBluetooth::Authentication)) + lm |= RFCOMM_LM_TRUSTED; + if (security.testFlag(QBluetooth::Encryption)) + lm |= RFCOMM_LM_ENCRYPT; + if (security.testFlag(QBluetooth::Secure)) + lm |= RFCOMM_LM_SECURE; + + qCDebug(QT_BT_BLUEZ()) << hex << "Setting lm to" << lm << security; + + if (setsockopt(d->socket->socketDescriptor(), SOL_RFCOMM, RFCOMM_LM, &lm, sizeof(lm)) < 0){ + qCWarning(QT_BT_BLUEZ) << "Failed to set socket option, closing socket for safety" << errno; + qCWarning(QT_BT_BLUEZ) << "Error: " << strerror(errno); + d->m_lastError = InputOutputError; + emit error(d->m_lastError); + d->socket->close(); + } + } else { + if (security.testFlag(QBluetooth::Authorization)) + lm |= L2CAP_LM_AUTH; + if (security.testFlag(QBluetooth::Authentication)) + lm |= L2CAP_LM_TRUSTED; + if (security.testFlag(QBluetooth::Encryption)) + lm |= L2CAP_LM_ENCRYPT; + if (security.testFlag(QBluetooth::Secure)) + lm |= L2CAP_LM_SECURE; + + if (setsockopt(d->socket->socketDescriptor(), SOL_L2CAP, L2CAP_LM, &lm, sizeof(lm)) < 0){ + qCWarning(QT_BT_BLUEZ) << "Failed to set socket option, closing socket for safety" << errno; + qCWarning(QT_BT_BLUEZ) << "Error: " << strerror(errno); + d->m_lastError = InputOutputError; + emit error(d->m_lastError); + d->socket->close(); + } + } + +} + +QBluetooth::SecurityFlags QBluetoothServer::securityFlags() const +{ + Q_D(const QBluetoothServer); + + int lm = 0; + int len = sizeof(lm); + int security = QBluetooth::NoSecurity; + + if (d->serverType == QBluetoothServiceInfo::RfcommProtocol) { + if (getsockopt(d->socket->socketDescriptor(), SOL_RFCOMM, RFCOMM_LM, &lm, (socklen_t *)&len) < 0) { + qCWarning(QT_BT_BLUEZ) << "Failed to get security flags" << strerror(errno); + return QBluetooth::NoSecurity; + } + + if (lm & RFCOMM_LM_SECURE) + security |= QBluetooth::Secure; + + if (lm & RFCOMM_LM_ENCRYPT) + security |= QBluetooth::Encryption; + + if (lm & RFCOMM_LM_TRUSTED) + security |= QBluetooth::Authentication; + + if (lm & RFCOMM_LM_AUTH) + security |= QBluetooth::Authorization; + } else { + if (getsockopt(d->socket->socketDescriptor(), SOL_L2CAP, L2CAP_LM, &lm, (socklen_t *)&len) < 0) { + qCWarning(QT_BT_BLUEZ) << "Failed to get security flags" << strerror(errno); + return QBluetooth::NoSecurity; + } + + if (lm & L2CAP_LM_SECURE) + security |= QBluetooth::Secure; + + if (lm & L2CAP_LM_ENCRYPT) + security |= QBluetooth::Encryption; + + if (lm & L2CAP_LM_TRUSTED) + security |= QBluetooth::Authentication; + + if (lm & L2CAP_LM_AUTH) + security |= QBluetooth::Authorization; + } + + return static_cast(security); +} + +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver.cpp 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,291 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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$ +** 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 "qbluetoothserver.h" +#include "qbluetoothserver_p.h" +#include "qbluetoothsocket.h" +#include "qbluetoothserviceinfo.h" + +QT_BEGIN_NAMESPACE + +/*! + \class QBluetoothServer + \inmodule QtBluetooth + \brief The QBluetoothServer class uses the RFCOMM or L2cap protocol to communicate with + a Bluetooth device. + + QBluetoothServer is used to implement Bluetooth services over RFCOMM or L2cap. + + Start listening for incoming connections with listen(). Wait till the newConnection() signal + is emitted when a new connection is established, and call nextPendingConnection() to get a QBluetoothSocket + for the new connection. + + To enable other devices to find your service, create a QBluetoothServiceInfo with the + applicable attributes for your service and register it using QBluetoothServiceInfo::registerService(). + Call serverPort() to get the channel number that is being used. + + If the \l QBluetoothServiceInfo::Protocol is not supported by a platform, \l listen() will return \c false. + + \sa QBluetoothServiceInfo, QBluetoothSocket +*/ + +/*! + \fn void QBluetoothServer::newConnection() + + This signal is emitted when a new connection is available. + + The connected slot should call nextPendingConnection() to get a QBluetoothSocket object to + send and receive data over the connection. + + \sa nextPendingConnection(), hasPendingConnections() +*/ + +/*! + \fn void QBluetoothServer::error(QBluetoothServer::Error error) + + This signal is emitted when an \a error occurs. + + \sa error(), QBluetoothServer::Error +*/ + +/*! + \fn void QBluetoothServer::close() + + Closes and resets the listening socket. +*/ + +/*! + \enum QBluetoothServer::Error + + This enum describes Bluetooth server error types. + + \value NoError No error. + \value UnknownError An unknown error occurred. + \value PoweredOffError The Bluetooth adapter is powered off. + \value InputOutputError An input output error occurred. + \value ServiceAlreadyRegisteredError The service or port was already registered + \value UnsupportedProtocolError The \l {QBluetoothServiceInfo::Protocol}{Protocol} is not + supported on this platform. +*/ + +/*! + \fn bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port) + + Start listening for incoming connections to \a address on \a port. + + Returns true if the operation succeeded and the server is listening for + incoming connections, otherwise returns false. + + \sa isListening(), newConnection() +*/ + +/*! + \fn void QBluetoothServer::setMaxPendingConnections(int numConnections) + + Sets the maximum number of pending connections to \a numConnections. + + \sa maxPendingConnections() +*/ + +/*! + \fn bool QBluetoothServer::hasPendingConnections() const + Returns true if a connection is pending, otherwise false. +*/ + +/*! + \fn QBluetoothSocket *QBluetoothServer::nextPendingConnection() + + Returns a pointer to aQBluetoothSocket for the next pending connection. It is the callers + responsibility to delete the pointer. +*/ + +/*! + \fn QBluetoothAddress QBluetoothServer::serverAddress() const + + Returns the server address. +*/ + +/*! + \fn quint16 QBluetoothServer::serverPort() const + + Returns the server port number. On BlackBerry, this port might not correspond to the real RFCOMM port. +*/ + +/*! + Constructs a bluetooth server with \a parent and \a serverType. +*/ +QBluetoothServer::QBluetoothServer(QBluetoothServiceInfo::Protocol serverType, QObject *parent) + : QObject(parent), d_ptr(new QBluetoothServerPrivate(serverType)) +{ + d_ptr->q_ptr = this; +} + +/*! + Destroys the bluetooth server. +*/ +QBluetoothServer::~QBluetoothServer() +{ + delete d_ptr; +} + +/*! + \fn QBluetoothServiceInfo QBluetoothServer::listen(const QBluetoothUuid &uuid, const QString &serviceName) + + Convenience function for registering an SPP service with \a uuid and \a serviceName. + Because this function already registers the service, the QBluetoothServiceInfo object + which is returned can not be changed any more. + + Returns a registered QBluetoothServiceInfo instance if sucessful otherwise an + invalid QBluetoothServiceInfo. This function always assumes that the default Bluetooth adapter + should be used. + + For an RFCOMM server this function is equivalent to following code snippet. + + \snippet qbluetoothserver.cpp listen + \snippet qbluetoothserver.cpp listen2 + \snippet qbluetoothserver.cpp listen3 + + \sa isListening(), newConnection(), listen() +*/ +QBluetoothServiceInfo QBluetoothServer::listen(const QBluetoothUuid &uuid, const QString &serviceName) +{ + Q_D(const QBluetoothServer); + if (!listen()) + return QBluetoothServiceInfo(); +//! [listen] + QBluetoothServiceInfo serviceInfo; + serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceName, serviceName); + serviceInfo.setAttribute(QBluetoothServiceInfo::BrowseGroupList, + QBluetoothUuid(QBluetoothUuid::PublicBrowseGroup)); + + QBluetoothServiceInfo::Sequence classId; + classId << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::SerialPort)); + serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId); + serviceInfo.setAttribute(QBluetoothServiceInfo::BluetoothProfileDescriptorList, + classId); + + serviceInfo.setServiceUuid(uuid); + + QBluetoothServiceInfo::Sequence protocolDescriptorList; + QBluetoothServiceInfo::Sequence protocol; + protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap)); + protocolDescriptorList.append(QVariant::fromValue(protocol)); + protocol.clear(); +//! [listen] + if (d->serverType == QBluetoothServiceInfo::RfcommProtocol) { +//! [listen2] + protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Rfcomm)) + << QVariant::fromValue(quint8(serverPort())); +//! [listen2] + } +//! [listen3] + protocolDescriptorList.append(QVariant::fromValue(protocol)); + serviceInfo.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, + protocolDescriptorList); + bool result = serviceInfo.registerService(); +//! [listen3] + if (!result) + return QBluetoothServiceInfo(); + return serviceInfo; +} + +/*! + Returns true if the server is listening for incoming connections, otherwise false. +*/ +bool QBluetoothServer::isListening() const +{ + Q_D(const QBluetoothServer); + +#ifdef QT_QNX_BLUETOOTH + if (!d->socket) + return false; +#endif + + return d->socket->state() == QBluetoothSocket::ListeningState; +} + +/*! + Returns the maximum number of pending connections. + + \sa setMaxPendingConnections() +*/ +int QBluetoothServer::maxPendingConnections() const +{ + Q_D(const QBluetoothServer); + + return d->maxPendingConnections; +} + +/*! + \fn QBluetoothServer::setSecurityFlags(QBluetooth::SecurityFlags security) + Sets the Bluetooth security flags to \a security. This function must be called before calling listen(). + On BlackBerry, security flags are not supported and will be ignored. +*/ + +/*! + \fn QBluetooth::SecurityFlags QBluetoothServer::securityFlags() const + Returns the Bluetooth security flags. +*/ + +/*! + \fn QBluetoothSocket::ServerType QBluetoothServer::serverType() const + Returns the type of the QBluetoothServer. +*/ +QBluetoothServiceInfo::Protocol QBluetoothServer::serverType() const +{ + Q_D(const QBluetoothServer); + return d->serverType; +} + +/*! + \fn QBluetoothServer::Error QBluetoothServer::error() const + Returns the last error of the QBluetoothServer. +*/ +QBluetoothServer::Error QBluetoothServer::error() const +{ + Q_D(const QBluetoothServer); + return d->m_lastError; +} + +#include "moc_qbluetoothserver.cpp" + +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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$ +** 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 QBLUETOOTHSERVER_H +#define QBLUETOOTHSERVER_H + +#include + +#include + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QBluetoothServerPrivate; +class QBluetoothSocket; + +class Q_BLUETOOTH_EXPORT QBluetoothServer : public QObject +{ + Q_OBJECT + +public: + enum Error { + NoError, + UnknownError, + PoweredOffError, + InputOutputError, + ServiceAlreadyRegisteredError, + UnsupportedProtocolError + }; + QBluetoothServer(QBluetoothServiceInfo::Protocol serverType, QObject *parent = 0); + ~QBluetoothServer(); + + void close(); + + bool listen(const QBluetoothAddress &address = QBluetoothAddress(), quint16 port = 0); + QBluetoothServiceInfo listen(const QBluetoothUuid &uuid, const QString &serviceName = QString()); + bool isListening() const; + + void setMaxPendingConnections(int numConnections); + int maxPendingConnections() const; + + bool hasPendingConnections() const; + QBluetoothSocket *nextPendingConnection(); + + QBluetoothAddress serverAddress() const; + quint16 serverPort() const; + + void setSecurityFlags(QBluetooth::SecurityFlags security); + QBluetooth::SecurityFlags securityFlags() const; + + QBluetoothServiceInfo::Protocol serverType() const; + + Error error() const; + +Q_SIGNALS: + void newConnection(); + void error(Error); + +protected: + QBluetoothServerPrivate *d_ptr; + +private: + Q_DECLARE_PRIVATE(QBluetoothServer) + +#ifdef QT_BLUEZ_BLUETOOTH + Q_PRIVATE_SLOT(d_func(), void _q_newConnection()) +#endif +}; + +QT_END_NAMESPACE + +#endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver_p.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver_p.cpp 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 "qbluetoothserver.h" +#include "qbluetoothserver_p.h" +#include "qbluetoothsocket.h" + +QT_BEGIN_NAMESPACE + +QBluetoothServerPrivate::QBluetoothServerPrivate(QBluetoothServiceInfo::Protocol sType) + : serverType(sType), m_lastError(QBluetoothServer::NoError) +{ +} + +QBluetoothServerPrivate::~QBluetoothServerPrivate() +{ +} + +void QBluetoothServer::close() +{ +} + +bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port) +{ + Q_UNUSED(address); + Q_UNUSED(port); + Q_D(QBluetoothServer); + d->m_lastError = UnsupportedProtocolError; + emit error(d->m_lastError); + return false; +} + +void QBluetoothServer::setMaxPendingConnections(int numConnections) +{ + Q_UNUSED(numConnections); +} + +bool QBluetoothServer::hasPendingConnections() const +{ + return false; +} + +QBluetoothSocket *QBluetoothServer::nextPendingConnection() +{ + return 0; +} + +QBluetoothAddress QBluetoothServer::serverAddress() const +{ + return QBluetoothAddress(); +} + +quint16 QBluetoothServer::serverPort() const +{ + return 0; +} + +void QBluetoothServer::setSecurityFlags(QBluetooth::SecurityFlags security) +{ + Q_UNUSED(security); +} + +QBluetooth::SecurityFlags QBluetoothServer::securityFlags() const +{ + return QBluetooth::NoSecurity; +} + +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,116 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 QBLUETOOTHSERVER_P_H +#define QBLUETOOTHSERVER_P_H + +#include +#include +#include +#include "qbluetoothserver.h" +#include "qbluetooth.h" + +#ifdef QT_QNX_BLUETOOTH +#include "qnx/ppshelpers_p.h" +#endif + +#ifdef QT_BLUEZ_BLUETOOTH +QT_FORWARD_DECLARE_CLASS(QSocketNotifier) +#endif + +QT_BEGIN_NAMESPACE + +class QBluetoothAddress; +class QBluetoothSocket; + +class QBluetoothServer; + +class QBluetoothServerPrivate +#ifdef QT_QNX_BLUETOOTH +: public QObject +{ + Q_OBJECT +#else +{ +#endif + Q_DECLARE_PUBLIC(QBluetoothServer) + +public: + QBluetoothServerPrivate(QBluetoothServiceInfo::Protocol serverType); + ~QBluetoothServerPrivate(); + +#ifdef QT_BLUEZ_BLUETOOTH + void _q_newConnection(); +#endif + +public: + QBluetoothSocket *socket; + + int maxPendingConnections; + QBluetooth::SecurityFlags securityFlags; + QBluetoothServiceInfo::Protocol serverType; + +#ifdef QT_QNX_BLUETOOTH + QList activeSockets; + QString m_serviceName; +#endif + +protected: + QBluetoothServer *q_ptr; + +private: + QBluetoothServer::Error m_lastError; +#ifdef QT_QNX_BLUETOOTH + QBluetoothUuid m_uuid; + bool serverRegistered; + QString nextClientAddress; + +private Q_SLOTS: + void controlReply(ppsResult result); + void controlEvent(ppsResult result); +#elif defined(QT_BLUEZ_BLUETOOTH) + QSocketNotifier *socketNotifier; +#endif +}; + +QT_END_NAMESPACE + +#endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver_qnx.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver_qnx.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserver_qnx.cpp 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserver_qnx.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,241 @@ +/*************************************************************************** +** +** Copyright (C) 2012 - 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$ +** 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 "qbluetoothserver.h" +#include "qbluetoothserver_p.h" +#include "qbluetoothsocket.h" +#include "qbluetoothsocket_p.h" +#include "qbluetoothlocaldevice.h" + +#include + +#include + +QT_BEGIN_NAMESPACE + +extern QHash __fakeServerPorts; + +QBluetoothServerPrivate::QBluetoothServerPrivate(QBluetoothServiceInfo::Protocol sType) + : socket(0),maxPendingConnections(1), securityFlags(QBluetooth::NoSecurity), serverType(sType), + m_lastError(QBluetoothServer::NoError) +{ + ppsRegisterControl(); +} + +QBluetoothServerPrivate::~QBluetoothServerPrivate() +{ + Q_Q(QBluetoothServer); + q->close(); + __fakeServerPorts.remove(this); + ppsUnregisterControl(this); +} + +void QBluetoothServerPrivate::controlReply(ppsResult result) +{ + Q_Q(QBluetoothServer); + + if (result.msg == QStringLiteral("register_server")) { + qCDebug(QT_BT_QNX) << "SPP: Server registration succesfull"; + + } else if (result.msg == QStringLiteral("get_mount_point_path")) { + qCDebug(QT_BT_QNX) << "SPP: Mount point for server" << result.dat.first(); + + int socketFD = ::open(result.dat.first().toStdString().c_str(), O_RDWR | O_NONBLOCK); + if (socketFD == -1) { + m_lastError = QBluetoothServer::InputOutputError; + emit q->error(m_lastError); + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "RFCOMM Server: Could not open socket FD" << errno; + } else { + if (!socket) { // Should never happen + qCWarning(QT_BT_QNX) << "Socket not valid"; + m_lastError = QBluetoothServer::UnknownError; + emit q->error(m_lastError); + return; + } + + socket->setSocketDescriptor(socketFD, QBluetoothServiceInfo::RfcommProtocol, + QBluetoothSocket::ConnectedState); + socket->connectToService(QBluetoothAddress(nextClientAddress), m_uuid); + activeSockets.append(socket); + socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol, this); + socket->setSocketState(QBluetoothSocket::ListeningState); + emit q->newConnection(); + } + } +} + +void QBluetoothServerPrivate::controlEvent(ppsResult result) +{ + Q_Q(QBluetoothServer); + if (result.msg == QStringLiteral("service_connected")) { + qCDebug(QT_BT_QNX) << "SPP: Server: Sending request for mount point path"; + qCDebug(QT_BT_QNX) << result.dat; + for (int i=0; ierror(m_lastError); + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "address not specified in service connect reply"; + } + } +} + +void QBluetoothServer::close() +{ + Q_D(QBluetoothServer); + if (!d->socket) { + d->m_lastError = UnknownError; + emit error(d->m_lastError); + return; + } + d->socket->close(); + delete d->socket; + d->socket = 0; + ppsSendControlMessage("deregister_server", 0x1101, d->m_uuid, QString(), QString(), 0); + // force active object (socket) to run and shutdown socket. + qApp->processEvents(QEventLoop::ExcludeUserInputEvents); +} + +bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port) +{ + Q_UNUSED(address) + Q_D(QBluetoothServer); + if (serverType() != QBluetoothServiceInfo::RfcommProtocol) { + d->m_lastError = UnsupportedProtocolError; + emit error(d->m_lastError); + return false; + } + + // listen has already been called before + if (d->socket && d->socket->state() == QBluetoothSocket::ListeningState) + return true; + + d->socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol); + + //We can not register an actual Rfcomm port, because the platform does not allow it + //but we need a way to associate a server with a service + + if (port == 0) { //Try to assign a non taken port id + for (int i=1; ; i++){ + if (__fakeServerPorts.key(i) == 0) { + port = i; + break; + } + } + } + + if (__fakeServerPorts.key(port) == 0) { + __fakeServerPorts[d] = port; + qCDebug(QT_BT_QNX) << "Port" << port << "registered"; + } else { + qCWarning(QT_BT_QNX) << "server with port" << port << "already registered or port invalid"; + d->m_lastError = ServiceAlreadyRegisteredError; + emit error(d->m_lastError); + return false; + } + + d->socket->setSocketState(QBluetoothSocket::ListeningState); + + ppsRegisterForEvent(QStringLiteral("service_connected"),d); + return true; +} + +void QBluetoothServer::setMaxPendingConnections(int numConnections) +{ + Q_D(QBluetoothServer); + d->maxPendingConnections = numConnections; //Currently not used +} + +QBluetoothAddress QBluetoothServer::serverAddress() const +{ + Q_D(const QBluetoothServer); + if (d->socket) + return d->socket->localAddress(); + else + return QBluetoothAddress(); +} + +quint16 QBluetoothServer::serverPort() const +{ + //Currently we do not have access to the port + Q_D(const QBluetoothServer); + return __fakeServerPorts.value((QBluetoothServerPrivate*)d); +} + +bool QBluetoothServer::hasPendingConnections() const +{ + Q_D(const QBluetoothServer); + return !d->activeSockets.isEmpty(); +} + +QBluetoothSocket *QBluetoothServer::nextPendingConnection() +{ + Q_D(QBluetoothServer); + if (d->activeSockets.isEmpty()) + return 0; + + return d->activeSockets.takeFirst(); +} + +void QBluetoothServer::setSecurityFlags(QBluetooth::SecurityFlags security) +{ + Q_D(QBluetoothServer); + d->securityFlags = security; //not used +} + +QBluetooth::SecurityFlags QBluetoothServer::securityFlags() const +{ + Q_D(const QBluetoothServer); + return d->securityFlags; //not used +} + +QT_END_NAMESPACE + diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -46,20 +46,17 @@ #include "bluez/adapter_p.h" #include "bluez/device_p.h" +#include #include -//#define QT_SERVICEDISCOVERY_DEBUG +QT_BEGIN_NAMESPACE -#ifdef QT_SERVICEDISCOVERY_DEBUG -#include -#endif - -QT_BEGIN_NAMESPACE_BLUETOOTH - -QBluetoothServiceDiscoveryAgentPrivate::QBluetoothServiceDiscoveryAgentPrivate(const QBluetoothAddress &address) -: error(QBluetoothServiceDiscoveryAgent::NoError), state(Inactive), deviceAddress(address), - deviceDiscoveryAgent(0), mode(QBluetoothServiceDiscoveryAgent::MinimalDiscovery), - singleDevice(false), manager(0), device(0) +Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ) + +QBluetoothServiceDiscoveryAgentPrivate::QBluetoothServiceDiscoveryAgentPrivate(const QBluetoothAddress &deviceAdapter) +: error(QBluetoothServiceDiscoveryAgent::NoError), state(Inactive), deviceDiscoveryAgent(0), + mode(QBluetoothServiceDiscoveryAgent::MinimalDiscovery), singleDevice(false), + manager(0), device(0), m_deviceAdapterAddress(deviceAdapter) { qRegisterMetaType("ServiceMap"); qDBusRegisterMetaType(); @@ -75,21 +72,21 @@ { Q_Q(QBluetoothServiceDiscoveryAgent); -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << "Full discovery on: " << address.toString(); -#endif + qCDebug(QT_BT_BLUEZ) << "Full discovery on: " << address.toString(); manager = new OrgBluezManagerInterface(QLatin1String("org.bluez"), QLatin1String("/"), QDBusConnection::systemBus()); + QDBusPendingReply reply; + if (m_deviceAdapterAddress.isNull()) + reply = manager->DefaultAdapter(); + else + reply = manager->FindAdapter(m_deviceAdapterAddress.toString()); - QDBusPendingReply reply = manager->DefaultAdapter(); reply.waitForFinished(); if (reply.isError()) { - if (singleDevice) { - error = QBluetoothServiceDiscoveryAgent::DeviceDiscoveryError; - errorString = QBluetoothServiceDiscoveryAgent::tr("Unable to find default adapter"); - emit q->error(error); - } + error = QBluetoothServiceDiscoveryAgent::InputOutputError; + errorString = QBluetoothServiceDiscoveryAgent::tr("Unable to find appointed local adapter"); + emit q->error(error); _q_serviceDiscoveryFinished(); return; } @@ -108,9 +105,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::stop() { -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << Q_FUNC_INFO << "Stop called"; -#endif + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO << "Stop called"; if(device){ QDBusPendingReply<> reply = device->CancelDiscovery(); reply.waitForFinished(); @@ -120,7 +115,7 @@ Q_Q(QBluetoothServiceDiscoveryAgent); emit q->canceled(); -// qDebug() << "Stop done"; + qCDebug(QT_BT_BLUEZ) << "Stop done"; } } @@ -130,17 +125,13 @@ const QBluetoothAddress &address = watcher->property("_q_BTaddress").value(); -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << Q_FUNC_INFO << "created" << address.toString(); -#endif + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO << "created" << address.toString(); QDBusPendingReply deviceObjectPath = *watcher; if (deviceObjectPath.isError()) { if (deviceObjectPath.error().name() != QLatin1String("org.bluez.Error.AlreadyExists")) { _q_serviceDiscoveryFinished(); -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << "Create device failed Error: " << error << deviceObjectPath.error().name(); -#endif + qCDebug(QT_BT_BLUEZ) << "Create device failed Error: " << error << deviceObjectPath.error().name(); return; } @@ -148,14 +139,12 @@ deviceObjectPath.waitForFinished(); if (deviceObjectPath.isError()) { if (singleDevice) { - error = QBluetoothServiceDiscoveryAgent::DeviceDiscoveryError; + error = QBluetoothServiceDiscoveryAgent::InputOutputError; errorString = QBluetoothServiceDiscoveryAgent::tr("Unable to access device"); emit q->error(error); } _q_serviceDiscoveryFinished(); -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << "Can't find device after creation Error: " << error << deviceObjectPath.error().name(); -#endif + qCDebug(QT_BT_BLUEZ) << "Can't find device after creation Error: " << error << deviceObjectPath.error().name(); return; } } @@ -167,9 +156,7 @@ QDBusPendingReply deviceReply = device->GetProperties(); deviceReply.waitForFinished(); if (deviceReply.isError()) { -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << "GetProperties error: " << error << deviceObjectPath.error().name(); -#endif + qCDebug(QT_BT_BLUEZ) << "GetProperties error: " << error << deviceObjectPath.error().name(); return; } QVariantMap v = deviceReply.value(); @@ -179,9 +166,7 @@ foreach (const QBluetoothUuid &uuid, uuidFilter) pattern += uuid.toString().remove(QLatin1Char('{')).remove(QLatin1Char('}')) + QLatin1Char(' '); -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << Q_FUNC_INFO << "Discover: " << pattern.trimmed(); -#endif + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO << "Discover: " << pattern.trimmed(); QDBusPendingReply discoverReply = device->DiscoverServices(pattern.trimmed()); watcher = new QDBusPendingCallWatcher(discoverReply, q); QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -191,15 +176,11 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_discoveredServices(QDBusPendingCallWatcher *watcher) { -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << Q_FUNC_INFO; -#endif + qCDebug(QT_BT_BLUEZ) << Q_FUNC_INFO; QDBusPendingReply reply = *watcher; if (reply.isError()) { -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << "discoveredServices error: " << error << reply.error().message(); -#endif + qCDebug(QT_BT_BLUEZ) << "discoveredServices error: " << error << reply.error().message(); watcher->deleteLater(); if (singleDevice) { Q_Q(QBluetoothServiceDiscoveryAgent); @@ -213,16 +194,12 @@ ServiceMap map = reply.value(); -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << "Parsing xml" << discoveredDevices.at(0).address().toString() << discoveredDevices.count() << map.count(); -#endif + qCDebug(QT_BT_BLUEZ) << "Parsing xml" << discoveredDevices.at(0).address().toString() << discoveredDevices.count() << map.count(); foreach (const QString &record, reply.value()) { QXmlStreamReader xml(record); -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << "Service xml" << record; -#endif + qCDebug(QT_BT_BLUEZ) << "Service xml" << record; QBluetoothServiceInfo serviceInfo; serviceInfo.setDevice(discoveredDevices.at(0)); @@ -249,13 +226,11 @@ Q_Q(QBluetoothServiceDiscoveryAgent); discoveredServices.append(serviceInfo); -#ifdef QT_SERVICEDISCOVERY_DEBUG - qDebug() << "Discovered services" << discoveredDevices.at(0).address().toString(); -#endif + qCDebug(QT_BT_BLUEZ) << "Discovered services" << discoveredDevices.at(0).address().toString(); emit q->serviceDiscovered(serviceInfo); // could stop discovery, check for state if(discoveryState() == Inactive){ - qDebug() << "Exit discovery after stop"; + qCDebug(QT_BT_BLUEZ) << "Exit discovery after stop"; break; } } @@ -319,13 +294,13 @@ return QVariant::fromValue(sequence); } else { - qWarning("unknown attribute type %s %s", - xml.name().toString().toLocal8Bit().constData(), - xml.attributes().value(QLatin1String("value")).toString().toLocal8Bit().constData()); + qCWarning(QT_BT_BLUEZ) << "unknown attribute type" + << xml.name().toString() + << xml.attributes().value(QLatin1String("value")).toString(); Q_ASSERT(false); xml.skipCurrentElement(); return QVariant(); } } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -44,7 +44,7 @@ #include "qbluetoothdevicediscoveryagent.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE /*! \class QBluetoothServiceDiscoveryAgent @@ -74,9 +74,10 @@ This enum describes errors that can occur during service discovery. - \value NoError No error. - \value DeviceDiscoveryError Error occurred during device discovery. - \value UnknownError An unidentified error occurred. + \value NoError No error has occurred. + \value PoweredOffError The Bluetooth adaptor is powered off, power it on before doing discovery. + \value InputOutputError Writing or reading from the device resulted in an error. + \value UnknownError An unknown error has occurred. */ /*! @@ -98,7 +99,8 @@ /*! \fn QBluetoothServiceDiscoveryAgent::finished() - This signal is emitted when Bluetooth service discovery completes. + This signal is emitted when Bluetooth service discovery completes. This signal will even + be emitted when an error occurred during the service discovery. */ /*! @@ -119,18 +121,14 @@ } /*! - Constructs a new QBluetoothServiceDiscoveryAgent for \a remoteAddress and with \a parent. + Constructs a new QBluetoothServiceDiscoveryAgent for \a deviceAdapter and with \a parent. - If \a remoteAddress is null, services will be discovred on all contactable Bluetooth - devices. + If \a deviceAdapter is null, the default adapter will be used. */ -QBluetoothServiceDiscoveryAgent::QBluetoothServiceDiscoveryAgent(const QBluetoothAddress &remoteAddress, QObject *parent) -: QObject(parent), d_ptr(new QBluetoothServiceDiscoveryAgentPrivate(remoteAddress)) +QBluetoothServiceDiscoveryAgent::QBluetoothServiceDiscoveryAgent(const QBluetoothAddress &deviceAdapter, QObject *parent) +: QObject(parent), d_ptr(new QBluetoothServiceDiscoveryAgentPrivate(deviceAdapter)) { d_ptr->q_ptr = this; - if (!remoteAddress.isNull()) { - d_ptr->singleDevice = true; - } } /*! @@ -196,9 +194,39 @@ } /*! + Sets remote device address to \a address. If \a address is null, services will be discovered + on all contactable Bluetooth devices. A new remote address can only be set while there is + no service discovery in progress; otherwise this function returns false. + +*/ +bool QBluetoothServiceDiscoveryAgent::setRemoteAddress(const QBluetoothAddress &address) +{ + if (isActive()) + return false; + if (!address.isNull()) + d_ptr->singleDevice = true; + d_ptr->deviceAddress = address; + + return true; +} + +/*! + Returns the remote device address. If setRemoteAddress is not called, the function + will return default QBluetoothAddress. + +*/ +QBluetoothAddress QBluetoothServiceDiscoveryAgent::remoteAddress() const +{ + if (d_ptr->singleDevice == true) + return d_ptr->deviceAddress; + else + return QBluetoothAddress(); +} + +/*! Starts service discovery. \a mode specifies the type of service discovery to perform. - On Blackberry devices device discovery may lead to pairing requests. + On BlackBerry devices, device discovery may lead to pairing requests. \sa DiscoveryMode */ @@ -302,11 +330,17 @@ Q_Q(QBluetoothServiceDiscoveryAgent); if (!deviceDiscoveryAgent) { - deviceDiscoveryAgent = new QBluetoothDeviceDiscoveryAgent; +#ifdef QT_BLUEZ_BLUETOOTH + deviceDiscoveryAgent = new QBluetoothDeviceDiscoveryAgent(m_deviceAdapterAddress, q); +#else + deviceDiscoveryAgent = new QBluetoothDeviceDiscoveryAgent(q); +#endif QObject::connect(deviceDiscoveryAgent, SIGNAL(finished()), q, SLOT(_q_deviceDiscoveryFinished())); QObject::connect(deviceDiscoveryAgent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)), q, SLOT(_q_deviceDiscovered(QBluetoothDeviceInfo))); + QObject::connect(deviceDiscoveryAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error)), + q, SLOT(_q_deviceDiscoveryError(QBluetoothDeviceDiscoveryAgent::Error))); } @@ -336,10 +370,12 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_deviceDiscoveryFinished() { if (deviceDiscoveryAgent->error() != QBluetoothDeviceDiscoveryAgent::NoError) { - error = QBluetoothServiceDiscoveryAgent::DeviceDiscoveryError; - + //Forward the device discovery error + error = static_cast(deviceDiscoveryAgent->error()); + errorString = deviceDiscoveryAgent->errorString(); setDiscoveryState(Inactive); Q_Q(QBluetoothServiceDiscoveryAgent); + emit q->error(error); emit q->finished(); return; } @@ -373,6 +409,21 @@ } } +void QBluetoothServiceDiscoveryAgentPrivate::_q_deviceDiscoveryError(QBluetoothDeviceDiscoveryAgent::Error newError) +{ + error = static_cast(newError); + errorString = deviceDiscoveryAgent->errorString(); + + deviceDiscoveryAgent->stop(); + delete deviceDiscoveryAgent; + deviceDiscoveryAgent = 0; + + setDiscoveryState(Inactive); + Q_Q(QBluetoothServiceDiscoveryAgent); + emit q->error(error); + emit q->finished(); +} + /*! Starts service discovery for the next device. */ @@ -380,8 +431,6 @@ { Q_Q(QBluetoothServiceDiscoveryAgent); - setDiscoveryState(ServiceDiscovery); - if (discoveredDevices.isEmpty()) { setDiscoveryState(Inactive); emit q->finished(); @@ -413,4 +462,4 @@ #include "moc_qbluetoothservicediscoveryagent.cpp" -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,8 +48,9 @@ #include #include +#include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothAddress; class QBluetoothServiceDiscoveryAgentPrivate; @@ -61,9 +62,12 @@ public: enum Error { - NoError, - DeviceDiscoveryError, - UnknownError = 100 + NoError = QBluetoothDeviceDiscoveryAgent::NoError, + InputOutputError = QBluetoothDeviceDiscoveryAgent::InputOutputError, + PoweredOffError = QBluetoothDeviceDiscoveryAgent::PoweredOffError, + UnknownError = QBluetoothDeviceDiscoveryAgent::UnknownError //=100 + //New Errors must be added after Unknown Error the space before UnknownError is reserved + //for future device discovery errors }; enum DiscoveryMode { @@ -72,7 +76,7 @@ }; QBluetoothServiceDiscoveryAgent(QObject *parent = 0); - explicit QBluetoothServiceDiscoveryAgent(const QBluetoothAddress &remoteAddress, QObject *parent = 0); + explicit QBluetoothServiceDiscoveryAgent(const QBluetoothAddress &deviceAdapter, QObject *parent = 0); ~QBluetoothServiceDiscoveryAgent(); bool isActive() const; @@ -85,6 +89,8 @@ void setUuidFilter(const QList &uuids); void setUuidFilter(const QBluetoothUuid &uuid); QList uuidFilter() const; + bool setRemoteAddress(const QBluetoothAddress &address); + QBluetoothAddress remoteAddress() const; public Q_SLOTS: void start(DiscoveryMode mode = MinimalDiscovery); @@ -102,6 +108,7 @@ Q_PRIVATE_SLOT(d_func(), void _q_deviceDiscovered(const QBluetoothDeviceInfo &info)) Q_PRIVATE_SLOT(d_func(), void _q_deviceDiscoveryFinished()) + Q_PRIVATE_SLOT(d_func(), void _q_deviceDiscoveryError(QBluetoothDeviceDiscoveryAgent::Error)) Q_PRIVATE_SLOT(d_func(), void _q_serviceDiscoveryFinished()) #ifdef QT_BLUEZ_BLUETOOTH Q_PRIVATE_SLOT(d_func(), void _q_discoveredServices(QDBusPendingCallWatcher*)) @@ -109,6 +116,6 @@ #endif }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,11 +42,11 @@ #include "qbluetoothservicediscoveryagent.h" #include "qbluetoothservicediscoveryagent_p.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE -QBluetoothServiceDiscoveryAgentPrivate::QBluetoothServiceDiscoveryAgentPrivate(const QBluetoothAddress &address) +QBluetoothServiceDiscoveryAgentPrivate::QBluetoothServiceDiscoveryAgentPrivate(const QBluetoothAddress &deviceAdapter) { - Q_UNUSED(address); + Q_UNUSED(deviceAdapter); } QBluetoothServiceDiscoveryAgentPrivate::~QBluetoothServiceDiscoveryAgentPrivate() @@ -62,4 +62,4 @@ { } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -59,18 +59,19 @@ QT_END_NAMESPACE #endif -#ifdef QTM_QNX_BLUETOOTH +#ifdef QT_QNX_BLUETOOTH #include "qnx/ppshelpers_p.h" #include #include +#include #endif -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothDeviceDiscoveryAgent; class QBluetoothServiceDiscoveryAgentPrivate -#ifdef QTM_QNX_BLUETOOTH +#ifdef QT_QNX_BLUETOOTH : public QObject { Q_OBJECT @@ -86,7 +87,7 @@ ServiceDiscovery, }; - QBluetoothServiceDiscoveryAgentPrivate(const QBluetoothAddress &address); + QBluetoothServiceDiscoveryAgentPrivate(const QBluetoothAddress &deviceAdapter); ~QBluetoothServiceDiscoveryAgentPrivate(); void startDeviceDiscovery(); @@ -104,6 +105,7 @@ void _q_deviceDiscoveryFinished(); void _q_deviceDiscovered(const QBluetoothDeviceInfo &info); void _q_serviceDiscoveryFinished(); + void _q_deviceDiscoveryError(QBluetoothDeviceDiscoveryAgent::Error); #ifdef QT_BLUEZ_BLUETOOTH void _q_discoveredServices(QDBusPendingCallWatcher *watcher); void _q_createdDevice(QDBusPendingCallWatcher *watcher); @@ -117,27 +119,28 @@ QVariant readAttributeValue(QXmlStreamReader &xml); #endif -#ifdef QTM_QNX_BLUETOOTH +#ifdef QT_QNX_BLUETOOTH private Q_SLOTS: void remoteDevicesChanged(int fd); void controlReply(ppsResult result); void controlEvent(ppsResult result); + void queryTimeout(); private: int m_rdfd; QSocketNotifier *rdNotifier; + QTimer m_queryTimer; #endif public: QBluetoothServiceDiscoveryAgent::Error error; QString errorString; - + QBluetoothAddress deviceAddress; QList discoveredServices; QList discoveredDevices; private: DiscoveryState state; - QBluetoothAddress deviceAddress; QList uuidFilter; QBluetoothDeviceDiscoveryAgent *deviceDiscoveryAgent; @@ -150,12 +153,13 @@ OrgBluezManagerInterface *manager; OrgBluezAdapterInterface *adapter; OrgBluezDeviceInterface *device; + QBluetoothAddress m_deviceAdapterAddress; #endif protected: QBluetoothServiceDiscoveryAgent *q_ptr; }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -50,30 +50,43 @@ #include +#include + #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE -QBluetoothServiceDiscoveryAgentPrivate::QBluetoothServiceDiscoveryAgentPrivate(const QBluetoothAddress &address) - : m_rdfd(-1), rdNotifier(0), error(QBluetoothServiceDiscoveryAgent::NoError), state(Inactive), deviceAddress(address), +QBluetoothServiceDiscoveryAgentPrivate::QBluetoothServiceDiscoveryAgentPrivate(const QBluetoothAddress &deviceAdapter) + : m_rdfd(-1), rdNotifier(0), error(QBluetoothServiceDiscoveryAgent::NoError), deviceAddress(deviceAdapter), state(Inactive), deviceDiscoveryAgent(0), mode(QBluetoothServiceDiscoveryAgent::MinimalDiscovery) { + ppsRegisterControl(); + connect(&m_queryTimer, SIGNAL(timeout()), this, SLOT(queryTimeout())); + ppsRegisterForEvent(QStringLiteral("service_updated"), this); } QBluetoothServiceDiscoveryAgentPrivate::~QBluetoothServiceDiscoveryAgentPrivate() { + ppsUnregisterForEvent(QStringLiteral("service_updated"), this); + ppsUnregisterControl(this); } void QBluetoothServiceDiscoveryAgentPrivate::start(const QBluetoothAddress &address) { Q_Q(QBluetoothServiceDiscoveryAgent); - qBBBluetoothDebug() << "Starting Service discovery for" << address.toString(); - const char *filePath = QByteArray("/pps/services/bluetooth/remote_devices/").append(address.toString().toUtf8().constData()).constData(); - if ((m_rdfd = qt_safe_open(filePath, O_RDONLY)) == -1) { - qWarning() << "Failed to open " << filePath; - error = QBluetoothServiceDiscoveryAgent::DeviceDiscoveryError; - errorString = QStringLiteral("Failed to open remote device file"); - q->error(error); + qCDebug(QT_BT_QNX) << "Starting Service discovery for" << address.toString(); + const QString filePath = QStringLiteral("/pps/services/bluetooth/remote_devices/").append(address.toString()); + if ((m_rdfd = qt_safe_open(filePath.toLocal8Bit().constData(), O_RDONLY)) == -1) { + if (QFile::exists(filePath + QLatin1String("-00")) || + QFile::exists(filePath + QLatin1String("-01"))) { + qCDebug(QT_BT_QNX) << "LE device discovered...skipping"; + } else { + qCWarning(QT_BT_QNX) << "Failed to open " << filePath; + error = QBluetoothServiceDiscoveryAgent::InputOutputError; + errorString = QBluetoothServiceDiscoveryAgent::tr("Failed to open remote device file"); + q->error(error); + } + _q_serviceDiscoveryFinished(); return; } else { if (rdNotifier) @@ -82,20 +95,25 @@ if (rdNotifier) { connect(rdNotifier, SIGNAL(activated(int)), this, SLOT(remoteDevicesChanged(int))); } else { - qWarning() << "Service Discovery: Failed to connect to rdNotifier"; - error = QBluetoothServiceDiscoveryAgent::DeviceDiscoveryError; - errorString = QStringLiteral("Failed to connect to rdNotifier"); + qCWarning(QT_BT_QNX) << "Service Discovery: Failed to connect to rdNotifier"; + error = QBluetoothServiceDiscoveryAgent::InputOutputError; + errorString = QBluetoothServiceDiscoveryAgent::tr("Failed to connect to notifier"); q->error(error); + _q_serviceDiscoveryFinished(); return; } } - ppsRegisterControl(); - ppsSendControlMessage("service_query", QStringLiteral("{\"addr\":\"%1\"}").arg(address.toString())); - ppsRegisterForEvent(QStringLiteral("service_query"), this); + m_queryTimer.start(10000); + ppsSendControlMessage("service_query", QStringLiteral("{\"addr\":\"%1\"}").arg(address.toString()), this); } void QBluetoothServiceDiscoveryAgentPrivate::stop() { + m_queryTimer.stop(); + discoveredDevices.clear(); + setDiscoveryState(Inactive); + Q_Q(QBluetoothServiceDiscoveryAgent); + emit q->canceled(); if (rdNotifier) delete rdNotifier; rdNotifier = 0; @@ -103,11 +121,12 @@ qt_safe_close (m_rdfd); m_rdfd = -1; } - ppsUnregisterControl(this); } void QBluetoothServiceDiscoveryAgentPrivate::remoteDevicesChanged(int fd) { + if (discoveredDevices.count() == 0) + return; pps_decoder_t ppsDecoder; pps_decoder_initialize(&ppsDecoder, 0); @@ -126,7 +145,7 @@ if (next_service == 0) break; - qBBBluetoothDebug() << Q_FUNC_INFO << "Service" << next_service; + qCDebug(QT_BT_QNX) << Q_FUNC_INFO << "Service" << next_service; QBluetoothServiceInfo serviceInfo; serviceInfo.setDevice(discoveredDevices.at(0)); @@ -141,8 +160,12 @@ if (serviceName.size() == 2) { serviceInfo.setServiceUuid(QBluetoothUuid(QLatin1String(serviceName.last()))); suuid = QBluetoothUuid((quint16)(serviceName.first().toUInt(&ok,16))); - if (suuid == QBluetoothUuid::SerialPort) - protocolDescriptorList << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Rfcomm)); + if (suuid == QBluetoothUuid::SerialPort) { + QBluetoothServiceInfo::Sequence protocol; + protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Rfcomm)) + << QVariant::fromValue(0); + protocolDescriptorList.append(QVariant::fromValue(protocol)); + } } } else { //We do not have anything better, so we set the service class UUID as service UUID @@ -150,7 +173,7 @@ } //Check if the UUID is in the uuidFilter - if (!uuidFilter.isEmpty() && !uuidFilter.contains(suuid)) + if (!uuidFilter.isEmpty() && !uuidFilter.contains(serviceInfo.serviceUuid())) continue; serviceInfo.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList); @@ -161,7 +184,6 @@ serviceInfo.setAttribute(QBluetoothServiceInfo::BrowseGroupList, QBluetoothUuid(QBluetoothUuid::PublicBrowseGroup)); - serviceInfo.setDevice(discoveredDevices.at(0)); bool entryExists = false; //Did we already discover this service? @@ -170,13 +192,13 @@ && sInfo.serviceUuid() == serviceInfo.serviceUuid() && sInfo.serviceClassUuids() == serviceInfo.serviceClassUuids()) { entryExists = true; - //qBBBluetoothDebug() << "Entry exists" << serviceInfo.serviceClassUuids().first() << sInfo.serviceClassUuids().first(); + //qCDebug(QT_BT_QNX) << "Entry exists" << serviceInfo.serviceClassUuids().first() << sInfo.serviceClassUuids().first(); break; } } if (!entryExists) { - qBBBluetoothDebug() << "Adding service" << next_service << " " << serviceInfo.socketProtocol(); + qCDebug(QT_BT_QNX) << "Adding service" << next_service << " " << serviceInfo.socketProtocol(); discoveredServices << serviceInfo; q_ptr->serviceDiscovered(serviceInfo); } @@ -187,12 +209,15 @@ void QBluetoothServiceDiscoveryAgentPrivate::controlReply(ppsResult result) { + qCDebug(QT_BT_QNX) << "Control reply" << result.msg << result.dat; + if (!m_queryTimer.isActive()) + return; + m_queryTimer.stop(); Q_Q(QBluetoothServiceDiscoveryAgent); - qBBBluetoothDebug() << "Control event" << result.msg; if (!result.errorMsg.isEmpty()) { - qWarning() << Q_FUNC_INFO << result.errorMsg; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << result.errorMsg; errorString = result.errorMsg; - error = QBluetoothServiceDiscoveryAgent::DeviceDiscoveryError; + error = QBluetoothServiceDiscoveryAgent::InputOutputError; q->error(error); } else { _q_serviceDiscoveryFinished(); @@ -201,16 +226,27 @@ void QBluetoothServiceDiscoveryAgentPrivate::controlEvent(ppsResult result) { + qCDebug(QT_BT_QNX) << "Control event" << result.msg << result.dat; + if (!m_queryTimer.isActive()) + return; + m_queryTimer.stop(); Q_Q(QBluetoothServiceDiscoveryAgent); - qBBBluetoothDebug() << "Control event" << result.msg; if (!result.errorMsg.isEmpty()) { - qWarning() << Q_FUNC_INFO << result.errorMsg; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << result.errorMsg; errorString = result.errorMsg; - error = QBluetoothServiceDiscoveryAgent::DeviceDiscoveryError; + error = QBluetoothServiceDiscoveryAgent::InputOutputError; q->error(error); } else { _q_serviceDiscoveryFinished(); } } -QT_END_NAMESPACE_BLUETOOTH +void QBluetoothServiceDiscoveryAgentPrivate::queryTimeout() +{ + Q_Q(QBluetoothServiceDiscoveryAgent); + error = QBluetoothServiceDiscoveryAgent::UnknownError; + errorString = QBluetoothServiceDiscoveryAgent::tr("Service query timed out"); + q->error(error); + _q_serviceDiscoveryFinished(); +} +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo_bluez.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo_bluez.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo_bluez.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo_bluez.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -45,9 +45,12 @@ #include "bluez/manager_p.h" #include "bluez/service_p.h" +#include #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE + +Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ) static void writeAttribute(QXmlStreamWriter *stream, const QVariant &attribute) { @@ -163,7 +166,7 @@ } break; default: - qDebug() << "Unknown variant type", attribute.userType(); + qCWarning(QT_BT_BLUEZ) << "Unknown variant type", attribute.userType(); } } @@ -181,12 +184,12 @@ return registered; } -bool QBluetoothServiceInfoPrivate::unregisterService() const +bool QBluetoothServiceInfoPrivate::unregisterService() { if (!registered) return false; - if (!ensureSdpConnection()) + if (!ensureSdpConnection(currentLocalAdapter)) return false; QDBusPendingReply<> reply = service->RemoveRecord(serviceRecord); @@ -200,44 +203,41 @@ return true; } -void QBluetoothServiceInfoPrivate::setRegisteredAttribute(quint16 attributeId, const QVariant &value) const -{ - Q_UNUSED(attributeId); - Q_UNUSED(value); - - registerService(); -} - -void QBluetoothServiceInfoPrivate::removeRegisteredAttribute(quint16 attributeId) const -{ - Q_UNUSED(attributeId); - - registerService(); -} - -bool QBluetoothServiceInfoPrivate::ensureSdpConnection() const +bool QBluetoothServiceInfoPrivate::ensureSdpConnection(const QBluetoothAddress &localAdapter) { - if (service) + if (service && currentLocalAdapter == localAdapter) return true; + delete service; + OrgBluezManagerInterface manager(QLatin1String("org.bluez"), QLatin1String("/"), QDBusConnection::systemBus()); - QDBusPendingReply reply = manager.FindAdapter(QLatin1String("any")); + + QDBusPendingReply reply; + if (localAdapter.isNull()) + reply = manager.DefaultAdapter(); + else + reply = manager.FindAdapter(localAdapter.toString()); reply.waitForFinished(); if (reply.isError()) return false; + currentLocalAdapter = localAdapter; service = new OrgBluezServiceInterface(QLatin1String("org.bluez"), reply.value().path(), - QDBusConnection::systemBus()); + QDBusConnection::systemBus(), this); return true; } -bool QBluetoothServiceInfoPrivate::registerService() const +bool QBluetoothServiceInfoPrivate::registerService(const QBluetoothAddress &localAdapter) { - if (!ensureSdpConnection()) { - qDebug() << "SDP not connected. Cannot register"; + //if new adapter unregister previous one first + if (registered && localAdapter != currentLocalAdapter) + unregisterService(); + + if (!ensureSdpConnection(localAdapter)) { + qCWarning(QT_BT_BLUEZ) << "SDP not connected. Cannot register"; return false; } @@ -266,13 +266,13 @@ stream.writeEndDocument(); -// qDebug() << xmlServiceRecord; + qCDebug(QT_BT_BLUEZ) << xmlServiceRecord; if (!registered) { QDBusPendingReply reply = service->AddRecord(xmlServiceRecord); reply.waitForFinished(); if (reply.isError()) { - qDebug() << "AddRecord returned error" << reply.error(); + qCWarning(QT_BT_BLUEZ) << "AddRecord returned error" << reply.error(); return false; } @@ -281,7 +281,7 @@ QDBusPendingReply<> reply = service->UpdateRecord(serviceRecord, xmlServiceRecord); reply.waitForFinished(); if (reply.isError()) { - qDebug() << "UpdateRecord returned error" << reply.error(); + qCWarning(QT_BT_BLUEZ) << "UpdateRecord returned error" << reply.error(); return false; } } @@ -290,4 +290,4 @@ return true; } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -44,7 +44,7 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE /*! \class QBluetoothServiceInfo::Sequence @@ -93,6 +93,15 @@ Bluetooth service. QBluetoothServiceInfo provides information about a service offered by a Bluetooth device. + In addition it can be used to register new services on the local device. Note that such + a registration only affects the Bluetooth SDP entries. Any server listening + for incoming connections (e.g an RFCOMM server) must be started before registerService() + is called. Deregistration must happen in the reverse order. + + QBluetoothServiceInfo is not a value type in the traditional sense. All copies of the same + service info object share the same data as they do not detach upon changing them. This + ensures that two copies can (de)register the same Bluetooth service. + */ /*! @@ -101,10 +110,12 @@ Bluetooth service attributes. Please check the Bluetooth Core Specification for a more detailed description of these attributes. \value ServiceRecordHandle Specifies a service record from which attributes can be retrieved. - \value ServiceClassIds UUIDs of service classes that the service conforms to. + \value ServiceClassIds UUIDs of service classes that the service conforms to. The + most common service classes are defined in (\l QBluetoothUuid::ServiceClassUuid) \value ServiceRecordState Attibute changes when any other service attribute is added, deleted or modified. \value ServiceId UUID that uniquely identifies the service. - \value ProtocolDescriptorList List of protocols used by the service. + \value ProtocolDescriptorList List of protocols used by the service. The most common protocol Uuids are defined + in \l QBluetoothUuid::ProtocolUuid \value BrowseGroupList List of browse groups the service is in. \value LanguageBaseAttributeIdList List of language base attribute IDs to support human-readable attributes. \value ServiceInfoTimeToLive Number of seconds for which the service record is expected to remain valid and unchanged. @@ -113,7 +124,7 @@ \value DocumentationUrl URL that points to the documentation on the service.. \value ClientExecutableUrl URL that refers to the location of an application that can be used to utilize the service. \value IconUrl URL to the location of the icon representing the service. - \value AdditionalProtocolDescriptorList Additional protocols used by the service. This attribute extends the \l QBluetoothServiceInfo::ProtocolDescriptorList. + \value AdditionalProtocolDescriptorList Additional protocols used by the service. This attribute extends \c ProtocolDescriptorList. \value PrimaryLanguageBase Base index for primary language text descriptors. \value ServiceName Name of the Bluetooth service in the primary language. \value ServiceDescription Description of the Bluetooth service in the primary language. @@ -139,27 +150,31 @@ bool QBluetoothServiceInfo::isRegistered() const { - Q_D(const QBluetoothServiceInfo); - return d->isRegistered(); + return d_ptr->isRegistered(); } /*! - \fn bool QBluetoothServiceInfo::registerService() const + \fn bool QBluetoothServiceInfo::registerService(const QBluetoothAddress &localAdapter) Registers this service with the platform's Service Discovery Protocol (SDP) implementation, making it findable by other devices when they perform service discovery. Returns true if the service is successfully registered, otherwise returns false. Once registered changes to the record cannot be made. The service must be unregistered and registered again with the changes. + + The \a localAdapter parameter determines the local Bluetooth adapter under which + the service should be registered. If \a localAdapter is \c null the default Bluetooth adapter + will be used. If this service info object is already registered via a local adapter + and this is function is called using a different local adapter, the previous registration + is removed and the service reregistered using the new adapter. */ -bool QBluetoothServiceInfo::registerService() const +bool QBluetoothServiceInfo::registerService(const QBluetoothAddress &localAdapter) { - Q_D(const QBluetoothServiceInfo); - return d->registerService(); + return d_ptr->registerService(localAdapter); } /*! - \fn bool QBluetoothServiceInfo::unregisterService() const + \fn bool QBluetoothServiceInfo::unregisterService() Unregisters this service with the platform's Service Discovery Protocol (SDP) implementation. After this, the service will no longer be findable by other devices through service discovery. @@ -167,10 +182,9 @@ Returns true if the service is successfully unregistered, otherwise returns false. */ -bool QBluetoothServiceInfo::unregisterService() const +bool QBluetoothServiceInfo::unregisterService() { - Q_D(const QBluetoothServiceInfo); - return d->unregisterService(); + return d_ptr->unregisterService(); } @@ -180,6 +194,9 @@ This is a convenience function. Sets the attribute identified by \a attributeId to \a value. + + If the service information is already registered with the platform's SDP database, + the database entry will not be updated until \l registerService() was called again. */ /*! @@ -188,6 +205,9 @@ This is a convenience function. Sets the attribute identified by \a attributeId to \a value. + + If the service information is already registered with the platform's SDP database, + the database entry will not be updated until \l registerService() was called again. */ /*! @@ -196,6 +216,9 @@ This is a convenience function. Sets the attribute identified by \a attributeId to \a value. + + If the service information is already registered with the platform's SDP database, + the database entry will not be updated until \l registerService() was called again. */ /*! @@ -324,19 +347,19 @@ Construct a new invalid QBluetoothServiceInfo; */ QBluetoothServiceInfo::QBluetoothServiceInfo() -: d_ptr(new QBluetoothServiceInfoPrivate) + : d_ptr(QSharedPointer(new QBluetoothServiceInfoPrivate)) { - d_ptr->q_ptr = this; } /*! Construct a new QBluetoothServiceInfo that is a copy of \a other. + + The two copies continue to share the same underlying data which does not detach + upon write. */ QBluetoothServiceInfo::QBluetoothServiceInfo(const QBluetoothServiceInfo &other) -: d_ptr(new QBluetoothServiceInfoPrivate) + : d_ptr(other.d_ptr) { - d_ptr->q_ptr = this; - *this = other; } /*! @@ -344,7 +367,6 @@ */ QBluetoothServiceInfo::~QBluetoothServiceInfo() { - delete d_ptr; } /*! @@ -354,9 +376,7 @@ */ bool QBluetoothServiceInfo::isValid() const { - Q_D(const QBluetoothServiceInfo); - - return !d->attributes.isEmpty(); + return !d_ptr->attributes.isEmpty(); } /*! @@ -366,9 +386,7 @@ */ bool QBluetoothServiceInfo::isComplete() const { - Q_D(const QBluetoothServiceInfo); - - return d->attributes.keys().contains(ProtocolDescriptorList); + return d_ptr->attributes.keys().contains(ProtocolDescriptorList); } /*! @@ -376,9 +394,7 @@ */ QBluetoothDeviceInfo QBluetoothServiceInfo::device() const { - Q_D(const QBluetoothServiceInfo); - - return d->deviceInfo; + return d_ptr->deviceInfo; } /*! @@ -386,30 +402,20 @@ */ void QBluetoothServiceInfo::setDevice(const QBluetoothDeviceInfo &device) { - Q_D(QBluetoothServiceInfo); - - d->deviceInfo = device; + d_ptr->deviceInfo = device; } /*! Sets the attribute identified by \a attributeId to \a value. - If the service information is registered with the platforms SDP database, the database entry is also - updated. + If the service information is already registered with the platform's SDP database, + the database entry will not be updated until \l registerService() was called again. \sa isRegistered(), registerService() */ void QBluetoothServiceInfo::setAttribute(quint16 attributeId, const QVariant &value) { - Q_D(QBluetoothServiceInfo); - - if (value.type() == QVariant::List) - qDebug() << "tried attribute with type QVariantList" << value; - - d->attributes[attributeId] = value; - - if (isRegistered()) - d->setRegisteredAttribute(attributeId, value); + d_ptr->attributes[attributeId] = value; } /*! @@ -417,9 +423,7 @@ */ QVariant QBluetoothServiceInfo::attribute(quint16 attributeId) const { - Q_D(const QBluetoothServiceInfo); - - return d->attributes[attributeId]; + return d_ptr->attributes.value(attributeId); } /*! @@ -427,9 +431,7 @@ */ QList QBluetoothServiceInfo::attributes() const { - Q_D(const QBluetoothServiceInfo); - - return d->attributes.keys(); + return d_ptr->attributes.keys(); } /*! @@ -438,22 +440,18 @@ */ bool QBluetoothServiceInfo::contains(quint16 attributeId) const { - Q_D(const QBluetoothServiceInfo); - - return d->attributes.contains(attributeId); + return d_ptr->attributes.contains(attributeId); } /*! Removes the attribute \a attributeId from the QBluetoothServiceInfo object. + + If the service information is already registered with the platforms SDP database, + the database entry will not be updated until \l registerService() was called again. */ void QBluetoothServiceInfo::removeAttribute(quint16 attributeId) { - Q_D(QBluetoothServiceInfo); - - d->attributes.remove(attributeId); - - if (isRegistered()) - d->removeRegisteredAttribute(attributeId); + d_ptr->attributes.remove(attributeId); } /*! @@ -502,14 +500,7 @@ */ int QBluetoothServiceInfo::serverChannel() const { - QBluetoothServiceInfo::Sequence parameters = protocolDescriptor(QBluetoothUuid::Rfcomm); - - if (parameters.isEmpty()) - return -1; - else if (parameters.count() == 1) - return 0; - else - return parameters.at(1).toUInt(); + return d_ptr->serverChannel(); } /*! @@ -519,31 +510,16 @@ */ QBluetoothServiceInfo::Sequence QBluetoothServiceInfo::protocolDescriptor(QBluetoothUuid::ProtocolUuid protocol) const { - if (!contains(QBluetoothServiceInfo::ProtocolDescriptorList)) - return QBluetoothServiceInfo::Sequence(); - - foreach (const QVariant &v, attribute(QBluetoothServiceInfo::ProtocolDescriptorList).value()) { - QBluetoothServiceInfo::Sequence parameters = v.value(); - if(parameters.empty()) - continue; - if (parameters.at(0).userType() == qMetaTypeId()) { - if (parameters.at(0).value() == protocol) - return parameters; - } - } - - return QBluetoothServiceInfo::Sequence(); + return d_ptr->protocolDescriptor(protocol); } /*! Makes a copy of the \a other and assigns it to this QBluetoothServiceInfo object. + The two copies continue to share the same service and registration details. */ QBluetoothServiceInfo &QBluetoothServiceInfo::operator=(const QBluetoothServiceInfo &other) { - Q_D(QBluetoothServiceInfo); - - d->attributes = other.d_func()->attributes; - d->deviceInfo = other.d_func()->deviceInfo; + d_ptr = other.d_ptr; return *this; } @@ -626,4 +602,34 @@ return dbg; } -QT_END_NAMESPACE_BLUETOOTH +QBluetoothServiceInfo::Sequence QBluetoothServiceInfoPrivate::protocolDescriptor(QBluetoothUuid::ProtocolUuid protocol) const +{ + if (!attributes.contains(QBluetoothServiceInfo::ProtocolDescriptorList)) + return QBluetoothServiceInfo::Sequence(); + + foreach (const QVariant &v, attributes.value(QBluetoothServiceInfo::ProtocolDescriptorList).value()) { + QBluetoothServiceInfo::Sequence parameters = v.value(); + if (parameters.empty()) + continue; + if (parameters.at(0).userType() == qMetaTypeId()) { + if (parameters.at(0).value() == protocol) + return parameters; + } + } + + return QBluetoothServiceInfo::Sequence(); +} + +int QBluetoothServiceInfoPrivate::serverChannel() const +{ + QBluetoothServiceInfo::Sequence parameters = protocolDescriptor(QBluetoothUuid::Rfcomm); + + if (parameters.isEmpty()) + return -1; + else if (parameters.count() == 1) + return 0; + else + return parameters.at(1).toUInt(); +} + +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo.h 2014-02-01 20:38:03.000000000 +0000 @@ -45,14 +45,16 @@ #include #include +#include #include #include +#include #include #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothServiceInfoPrivate; class QBluetoothDeviceInfo; @@ -144,27 +146,23 @@ QBluetoothServiceInfo &operator=(const QBluetoothServiceInfo &other); bool isRegistered() const; - bool registerService() const; - bool unregisterService() const; + bool registerService(const QBluetoothAddress &localAdapter = QBluetoothAddress()); + bool unregisterService(); protected: friend Q_BLUETOOTH_EXPORT QDebug operator<<(QDebug, const QBluetoothServiceInfo &); protected: - QBluetoothServiceInfoPrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(QBluetoothServiceInfo) + QSharedPointer d_ptr; }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE -Q_DECLARE_METATYPE(QtBluetooth::QBluetoothServiceInfo) -Q_DECLARE_METATYPE(QtBluetooth::QBluetoothServiceInfo::Sequence) -Q_DECLARE_METATYPE(QtBluetooth::QBluetoothServiceInfo::Alternative) -Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QBluetoothServiceInfo) +Q_DECLARE_METATYPE(QBluetoothServiceInfo::Sequence) +Q_DECLARE_METATYPE(QBluetoothServiceInfo::Alternative) -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE inline void QBluetoothServiceInfo::setAttribute(quint16 attributeId, const QBluetoothUuid &value) { @@ -236,6 +234,6 @@ return attribute(ServiceClassIds).value >(); } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo_p.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,7 +42,7 @@ #include "qbluetoothserviceinfo.h" #include "qbluetoothserviceinfo_p.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE QBluetoothServiceInfoPrivate::QBluetoothServiceInfoPrivate() { @@ -57,26 +57,15 @@ return false; } -bool QBluetoothServiceInfoPrivate::registerService() const +bool QBluetoothServiceInfoPrivate::registerService(const QBluetoothAddress &localAdapter) { + Q_UNUSED(localAdapter); return false; } -bool QBluetoothServiceInfoPrivate::unregisterService() const +bool QBluetoothServiceInfoPrivate::unregisterService() { return false; } - -void QBluetoothServiceInfoPrivate::setRegisteredAttribute(quint16 attributeId, const QVariant &value) const -{ - Q_UNUSED(attributeId); - Q_UNUSED(value); -} - -void QBluetoothServiceInfoPrivate::removeRegisteredAttribute(quint16 attributeId) const -{ - Q_UNUSED(attributeId); -} - -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -43,53 +43,50 @@ #define QBLUETOOTHSERVICEINFO_P_H #include "qbluetoothuuid.h" +#include "qbluetoothaddress.h" #include "qbluetoothdeviceinfo.h" +#include "qbluetoothserviceinfo.h" #include #include class OrgBluezServiceInterface; -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothServiceInfo; class QBluetoothServiceInfoPrivate -#ifdef QTM_QNX_BLUETOOTH -: public QObject + : public QObject { Q_OBJECT -#else -{ -#endif - Q_DECLARE_PUBLIC(QBluetoothServiceInfo) public: QBluetoothServiceInfoPrivate(); ~QBluetoothServiceInfoPrivate(); - bool registerService() const; + bool registerService(const QBluetoothAddress &localAdapter = QBluetoothAddress()); bool isRegistered() const; - bool unregisterService() const; + bool unregisterService(); - void setRegisteredAttribute(quint16 attributeId, const QVariant &value) const; - void removeRegisteredAttribute(quint16 attributeId) const; QBluetoothDeviceInfo deviceInfo; QMap attributes; + + QBluetoothServiceInfo::Sequence protocolDescriptor(QBluetoothUuid::ProtocolUuid protocol) const; + int serverChannel() const; private: #ifdef QT_BLUEZ_BLUETOOTH - bool ensureSdpConnection() const; + bool ensureSdpConnection(const QBluetoothAddress &localAdapter = QBluetoothAddress()); - mutable OrgBluezServiceInterface *service; - mutable quint32 serviceRecord; + OrgBluezServiceInterface *service; + quint32 serviceRecord; + QBluetoothAddress currentLocalAdapter; #endif mutable bool registered; - - QBluetoothServiceInfo *q_ptr; }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo_qnx.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo_qnx.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothserviceinfo_qnx.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothserviceinfo_qnx.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,10 +42,10 @@ #include "qbluetoothserviceinfo.h" #include "qbluetoothserviceinfo_p.h" -#include "qrfcommserver_p.h" -#include "qrfcommserver.h" +#include "qbluetoothserver_p.h" +#include "qbluetoothserver.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE QBluetoothServiceInfoPrivate::QBluetoothServiceInfoPrivate() : registered(false) @@ -54,7 +54,6 @@ QBluetoothServiceInfoPrivate::~QBluetoothServiceInfoPrivate() { - ppsUnregisterControl(0); } bool QBluetoothServiceInfoPrivate::isRegistered() const @@ -62,7 +61,7 @@ return registered; } -bool QBluetoothServiceInfoPrivate::unregisterService() const +bool QBluetoothServiceInfoPrivate::unregisterService() { if (!registered) return false; @@ -70,43 +69,26 @@ return false; } +extern QHash __fakeServerPorts; -void QBluetoothServiceInfoPrivate::setRegisteredAttribute(quint16 attributeId, const QVariant &value) const +bool QBluetoothServiceInfoPrivate::registerService(const QBluetoothAddress& localAdapter) { - Q_UNUSED(attributeId); - Q_UNUSED(value); - - registerService(); -} - -void QBluetoothServiceInfoPrivate::removeRegisteredAttribute(quint16 attributeId) const -{ - Q_UNUSED(attributeId); - registered = false; -} - -extern QHash __fakeServerPorts; - -bool QBluetoothServiceInfoPrivate::registerService() const -{ - Q_Q(const QBluetoothServiceInfo); - if (q->socketProtocol() != QBluetoothServiceInfo::RfcommProtocol) { - qWarning() << Q_FUNC_INFO << "Only SPP services can be registered on QNX"; + Q_UNUSED(localAdapter); //QNX always uses default local adapter + if (protocolDescriptor(QBluetoothUuid::Rfcomm).isEmpty()) { + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "Only SPP services can be registered on QNX"; return false; } - if (q->serverChannel() == -1) + if (serverChannel() == -1) return false; - if (__fakeServerPorts.key(q->serverChannel()) != 0) { - qBBBluetoothDebug() << "Registering server with UUID" << - q->serviceUuid() << " Name" << q->serviceName(); - qDebug() << "Server is" << __fakeServerPorts.key(q->serverChannel()); - if (!ppsSendControlMessage("register_server", 0x1101, q->serviceUuid(), QString(), q->serviceName(), - __fakeServerPorts.key(q->serverChannel()), BT_SPP_SERVER_SUBTYPE)) + if (__fakeServerPorts.key(serverChannel()) != 0) { + if (!ppsSendControlMessage("register_server", 0x1101, attributes.value(QBluetoothServiceInfo::ServiceId).value(), QString(), + attributes.value(QBluetoothServiceInfo::ServiceName).toString(), + __fakeServerPorts.key(serverChannel()), BT_SPP_SERVER_SUBTYPE)) return false; //The server needs to know the service name for the socket mount point path - __fakeServerPorts.key(q->serverChannel())->m_serviceName = q->serviceName(); + __fakeServerPorts.key(serverChannel())->m_serviceName = attributes.value(QBluetoothServiceInfo::ServiceName).toString(); } else { return false; } @@ -115,4 +97,4 @@ return true; } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket_bluez.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket_bluez.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket_bluez.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket_bluez.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -48,6 +48,7 @@ #include +#include #include #include #include @@ -58,11 +59,13 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE + +Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ) QBluetoothSocketPrivate::QBluetoothSocketPrivate() : socket(-1), - socketType(QBluetoothSocket::UnknownSocketType), + socketType(QBluetoothServiceInfo::UnknownProtocol), state(QBluetoothSocket::UnconnectedState), readNotifier(0), connectWriteNotifier(0), @@ -79,7 +82,7 @@ connectWriteNotifier = 0; } -bool QBluetoothSocketPrivate::ensureNativeSocket(QBluetoothSocket::SocketType type) +bool QBluetoothSocketPrivate::ensureNativeSocket(QBluetoothServiceInfo::Protocol type) { if (socket != -1) { if (socketType == type) @@ -95,10 +98,10 @@ socketType = type; switch (type) { - case QBluetoothSocket::L2capSocket: + case QBluetoothServiceInfo::L2capProtocol: socket = ::socket(AF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP); break; - case QBluetoothSocket::RfcommSocket: + case QBluetoothServiceInfo::RfcommProtocol: socket = ::socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); break; default: @@ -130,7 +133,7 @@ Q_UNUSED(openMode); int result = -1; - if (socketType == QBluetoothSocket::RfcommSocket) { + if (socketType == QBluetoothServiceInfo::RfcommProtocol) { sockaddr_rc addr; memset(&addr, 0, sizeof(addr)); @@ -143,7 +146,7 @@ readNotifier->setEnabled(true);QString(); result = ::connect(socket, (sockaddr *)&addr, sizeof(addr)); - } else if (socketType == QBluetoothSocket::L2capSocket) { + } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { sockaddr_l2 addr; memset(&addr, 0, sizeof(addr)); @@ -228,7 +231,7 @@ readNotifier->setEnabled(false); connectWriteNotifier->setEnabled(false); errorString = QString::fromLocal8Bit(strerror(errsv)); - qDebug() << Q_FUNC_INFO << socket << "error:" << readFromDevice << errorString; + qCWarning(QT_BT_BLUEZ) << Q_FUNC_INFO << socket << "error:" << readFromDevice << errorString; if(errsv == EHOSTDOWN) emit q->error(QBluetoothSocket::HostNotFoundError); else @@ -292,7 +295,7 @@ QBluetoothAddress QBluetoothSocketPrivate::localAddress() const { - if (socketType == QBluetoothSocket::RfcommSocket) { + if (socketType == QBluetoothServiceInfo::RfcommProtocol) { sockaddr_rc addr; socklen_t addrLength = sizeof(addr); @@ -301,7 +304,7 @@ convertAddress(addr.rc_bdaddr.b, bdaddr); return QBluetoothAddress(bdaddr); } - } else if (socketType == QBluetoothSocket::L2capSocket) { + } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { sockaddr_l2 addr; socklen_t addrLength = sizeof(addr); @@ -317,13 +320,13 @@ quint16 QBluetoothSocketPrivate::localPort() const { - if (socketType == QBluetoothSocket::RfcommSocket) { + if (socketType == QBluetoothServiceInfo::RfcommProtocol) { sockaddr_rc addr; socklen_t addrLength = sizeof(addr); if (::getsockname(socket, reinterpret_cast(&addr), &addrLength) == 0) return addr.rc_channel; - } else if (socketType == QBluetoothSocket::L2capSocket) { + } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { sockaddr_l2 addr; socklen_t addrLength = sizeof(addr); @@ -341,7 +344,7 @@ quint64 bdaddr; - if (socketType == QBluetoothSocket::RfcommSocket) { + if (socketType == QBluetoothServiceInfo::RfcommProtocol) { sockaddr_rc addr; socklen_t addrLength = sizeof(addr); @@ -349,7 +352,7 @@ return QString(); convertAddress(addr.rc_bdaddr.b, bdaddr); - } else if (socketType == QBluetoothSocket::L2capSocket) { + } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { sockaddr_l2 addr; socklen_t addrLength = sizeof(addr); @@ -358,16 +361,17 @@ convertAddress(addr.l2_bdaddr.b, bdaddr); } else { - qWarning("peerName() called on socket of known type"); + qCWarning(QT_BT_BLUEZ) << "peerName() called on socket of known type"; return QString(); } - const QString address = QBluetoothAddress(bdaddr).toString(); + const QString peerAddress = QBluetoothAddress(bdaddr).toString(); + const QString localAdapter = localAddress().toString(); OrgBluezManagerInterface manager(QLatin1String("org.bluez"), QLatin1String("/"), QDBusConnection::systemBus()); - QDBusPendingReply reply = manager.DefaultAdapter(); + QDBusPendingReply reply = manager.FindAdapter(localAdapter); reply.waitForFinished(); if (reply.isError()) return QString(); @@ -375,13 +379,13 @@ OrgBluezAdapterInterface adapter(QLatin1String("org.bluez"), reply.value().path(), QDBusConnection::systemBus()); - QDBusPendingReply deviceObjectPath = adapter.CreateDevice(address); + QDBusPendingReply deviceObjectPath = adapter.CreateDevice(peerAddress); deviceObjectPath.waitForFinished(); if (deviceObjectPath.isError()) { if (deviceObjectPath.error().name() != QLatin1String("org.bluez.Error.AlreadyExists")) return QString(); - deviceObjectPath = adapter.FindDevice(address); + deviceObjectPath = adapter.FindDevice(peerAddress); deviceObjectPath.waitForFinished(); if (deviceObjectPath.isError()) return QString(); @@ -402,7 +406,7 @@ QBluetoothAddress QBluetoothSocketPrivate::peerAddress() const { - if (socketType == QBluetoothSocket::RfcommSocket) { + if (socketType == QBluetoothServiceInfo::RfcommProtocol) { sockaddr_rc addr; socklen_t addrLength = sizeof(addr); @@ -411,7 +415,7 @@ convertAddress(addr.rc_bdaddr.b, bdaddr); return QBluetoothAddress(bdaddr); } - } else if (socketType == QBluetoothSocket::L2capSocket) { + } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { sockaddr_l2 addr; socklen_t addrLength = sizeof(addr); @@ -427,13 +431,13 @@ quint16 QBluetoothSocketPrivate::peerPort() const { - if (socketType == QBluetoothSocket::RfcommSocket) { + if (socketType == QBluetoothServiceInfo::RfcommProtocol) { sockaddr_rc addr; socklen_t addrLength = sizeof(addr); if (::getpeername(socket, reinterpret_cast(&addr), &addrLength) == 0) return addr.rc_channel; - } else if (socketType == QBluetoothSocket::L2capSocket) { + } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { sockaddr_l2 addr; socklen_t addrLength = sizeof(addr); @@ -511,7 +515,7 @@ } -bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoothSocket::SocketType socketType_, +bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType_, QBluetoothSocket::SocketState socketState, QBluetoothSocket::OpenMode openMode) { Q_Q(QBluetoothSocket); @@ -549,4 +553,4 @@ return buffer.size(); } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 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. @@ -47,43 +48,38 @@ #include "qbluetoothservicediscoveryagent.h" -#include +#include #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE + +Q_DECLARE_LOGGING_CATEGORY(QT_BT) +Q_DECLARE_LOGGING_CATEGORY(QT_BT_QNX) /*! \class QBluetoothSocket \inmodule QtBluetooth \brief The QBluetoothSocket class enables connection to a Bluetooth device - running an RFCOMM server. + running a bluetooth server. - QBluetoothSocket supports two socket types, \l {QBluetoothSocket::L2capSocket}{L2CAP} and - \l {QBluetoothSocket::RfcommSocket}{RFCOMM}. + QBluetoothSocket supports two socket types, \l {QBluetoothServiceInfo::L2capProtocol}{L2CAP} and + \l {QBluetoothServiceInfo::RfcommProtocol}{RFCOMM}. - \l {QBluetoothSocket::L2capSocket}{L2CAP} is a low level datagram-oriented Bluetooth socket. + \l {QBluetoothServiceInfo::L2capProtocol}{L2CAP} is a low level datagram-oriented Bluetooth socket. - \l {QBluetoothSocket::RfcommSocket}{RFCOMM} is a reliable, stream-oriented socket. RFCOMM + \l {QBluetoothServiceInfo::RfcommProtocol}{RFCOMM} is a reliable, stream-oriented socket. RFCOMM sockets emulate an RS-232 serial port. To create a connection to a Bluetooth service, create a socket of the appropriate type and call connectToService() passing the Bluetooth address and port number. QBluetoothSocket will emit the connected() signal when the connection is established. + If the \l {QBluetoothServiceInfo::Protocol}{Protocol} is not supported on a platform, calling + \l connectToService() will emit a \l {QBluetoothSocket::UnsupportedProtocolError}{UnsupportedProtocolError} error. */ /*! - \enum QBluetoothSocket::SocketType - - This enum describes the Bluetooth socket type. - - \value UnknownSocketType Unknown socket type. - \value L2capSocket L2CAP socket. - \value RfcommSocket RFCOMM socket. -*/ - -/*! \enum QBluetoothSocket::SocketState This enum describes the state of the Bluetooth socket. @@ -105,11 +101,11 @@ \value UnknownSocketError An unknown error has occurred. \value NoSocketError No error. Used for testing. - \value ConnectionRefusedError Connection refused or device not available. - \value RemoteHostClosedError The remote host closed the socket - \value HostNotFoundError Could not find the remote host - \value ServiceNotFoundError Could not find the service UUID on remote host + \value HostNotFoundError Could not find the remote host. + \value ServiceNotFoundError Could not find the service UUID on remote host. \value NetworkError Attempt to read or write from socket returned an error + \value UnsupportedProtocolError The \l {QBluetoothServiceInfo::Protocol}{Protocol} is not + supported on this platform. */ /*! @@ -185,6 +181,7 @@ \fn quint16 QBluetoothSocket::localPort() const Returns the port number of the local socket if available, otherwise returns 0. + On BlackBerry, this feature is not supported and returns 0. */ /*! @@ -203,6 +200,7 @@ \fn quint16 QBluetoothSocket::peerPort() const Return the port number of the peer socket if available, otherwise returns 0. + On BlackBerry, this feature is not supported. */ /*! @@ -220,7 +218,7 @@ /*! Constructs a Bluetooth socket of \a socketType type, with \a parent. */ -QBluetoothSocket::QBluetoothSocket(QBluetoothSocket::SocketType socketType, QObject *parent) +QBluetoothSocket::QBluetoothSocket(QBluetoothServiceInfo::Protocol socketType, QObject *parent) : QIODevice(parent), d_ptr(new QBluetoothSocketPrivate) { d_ptr->q_ptr = this; @@ -299,17 +297,23 @@ Q_D(QBluetoothSocket); setOpenMode(openMode); -#ifdef QTM_QNX_BLUETOOTH +#ifdef QT_QNX_BLUETOOTH + if (socketType() != QBluetoothServiceInfo::RfcommProtocol) { + d->socketError = QBluetoothSocket::UnsupportedProtocolError; + d->errorString = tr("Socket type not supported"); + Q_EMIT error(d->socketError); + return; + } d->connectToService(service.device().address(), service.serviceUuid(), openMode); #else if (service.protocolServiceMultiplexer() > 0) { - if (!d->ensureNativeSocket(L2capSocket)) { + if (!d->ensureNativeSocket(QBluetoothServiceInfo::L2capProtocol)) { emit error(UnknownSocketError); return; } d->connectToService(service.device().address(), service.protocolServiceMultiplexer(), openMode); } else if (service.serverChannel() > 0) { - if (!d->ensureNativeSocket(RfcommSocket)) { + if (!d->ensureNativeSocket(QBluetoothServiceInfo::RfcommProtocol)) { emit error(UnknownSocketError); return; } @@ -317,10 +321,10 @@ } else { // try doing service discovery to see if we can find the socket if(service.serviceUuid().isNull()){ - qWarning() << "No port, no PSM, and no UUID provided, unable to connect"; + qCWarning(QT_BT) << "No port, no PSM, and no UUID provided, unable to connect"; return; } - qDebug() << "Need a port/psm, doing discovery"; + qCDebug(QT_BT) << "Need a port/psm, doing discovery"; doDeviceDiscovery(service, openMode); } #endif @@ -337,7 +341,7 @@ ConnectingState, and attempts to connect to \a address. If a connection is established, QBluetoothSocket enters Connected State and emits connected(). - On QNX the service connection can be established directly using the UUID of the remote service. + On BlackBerry, the service connection can be established directly using the UUID of the remote service. At any point, the socket can emit error() to signal that an error occurred. @@ -345,8 +349,14 @@ */ void QBluetoothSocket::connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid, OpenMode openMode) { -#ifdef QTM_QNX_BLUETOOTH +#ifdef QT_QNX_BLUETOOTH Q_D(QBluetoothSocket); + if (socketType() != QBluetoothServiceInfo::RfcommProtocol) { + d->socketError = QBluetoothSocket::UnsupportedProtocolError; + d->errorString = tr("Socket type not supported"); + Q_EMIT error(d->socketError); + return; + } d->connectToService(address, uuid, openMode); #else QBluetoothServiceInfo service; @@ -367,19 +377,23 @@ At any point, the socket can emit error() to signal that an error occurred. - On QNX a connection to a service can not be established using a port. + On BlackBerry, a connection to a service can not be established using a port. Calling this function + will emit a \l {QBluetoothSocket::ServiceNotFoundError}{ServiceNotFoundError} \sa state(), disconnectFromService() */ void QBluetoothSocket::connectToService(const QBluetoothAddress &address, quint16 port, OpenMode openMode) { -#ifdef QTM_QNX_BLUETOOTH + Q_D(QBluetoothSocket); +#ifdef QT_QNX_BLUETOOTH Q_UNUSED(port); Q_UNUSED(openMode); Q_UNUSED(address); - qWarning("Connecting to port is not supported on QNX"); + d->socketError = QBluetoothSocket::ServiceNotFoundError; + d->errorString = tr("Connecting to port is not supported on QNX"); + Q_EMIT error(d->socketError); + qCWarning(QT_BT_QNX) << "Connecting to port is not supported"; #else - Q_D(QBluetoothSocket); setOpenMode(openMode); d->connectToService(address, port, openMode); #endif @@ -388,7 +402,7 @@ /*! Returns the socket type. */ -QBluetoothSocket::SocketType QBluetoothSocket::socketType() const +QBluetoothServiceInfo::Protocol QBluetoothSocket::socketType() const { Q_D(const QBluetoothSocket); return d->socketType; @@ -470,7 +484,8 @@ { Q_D(QBluetoothSocket); - qDebug() << "Starting discovery"; + setSocketState(QBluetoothSocket::ServiceLookupState); + qCDebug(QT_BT) << "Starting discovery"; if(d->discoveryAgent) { delete d->discoveryAgent; @@ -478,7 +493,7 @@ d->discoveryAgent = new QBluetoothServiceDiscoveryAgent(service.device().address(),this); - qDebug() << "Got agent"; + //qDebug() << "Got agent"; connect(d->discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)), this, SLOT(serviceDiscovered(QBluetoothServiceInfo))); connect(d->discoveryAgent, SIGNAL(finished()), this, SLOT(discoveryFinished())); @@ -494,7 +509,7 @@ // we have to ID the service somehow Q_ASSERT(!d->discoveryAgent->uuidFilter().isEmpty()); - qDebug() << "UUID filter" << d->discoveryAgent->uuidFilter(); + qCDebug(QT_BT) << "UUID filter" << d->discoveryAgent->uuidFilter(); d->discoveryAgent->start(QBluetoothServiceDiscoveryAgent::FullDiscovery); } @@ -502,7 +517,7 @@ void QBluetoothSocket::serviceDiscovered(const QBluetoothServiceInfo &service) { Q_D(QBluetoothSocket); - qDebug() << "FOUND SERVICE!" << service; + qCDebug(QT_BT) << "FOUND SERVICE!" << service; if(service.protocolServiceMultiplexer() != 0 || service.serverChannel() != 0) { connectToService(service, d->openMode); d->discoveryAgent->deleteLater(); @@ -512,10 +527,10 @@ void QBluetoothSocket::discoveryFinished() { - qDebug() << "Socket discovery finished"; + qCDebug(QT_BT) << "Socket discovery finished"; Q_D(QBluetoothSocket); - if(d->discoveryAgent){ - qDebug() << "Didn't find any"; + if (d->discoveryAgent){ + qCDebug(QT_BT) << "Didn't find any"; emit error(QBluetoothSocket::ServiceNotFoundError); d->discoveryAgent->deleteLater(); d->discoveryAgent = 0; @@ -602,7 +617,7 @@ */ -bool QBluetoothSocket::setSocketDescriptor(int socketDescriptor, SocketType socketType, +bool QBluetoothSocket::setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType, SocketState socketState, OpenMode openMode) { Q_D(QBluetoothSocket); @@ -628,12 +643,6 @@ case QBluetoothSocket::UnknownSocketError: debug << "QBluetoothSocket::UnknownSocketError"; break; - case QBluetoothSocket::ConnectionRefusedError: - debug << "QBluetoothSocket::ConnectionRefusedError"; - break; - case QBluetoothSocket::RemoteHostClosedError: - debug << "QBluetoothSocket::RemoteHostClosedError"; - break; case QBluetoothSocket::HostNotFoundError: debug << "QBluetoothSocket::HostNotFoundError"; break; @@ -670,6 +679,9 @@ case QBluetoothSocket::ListeningState: debug << "QBluetoothSocket::ListeningState"; break; + case QBluetoothSocket::ServiceLookupState: + debug << "QBluetoothSocket::ServiceLookupState"; + break; default: debug << "QBluetoothSocket::SocketState(" << (int)state << ")"; } @@ -679,4 +691,4 @@ #include "moc_qbluetoothsocket.cpp" -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket.h 2014-02-01 20:38:03.000000000 +0000 @@ -46,11 +46,12 @@ #include #include +#include #include #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothSocketPrivate; class QBluetoothServiceInfo; @@ -60,17 +61,10 @@ Q_OBJECT Q_DECLARE_PRIVATE(QBluetoothSocket) - friend class QRfcommServer; - friend class QRfcommServerPrivate; - friend class QL2capServer; - friend class QL2capServerPrivate; + friend class QBluetoothServer; + friend class QBluetoothServerPrivate; public: - enum SocketType { - UnknownSocketType = -1, - L2capSocket, - RfcommSocket - }; enum SocketState { UnconnectedState = QAbstractSocket::UnconnectedState, @@ -85,14 +79,13 @@ enum SocketError { NoSocketError = -2, UnknownSocketError = QAbstractSocket::UnknownSocketError, - ConnectionRefusedError = QAbstractSocket::ConnectionRefusedError, - RemoteHostClosedError = QAbstractSocket::RemoteHostClosedError, HostNotFoundError = QAbstractSocket::HostNotFoundError, ServiceNotFoundError = QAbstractSocket::SocketAddressNotAvailableError, - NetworkError = QAbstractSocket::NetworkError + NetworkError = QAbstractSocket::NetworkError, + UnsupportedProtocolError }; - explicit QBluetoothSocket(SocketType socketType, QObject *parent = 0); // create socket of type socketType + explicit QBluetoothSocket(QBluetoothServiceInfo::Protocol socketType, QObject *parent = 0); // create socket of type socketType QBluetoothSocket(QObject *parent = 0); // create a blank socket virtual ~QBluetoothSocket(); @@ -126,12 +119,12 @@ //qint64 readBufferSize() const; //void setReadBufferSize(qint64 size); - bool setSocketDescriptor(int socketDescriptor, SocketType socketType, + bool setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType, SocketState socketState = ConnectedState, OpenMode openMode = ReadWrite); int socketDescriptor() const; - SocketType socketType() const; + QBluetoothServiceInfo::Protocol socketType() const; SocketState state() const; SocketError error() const; QString errorString() const; @@ -173,6 +166,6 @@ Q_BLUETOOTH_EXPORT QDebug operator<<(QDebug, QBluetoothSocket::SocketState); #endif -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket_p.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,7 +42,7 @@ #include "qbluetoothsocket.h" #include "qbluetoothsocket_p.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE QBluetoothSocketPrivate::QBluetoothSocketPrivate() { @@ -52,7 +52,7 @@ { } -bool QBluetoothSocketPrivate::ensureNativeSocket(QBluetoothSocket::SocketType type) +bool QBluetoothSocketPrivate::ensureNativeSocket(QBluetoothServiceInfo::Protocol type) { Q_UNUSED(type); return false; @@ -125,7 +125,7 @@ { } -bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoothSocket::SocketType socketType, +bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType, QBluetoothSocket::SocketState socketState, QBluetoothSocket::OpenMode openMode) { Q_UNUSED(socketDescriptor); @@ -145,4 +145,4 @@ return 0; } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -44,7 +44,7 @@ #include "qbluetoothsocket.h" -#ifdef QTM_QNX_BLUETOOTH +#ifdef QT_QNX_BLUETOOTH #include "qnx/ppshelpers_p.h" #endif @@ -57,7 +57,7 @@ QT_FORWARD_DECLARE_CLASS(QSocketNotifier) -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothServiceDiscoveryAgent; @@ -74,7 +74,7 @@ class QBluetoothServiceDiscoveryAgent; class QBluetoothSocketPrivate -#ifdef QTM_QNX_BLUETOOTH +#ifdef QT_QNX_BLUETOOTH : public QObject { Q_OBJECT @@ -88,13 +88,13 @@ ~QBluetoothSocketPrivate(); //On qnx we connect using the uuid not the port -#ifdef QTM_QNX_BLUETOOTH +#ifdef QT_QNX_BLUETOOTH void connectToService(const QBluetoothAddress &address, QBluetoothUuid uuid, QIODevice::OpenMode openMode); #else void connectToService(const QBluetoothAddress &address, quint16 port, QIODevice::OpenMode openMode); #endif - bool ensureNativeSocket(QBluetoothSocket::SocketType type); + bool ensureNativeSocket(QBluetoothServiceInfo::Protocol type); QString localName() const; QBluetoothAddress localAddress() const; @@ -114,7 +114,7 @@ qint64 writeData(const char *data, qint64 maxSize); qint64 readData(char *data, qint64 maxSize); - bool setSocketDescriptor(int socketDescriptor, QBluetoothSocket::SocketType socketType, + bool setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType, QBluetoothSocket::SocketState socketState = QBluetoothSocket::ConnectedState, QBluetoothSocket::OpenMode openMode = QBluetoothSocket::ReadWrite); int socketDescriptor() const; @@ -125,7 +125,7 @@ QPrivateLinearBuffer buffer; QPrivateLinearBuffer txBuffer; int socket; - QBluetoothSocket::SocketType socketType; + QBluetoothServiceInfo::Protocol socketType; QBluetoothSocket::SocketState state; QBluetoothSocket::SocketError socketError; QSocketNotifier *readNotifier; @@ -152,7 +152,7 @@ private: mutable QString m_localName; mutable QString m_peerName; -#ifdef QTM_QNX_BLUETOOTH +#ifdef QT_QNX_BLUETOOTH QBluetoothAddress m_peerAddress; QBluetoothUuid m_uuid; bool isServerSocket; @@ -184,6 +184,6 @@ (quint64(from[5]) << 40); } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket_qnx.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket_qnx.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothsocket_qnx.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothsocket_qnx.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -44,11 +44,11 @@ #include "qbluetoothlocaldevice.h" #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE QBluetoothSocketPrivate::QBluetoothSocketPrivate() : socket(-1), - socketType(QBluetoothSocket::UnknownSocketType), + socketType(QBluetoothServiceInfo::UnknownProtocol), state(QBluetoothSocket::UnconnectedState), readNotifier(0), connectWriteNotifier(0), @@ -65,16 +65,16 @@ close(); } -bool QBluetoothSocketPrivate::ensureNativeSocket(QBluetoothSocket::SocketType type) +bool QBluetoothSocketPrivate::ensureNativeSocket(QBluetoothServiceInfo::Protocol type) { - Q_UNUSED(type); + socketType = type; return false; } void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address, QBluetoothUuid uuid, QIODevice::OpenMode openMode) { Q_UNUSED(openMode); - qBBBluetoothDebug() << "Connecting socket"; + qCDebug(QT_BT_QNX) << "Connecting socket"; if (isServerSocket) { m_peerAddress = address; m_uuid = uuid; @@ -82,7 +82,7 @@ } if (state != QBluetoothSocket::UnconnectedState) { - qBBBluetoothDebug() << "Socket already connected"; + qCDebug(QT_BT_QNX) << "Socket already connected"; return; } state = QBluetoothSocket::ConnectingState; @@ -93,7 +93,7 @@ ppsSendControlMessage("connect_service", 0x1101, uuid, address.toString(), QString(), this, BT_SPP_CLIENT_SUBTYPE); ppsRegisterForEvent(QStringLiteral("service_connected"),this); ppsRegisterForEvent(QStringLiteral("get_mount_point_path"),this); - socketType = QBluetoothSocket::RfcommSocket; + socketType = QBluetoothServiceInfo::RfcommProtocol; } void QBluetoothSocketPrivate::_q_writeNotify() @@ -144,7 +144,7 @@ readNotifier->setEnabled(false); connectWriteNotifier->setEnabled(false); errorString = QString::fromLocal8Bit(strerror(errsv)); - qDebug() << Q_FUNC_INFO << socket << " error:" << readFromDevice << errorString; //TODO Try if this actually works + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << socket << " error:" << readFromDevice << errorString; //TODO Try if this actually works emit q->error(QBluetoothSocket::UnknownSocketError); q->disconnectFromService(); @@ -159,7 +159,7 @@ void QBluetoothSocketPrivate::abort() { Q_Q(QBluetoothSocket); - qBBBluetoothDebug() << "Disconnecting service"; + qCDebug(QT_BT_QNX) << "Disconnecting service"; if (q->state() != QBluetoothSocket::ClosingState) ppsSendControlMessage("disconnect_service", 0x1101, m_uuid, m_peerAddress.toString(), QString(), 0, isServerSocket ? BT_SPP_SERVER_SUBTYPE : BT_SPP_CLIENT_SUBTYPE); @@ -213,7 +213,7 @@ if (q->openMode() & QIODevice::Unbuffered) { if (::write(socket, data, maxSize) != maxSize) { socketError = QBluetoothSocket::NetworkError; - qWarning() << Q_FUNC_INFO << "Socket error"; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "Socket error"; Q_EMIT q->error(socketError); } @@ -250,7 +250,7 @@ abort(); } -bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoothSocket::SocketType socketType, +bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType, QBluetoothSocket::SocketState socketState, QBluetoothSocket::OpenMode openMode) { Q_Q(QBluetoothSocket); @@ -300,34 +300,34 @@ if (result.msg == QStringLiteral("connect_service")) { if (!result.errorMsg.isEmpty()) { - qWarning() << Q_FUNC_INFO << "Error connecting to service:" << result.errorMsg; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "Error connecting to service:" << result.errorMsg; errorString = result.errorMsg; socketError = QBluetoothSocket::UnknownSocketError; emit q->error(QBluetoothSocket::UnknownSocketError); q->setSocketState(QBluetoothSocket::UnconnectedState); return; } else { - qBBBluetoothDebug() << Q_FUNC_INFO << "Sending request for mount point"; + qCDebug(QT_BT_QNX) << Q_FUNC_INFO << "Sending request for mount point"; ppsSendControlMessage("get_mount_point_path", 0x1101, m_uuid, m_peerAddress.toString(), QString(), this, BT_SPP_CLIENT_SUBTYPE); } } else if (result.msg == QStringLiteral("get_mount_point_path")) { QString path; path = result.dat.first(); - qBBBluetoothDebug() << Q_FUNC_INFO << "PATH is" << path; + qCDebug(QT_BT_QNX) << Q_FUNC_INFO << "PATH is" << path; if (!result.errorMsg.isEmpty()) { - qWarning() << Q_FUNC_INFO << result.errorMsg; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << result.errorMsg; errorString = result.errorMsg; socketError = QBluetoothSocket::UnknownSocketError; emit q->error(QBluetoothSocket::UnknownSocketError); q->setSocketState(QBluetoothSocket::UnconnectedState); return; } else { - qBBBluetoothDebug() << "Mount point path is:" << path; + qCDebug(QT_BT_QNX) << "Mount point path is:" << path; socket = ::open(path.toStdString().c_str(), O_RDWR); if (socket == -1) { errorString = QString::fromLocal8Bit(strerror(errno)); - qDebug() << Q_FUNC_INFO << socket << " error:" << errno << errorString; //TODO Try if this actually works + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << socket << " error:" << errno << errorString; //TODO Try if this actually works emit q->error(QBluetoothSocket::UnknownSocketError); q->disconnectFromService(); @@ -358,5 +358,5 @@ } } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransfermanager_bluez.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransfermanager_bluez.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransfermanager_bluez.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransfermanager_bluez.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 "qbluetoothtransfermanager.h" -#include "qbluetoothtransferrequest.h" -#include "qbluetoothtransferreply.h" -#include "qbluetoothtransferreply_bluez_p.h" - -QT_BEGIN_NAMESPACE_BLUETOOTH - -QBluetoothTransferReply *QBluetoothTransferManager::put(const QBluetoothTransferRequest &request, - QIODevice *data) -{ - - QBluetoothTransferReplyBluez *rep = new QBluetoothTransferReplyBluez(data, request); - - connect(rep, SIGNAL(finished(QBluetoothTransferReply*)), this, SIGNAL(finished(QBluetoothTransferReply*))); - - return rep; -} - -QT_END_NAMESPACE_BLUETOOTH diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransfermanager.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransfermanager.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransfermanager.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransfermanager.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -41,8 +41,15 @@ #include "qbluetoothtransfermanager.h" #include "qbluetoothtransferrequest.h" +#include "qbluetoothtransferreply.h" +#ifdef QT_BLUEZ_BLUETOOTH +#include "qbluetoothtransferreply_bluez_p.h" +#elif QT_QNX_BLUETOOTH +#include "qbluetoothtransferreply_qnx_p.h" +#else +#endif -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE /*! \class QBluetoothTransferManager @@ -83,6 +90,23 @@ { } +QBluetoothTransferReply *QBluetoothTransferManager::put(const QBluetoothTransferRequest &request, + QIODevice *data) +{ +#ifdef QT_BLUEZ_BLUETOOTH + QBluetoothTransferReplyBluez *rep = new QBluetoothTransferReplyBluez(data, request, this); + connect(rep, SIGNAL(finished(QBluetoothTransferReply*)), this, SIGNAL(finished(QBluetoothTransferReply*))); + return rep; +#elif QT_QNX_BLUETOOTH + QBluetoothTransferReplyQnx *reply = new QBluetoothTransferReplyQnx(data, request, this); + connect(reply, SIGNAL(finished(QBluetoothTransferReply*)), this, SIGNAL(finished(QBluetoothTransferReply*))); + return reply; +#else + Q_UNUSED(request); + Q_UNUSED(data); + return 0; +#endif +} #include "moc_qbluetoothtransfermanager.cpp" -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransfermanager.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransfermanager.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransfermanager.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransfermanager.h 2014-02-01 20:38:03.000000000 +0000 @@ -49,7 +49,7 @@ QT_FORWARD_DECLARE_CLASS(QIODevice) -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothTransferReply; class QBluetoothTransferRequest; @@ -70,6 +70,6 @@ }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif // QBLUETOOTHTRANSFERMANAGER_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransfermanager_p.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransfermanager_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransfermanager_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransfermanager_p.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 "qbluetoothtransfermanager.h" -#include "qbluetoothtransferrequest.h" -#include "qbluetoothtransferreply.h" - -QT_BEGIN_NAMESPACE_BLUETOOTH - -QBluetoothTransferReply *QBluetoothTransferManager::put(const QBluetoothTransferRequest &request, - QIODevice *data) -{ - Q_UNUSED(request); - Q_UNUSED(data); - return 0; -} - -QT_END_NAMESPACE_BLUETOOTH diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransfermanager_qnx.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransfermanager_qnx.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransfermanager_qnx.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransfermanager_qnx.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** 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 "qbluetoothtransferreply_qnx_p.h" -#include - -QT_BEGIN_NAMESPACE_BLUETOOTH - -QBluetoothTransferReply *QBluetoothTransferManager::put(const QBluetoothTransferRequest &request, - QIODevice *data) -{ - - QBluetoothTransferReplyQnx *reply = new QBluetoothTransferReplyQnx(data, request); - - connect(reply, SIGNAL(finished(QBluetoothTransferReply*)), this, SIGNAL(finished(QBluetoothTransferReply*))); - - return reply; -} - -QT_END_NAMESPACE_BLUETOOTH diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply_bluez.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply_bluez.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply_bluez.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply_bluez.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -49,27 +49,28 @@ #include "bluez/obex_transfer_p.h" #include "qbluetoothtransferreply.h" +#include #include #include #include static const QLatin1String agentPath("/qt/agent"); -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE + +Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ) QBluetoothTransferReplyBluez::QBluetoothTransferReplyBluez(QIODevice *input, const QBluetoothTransferRequest &request, - QObject *parent) + QBluetoothTransferManager *parent) : QBluetoothTransferReply(parent), tempfile(0), source(input), m_running(false), m_finished(false), m_size(0), m_error(QBluetoothTransferReply::NoError), m_errorStr(), m_transfer_path() { setRequest(request); + setManager(parent); client = new OrgOpenobexClientInterface(QLatin1String("org.openobex.client"), QLatin1String("/"), QDBusConnection::sessionBus()); -// manager = new OrgOpenobexManagerInterface(QLatin1String("org.openobex"), QLatin1String("/"), -// QDBusConnection::sessionBus()); - qsrand(QTime::currentTime().msec()); m_agent_path = agentPath; m_agent_path.append(QString::fromLatin1("/%1").arg(qrand())); @@ -77,11 +78,12 @@ agent = new AgentAdaptor(this); bool res = QDBusConnection::sessionBus().registerObject(m_agent_path, this); -// res = QDBusConnection::sessionBus().registerService("org.qt.bt"); if(!res) - qDebug() << "Failed Creating dbus objects"; + qCWarning(QT_BT_BLUEZ) << "Failed Creating dbus objects"; + qRegisterMetaType("QBluetoothTransferReply*"); QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection); + m_running = true; } /*! @@ -95,15 +97,13 @@ bool QBluetoothTransferReplyBluez::start() { - m_running = true; - // qDebug() << "Got a:" << source->metaObject()->className(); QFile *file = qobject_cast(source); if(!file){ tempfile = new QTemporaryFile(this ); tempfile->open(); -// qDebug() << "Not a QFile, making a copy" << tempfile->fileName(); + qCDebug(QT_BT_BLUEZ) << "Not a QFile, making a copy" << tempfile->fileName(); QFutureWatcher *watcher = new QFutureWatcher(); QObject::connect(watcher, SIGNAL(finished()), this, SLOT(copyDone())); @@ -112,6 +112,22 @@ watcher->setFuture(results); } else { + if (!file->exists()) { + m_errorStr = QBluetoothTransferReply::tr("File does not exist"); + m_error = QBluetoothTransferReply::FileNotFoundError; + m_finished = true; + m_running = false; + QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this)); + return false; + } + if (request().address().isNull()) { + m_errorStr = QBluetoothTransferReply::tr("Invalid target address"); + m_error = QBluetoothTransferReply::HostNotFoundError; + m_finished = true; + m_running = false; + QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this)); + return false; + } m_size = file->size(); startOPP(file->fileName()); } @@ -158,19 +174,20 @@ void QBluetoothTransferReplyBluez::sendReturned(QDBusPendingCallWatcher *watcher) { - QDBusPendingReply<> sendReply = *watcher; if(sendReply.isError()){ - qDebug() << "Failed to send file"<< sendReply.isError() << sendReply.error().message(); m_finished = true; m_running = false; m_errorStr = sendReply.error().message(); - if(m_errorStr == QLatin1String("Could not open file for sending")) + if (m_errorStr == QStringLiteral("Could not open file for sending")) { m_error = QBluetoothTransferReply::FileNotFoundError; - else if(m_errorStr == QLatin1String("The transfer was canceled")) + m_errorStr = tr("Could not open file for sending"); + } else if (m_errorStr == QStringLiteral("The transfer was canceled")) { m_error = QBluetoothTransferReply::UserCanceledTransferError; - else + m_errorStr = tr("The transfer was canceled"); + } else { m_error = QBluetoothTransferReply::UnknownError; + } // allow time for the developer to connect to the signal QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this)); @@ -202,10 +219,15 @@ m_finished = true; m_running = false; m_errorStr = in1; - if (in1 == QLatin1String("Could not open file for sending")) + if (in1 == QStringLiteral("Could not open file for sending")) { m_error = QBluetoothTransferReply::FileNotFoundError; - else + m_errorStr = tr("Could not open file for sending"); + } else if (in1 == QStringLiteral("Operation canceled")) { + m_error = QBluetoothTransferReply::UserCanceledTransferError; + m_errorStr = tr("Operation canceled"); + } else { m_error = QBluetoothTransferReply::UnknownError; + } emit finished(this); } @@ -253,7 +275,7 @@ QDBusPendingReply<> reply = xfer->Cancel(); reply.waitForFinished(); if(reply.isError()){ - qDebug() << "Failed to abort transfer" << reply.error(); + qCWarning(QT_BT_BLUEZ) << "Failed to abort transfer" << reply.error(); } delete xfer; } @@ -261,4 +283,4 @@ #include "moc_qbluetoothtransferreply_bluez_p.cpp" -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply_bluez_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply_bluez_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply_bluez_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply_bluez_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -54,7 +54,7 @@ class OrgOpenobexManagerInterface; class AgentAdaptor; -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class Q_BLUETOOTH_EXPORT QBluetoothTransferReplyBluez : public QBluetoothTransferReply { @@ -62,7 +62,7 @@ public: explicit QBluetoothTransferReplyBluez(QIODevice *input, const QBluetoothTransferRequest &request, - QObject *parent = 0); + QBluetoothTransferManager *parent = 0); ~QBluetoothTransferReplyBluez(); bool isFinished() const; @@ -112,6 +112,6 @@ }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif // QBLUETOOTHTRANSFERREPLY_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -39,12 +39,11 @@ ** ****************************************************************************/ - #include "qbluetoothtransferreply.h" #include "qbluetoothtransferreply_p.h" #include "qbluetoothaddress.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE /*! \class QBluetoothTransferReply @@ -80,7 +79,6 @@ */ void QBluetoothTransferReply::abort() { - } /*! @@ -127,7 +125,7 @@ /*! Returns the QBluetoothTransferManager that was used to create this QBluetoothTransferReply - object. + object. Initially, it is also the parent object. */ QBluetoothTransferManager *QBluetoothTransferReply::manager() const { @@ -186,4 +184,4 @@ #include "moc_qbluetoothtransferreply.cpp" -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply.h 2014-02-01 20:38:03.000000000 +0000 @@ -47,7 +47,7 @@ #include #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothTransferReplyPrivate; @@ -97,8 +97,6 @@ }; -QT_END_NAMESPACE_BLUETOOTH - -Q_DECLARE_METATYPE(QtBluetooth::QBluetoothTransferReply *) +QT_END_NAMESPACE #endif // QBLUETOOTHTRANSFERREPLY_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -44,7 +44,7 @@ #include "qbluetoothtransferreply.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class Q_BLUETOOTH_EXPORT QBluetoothTransferReplyPrivate { @@ -60,6 +60,6 @@ }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif // QBLUETOOTHTRANSFERREPLY_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply_qnx.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply_qnx.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply_qnx.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply_qnx.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -1,6 +1,7 @@ /*************************************************************************** ** ** Copyright (C) 2013 Research In Motion +** Copyright (C) 2013 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. @@ -58,14 +59,17 @@ //static const QLatin1String agentPath("/shared/tmp/opp"); -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE QBluetoothTransferReplyQnx::QBluetoothTransferReplyQnx(QIODevice *input, const QBluetoothTransferRequest &request, - QObject *parent) + QBluetoothTransferManager *parent) : QBluetoothTransferReply(parent), tempfile(0), source(input), m_running(false), m_finished(false), m_error(QBluetoothTransferReply::NoError), m_errorStr() { + setRequest(request); + setManager(parent); + ppsRegisterControl(); //qsrand(QTime::currentTime().msec()); //m_agent_path = agentPath; @@ -75,6 +79,7 @@ ppsRegisterForEvent(QStringLiteral("opp_cancelled"), this); QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection); + m_running = true; } /*! @@ -87,7 +92,6 @@ bool QBluetoothTransferReplyQnx::start() { - m_running = true; m_error = QBluetoothTransferReply::NoError; m_errorStr = QString(); @@ -109,6 +113,22 @@ Q_EMIT finished(this); } else { + if (!file->exists()) { + m_errorStr = QBluetoothTransferReply::tr("File does not exist"); + m_error = QBluetoothTransferReply::FileNotFoundError; + m_finished = true; + m_running = false; + QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this)); + return false; + } + if (request().address().isNull()) { + m_errorStr = QBluetoothTransferReply::tr("Invalid target address"); + m_error = QBluetoothTransferReply::HostNotFoundError; + m_finished = true; + m_running = false; + QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this)); + return false; + } startOPP(file->fileName()); } return true; @@ -130,14 +150,14 @@ void QBluetoothTransferReplyQnx::copyDone() { - qBBBluetoothDebug() << "Copy done"; + qCDebug(QT_BT_QNX) << "Copy done"; startOPP(tempfile->fileName()); QObject::sender()->deleteLater(); } void QBluetoothTransferReplyQnx::startOPP(QString filename) { - qBBBluetoothDebug() << "Sending Push object command"; + qCDebug(QT_BT_QNX) << "Sending Push object command"; ppsSendOpp("push_object", filename.toUtf8(), request().address(), this); } @@ -162,7 +182,7 @@ void QBluetoothTransferReplyQnx::controlEvent(ppsResult result) { if (result.msg == QStringLiteral("opp_cancelled")) { - qBBBluetoothDebug() << "opp cancelled" << result.errorMsg << result.error; + qCDebug(QT_BT_QNX) << "opp cancelled" << result.errorMsg << result.error; if (m_running) return; m_finished = true; @@ -181,16 +201,20 @@ Q_EMIT finished(this); } else if (result.msg == QStringLiteral("opp_update")) { bool ok; - int sentBytes = result.dat.at(result.dat.indexOf(QStringLiteral("sent")) + 1).toInt(&ok); - if (!ok) + qint64 sentBytes = result.dat.at(result.dat.indexOf(QStringLiteral("sent")) + 1).toDouble(&ok); + if (!ok) { + qCWarning(QT_BT_QNX) << "Could not convert sent bytes"; return; - int totalBytes = result.dat.at(result.dat.indexOf(QStringLiteral("total")) + 1).toInt(&ok); - if (!ok) + } + qint64 totalBytes = result.dat.at(result.dat.indexOf(QStringLiteral("total")) + 1).toDouble(&ok); + if (!ok) { + qCWarning(QT_BT_QNX) << "Could not convert total bytes"; return; - qBBBluetoothDebug() << "opp update" << sentBytes << totalBytes; + } + qCDebug(QT_BT_QNX) << "opp update" << sentBytes << totalBytes; Q_EMIT transferProgress(sentBytes, totalBytes); } else if (result.msg == QStringLiteral("opp_complete")) { - qBBBluetoothDebug() << "opp complete"; + qCDebug(QT_BT_QNX) << "opp complete"; m_finished = true; m_running = false; Q_EMIT finished(this); @@ -220,4 +244,4 @@ #include "moc_qbluetoothtransferreply_qnx_p.cpp" -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply_qnx_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply_qnx_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferreply_qnx_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferreply_qnx_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -55,7 +55,7 @@ #include "qnx/ppshelpers_p.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class Q_BLUETOOTH_EXPORT QBluetoothTransferReplyQnx : public QBluetoothTransferReply { @@ -63,7 +63,7 @@ public: explicit QBluetoothTransferReplyQnx(QIODevice *input, const QBluetoothTransferRequest &request, - QObject *parent = 0); + QBluetoothTransferManager *parent = 0); ~QBluetoothTransferReplyQnx(); bool isFinished() const; @@ -97,6 +97,6 @@ void abort(); }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif // QBLUETOOTHTRANSFERREPLY_QNX_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferrequest.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferrequest.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferrequest.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferrequest.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -44,7 +44,7 @@ #include "qbluetoothtransferrequest_p.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE /*! \class QBluetoothTransferRequest @@ -181,4 +181,4 @@ { } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferrequest.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferrequest.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferrequest.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferrequest.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothAddress; class QBluetoothTransferRequestPrivate; @@ -64,7 +64,7 @@ NameAttribute }; - QBluetoothTransferRequest(const QBluetoothAddress &address = QBluetoothAddress()); + explicit QBluetoothTransferRequest(const QBluetoothAddress &address = QBluetoothAddress()); QBluetoothTransferRequest(const QBluetoothTransferRequest &other); ~QBluetoothTransferRequest(); @@ -85,6 +85,6 @@ }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif // QBLUETOOTHTRANSFERREQUEST_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferrequest_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferrequest_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothtransferrequest_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothtransferrequest_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -45,7 +45,7 @@ #include #include "qbluetoothtransferrequest.h" -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE class QBluetoothAddress; @@ -58,6 +58,6 @@ QMap m_parameters; }; -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif // QBLUETOOTHTRANSFERREQUESTPRIVATE_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothuuid.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothuuid.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothuuid.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothuuid.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,16 +42,11 @@ #include "qbluetoothuuid.h" #include - -#include - #include -//#include -//#include #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE // Bluetooth base UUID 00000000-0000-1000-8000-00805F9B34FB // TODO: make more efficient @@ -96,6 +91,8 @@ \value McapControlChannel Multi-Channel Adaptation Protocol UUID \value McapDataChannel Multi-Channel Adaptation Protocol UUID \value L2cap L2CAP protocol UUID + + \sa QBluetoothServiceInfo::ProtocolDescriptorList */ /*! @@ -161,6 +158,8 @@ \value HDP Health Device Profile \value HDPSource Health Device Profile \value HDPSink Health Device Profile + + \sa QBluetoothServiceInfo::ServiceClassIds */ /*! @@ -358,4 +357,4 @@ return QUuid::operator==(other); } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothuuid.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothuuid.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qbluetoothuuid.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qbluetoothuuid.h 2014-02-01 20:38:03.000000000 +0000 @@ -50,7 +50,7 @@ #include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE struct quint128 { @@ -172,8 +172,8 @@ return debug; } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE -Q_DECLARE_METATYPE(QtBluetooth::QBluetoothUuid) +Q_DECLARE_METATYPE(QBluetoothUuid) #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/ql2capserver_bluez.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/ql2capserver_bluez.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/ql2capserver_bluez.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/ql2capserver_bluez.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,248 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 "ql2capserver.h" -#include "ql2capserver_p.h" -#include "qbluetoothsocket.h" - -#include - -#include - -#include -#include - -#include - -QT_BEGIN_NAMESPACE_BLUETOOTH - -static inline void convertAddress(quint64 from, quint8 (&to)[6]) -{ - to[0] = (from >> 0) & 0xff; - to[1] = (from >> 8) & 0xff; - to[2] = (from >> 16) & 0xff; - to[3] = (from >> 24) & 0xff; - to[4] = (from >> 32) & 0xff; - to[5] = (from >> 40) & 0xff; -} - -QL2capServerPrivate::QL2capServerPrivate() -: pending(false), maxPendingConnections(1), socketNotifier(0) -{ - socket = new QBluetoothSocket(QBluetoothSocket::L2capSocket); -} - -QL2capServerPrivate::~QL2capServerPrivate() -{ - qDebug() << "Deleted"; - delete socketNotifier; - - delete socket; -} - -void QL2capServerPrivate::_q_newConnection() -{ - // disable socket notifier until application calls nextPendingConnection(). - socketNotifier->setEnabled(false); - - emit q_ptr->newConnection(); -} - -void QL2capServer::close() -{ - Q_D(QL2capServer); - - d->socket->close(); -} - -bool QL2capServer::listen(const QBluetoothAddress &address, quint16 port) -{ - Q_D(QL2capServer); - - int sock = d->socket->socketDescriptor(); - if (sock < 0) - return false; - - sockaddr_l2 addr; - - memset(&addr, 0, sizeof(sockaddr_l2)); - addr.l2_family = AF_BLUETOOTH; - addr.l2_psm = port; - - if (!address.isNull()) - convertAddress(address.toUInt64(), addr.l2_bdaddr.b); - else - convertAddress(Q_UINT64_C(0), addr.l2_bdaddr.b); - - if (::bind(sock, reinterpret_cast(&addr), sizeof(sockaddr_l2)) < 0) - return false; - - if (::listen(sock, d->maxPendingConnections) < 0) - return false; - - d->socket->setSocketState(QBluetoothSocket::ListeningState); - - delete d->socketNotifier; - - d->socketNotifier = new QSocketNotifier(d->socket->socketDescriptor(), - QSocketNotifier::Read); - connect(d->socketNotifier, SIGNAL(activated(int)), this, SLOT(_q_newConnection())); - - return true; -} - -void QL2capServer::setMaxPendingConnections(int numConnections) -{ - Q_D(QL2capServer); - - if (d->socket->state() == QBluetoothSocket::UnconnectedState) - d->maxPendingConnections = numConnections; -} - -bool QL2capServer::hasPendingConnections() const -{ - Q_D(const QL2capServer); - - if (!d || !d->socketNotifier) - return false; - - // if the socket notifier is disable there is a pending connection waiting for us to accept. - return !d->socketNotifier->isEnabled(); -} - -QBluetoothSocket *QL2capServer::nextPendingConnection() -{ - Q_D(QL2capServer); - - if (!hasPendingConnections()) - return 0; - - sockaddr_l2 addr; - socklen_t length = sizeof(sockaddr_l2); - - int pending = ::accept(d->socket->socketDescriptor(), - reinterpret_cast(&addr), &length); - if (pending >= 0) { - QBluetoothSocket *newSocket = new QBluetoothSocket; - newSocket->setSocketDescriptor(pending, QBluetoothSocket::L2capSocket); - - d->socketNotifier->setEnabled(true); - - return newSocket; - } else { -// qDebug() << "Hmm, could have sworn there was a connection waiting to be accepted!" << errno; - d->socketNotifier->setEnabled(true); - } - - return 0; -} - -QBluetoothAddress QL2capServer::serverAddress() const -{ - Q_D(const QL2capServer); - - return d->socket->localAddress(); -} - -quint16 QL2capServer::serverPort() const -{ - Q_D(const QL2capServer); - - return d->socket->localPort(); -} - -void QL2capServer::setSecurityFlags(QBluetooth::SecurityFlags security) -{ - Q_D(QL2capServer); - - int lm = 0; - if(security == QBluetooth::NoSecurity){ - lm = 0; - } - if(security.testFlag(QBluetooth::Authorization)){ - lm |= L2CAP_LM_AUTH; - } - if(security.testFlag(QBluetooth::Authentication)){ - lm |= L2CAP_LM_TRUSTED; - } - if(security.testFlag(QBluetooth::Encryption)){ - lm |= L2CAP_LM_ENCRYPT; - } - if(security.testFlag(QBluetooth::Secure)){ - lm |= L2CAP_LM_SECURE; - } - - if(setsockopt(d->socket->socketDescriptor(), SOL_L2CAP, L2CAP_LM, &lm, sizeof(lm)) < 0){ - qWarning() << "Failed to set socket option, closing socket for safety" << errno; - qWarning() << "Error: " << strerror(errno); - d->socket->close(); - } -} - -QBluetooth::SecurityFlags QL2capServer::securityFlags() const -{ - Q_D(const QL2capServer); - - int lm = 0; - int len = sizeof(lm); - int security = QBluetooth::NoSecurity; - - if(getsockopt(d->socket->socketDescriptor(), SOL_L2CAP, L2CAP_LM, &lm, (socklen_t *)&len) < 0) { - qWarning() << "Failed to get security flags" << strerror(errno); - return QBluetooth::NoSecurity; - } - - if(lm & L2CAP_LM_SECURE) - security |= QBluetooth::Secure; - - if(lm & L2CAP_LM_ENCRYPT) - security |= QBluetooth::Encryption; - - if(lm & L2CAP_LM_TRUSTED) - security |= QBluetooth::Authentication; - - if(lm & L2CAP_LM_AUTH) - security |= QBluetooth::Authorization; - - return static_cast(security); -} - -QT_END_NAMESPACE_BLUETOOTH diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/ql2capserver.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/ql2capserver.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/ql2capserver.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/ql2capserver.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,180 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 "ql2capserver.h" -#include "ql2capserver_p.h" -#include "qbluetoothsocket.h" - -QT_BEGIN_NAMESPACE_BLUETOOTH - -/*! - \class QL2capServer - \inmodule QtBluetooth - \brief The QL2capServer class allows you to connect to a service using the - L2CAP protocol. - - QL2capServer is used to implement Bluetooth services over L2CAP. - - Start listening for incoming connections with listen(). Wait till the newConnection() signal - is emitted when the connection is established, and call nextPendingConnection() to get a QBluetoothSocket - for the connection. - - To enable other devices to find your service, create a QBluetoothServiceInfo with the applicable - attributes for your service and register it using QBluetoothServiceInfo::registerService(). Call - serverPort() to get the L2CAP port number that is being used. - - \sa QBluetoothServiceInfo, QBluetoothSocket -*/ - -/*! - \fn void QL2capServer::newConnection() - - This signal is emitted when a new connection is available. - - The connected slot should call nextPendingConnection() to get a QBluetoothSocket object to send - and receive data over the connection. - - \sa nextPendingConnection(), hasPendingConnections() -*/ - -/*! - \fn void QL2capServer::close() - - Closes and resets the listening socket. -*/ - -/*! - \fn bool QL2capServer::listen(const QBluetoothAddress &address, quint16 port) - - Start listening for incoming connections to \a address on \a port. - - Returns true if the operation succeeded and the L2CAP server is listening for incoming - connections, otherwise returns false. - - \sa isListening(), newConnection() -*/ - -/*! - \fn void QL2capServer::setMaxPendingConnections(int numConnections) - - Sets the maximum number of pending connections to \a numConnections. - - \sa maxPendingConnections() -*/ - -/*! - \fn bool QL2capServer::hasPendingConnections() const - - Returns true if a connection is pending, otherwise false. -*/ - -/*! - \fn QBluetoothSocket *QL2capServer::nextPendingConnection() - - Returns a pointer to a QBluetoothSocket for the next pending connection. It is the callers - responsibility to delete the pointer. -*/ - -/*! - \fn QBluetoothAddress QL2capServer::serverAddress() const - - Returns the server address. -*/ - -/*! - \fn quint16 QL2capServer::serverPort() const - - Returns the server port number. -*/ - -/*! - Constructs an L2CAP server with \a parent. -*/ -QL2capServer::QL2capServer(QObject *parent) -: QObject(parent), d_ptr(new QL2capServerPrivate) -{ - d_ptr->q_ptr = this; -} - -/*! - Destroys the L2CAP server. -*/ -QL2capServer::~QL2capServer() -{ - delete d_ptr; -} - -/*! - Returns true if the L2CAP server is listening for incoming connections, otherwise false. -*/ -bool QL2capServer::isListening() const -{ - Q_D(const QL2capServer); - - return d->socket->state() == QBluetoothSocket::ListeningState; -} - -/*! - Returns the maximum number of pending connections. - - \sa setMaxPendingConnections() -*/ -int QL2capServer::maxPendingConnections() const -{ - Q_D(const QL2capServer); - - return d->maxPendingConnections; -} - -/*! - \fn void QL2capServer::setSecurityFlags(QBluetooth::SecurityFlags security) - Sets the Bluetooth security flags to \a security. This function must be called before calling listen(). -*/ - -/*! - \fn QBluetooth::SecurityFlags QL2capServer::securityFlags() const - - Returns the Bluetooth security flags. -*/ - -#include "moc_ql2capserver.cpp" - -QT_END_NAMESPACE_BLUETOOTH diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/ql2capserver.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/ql2capserver.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/ql2capserver.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/ql2capserver.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 QL2CAPSERVER_H -#define QL2CAPSERVER_H - -#include - -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE_BLUETOOTH - -class QL2capServerPrivate; -class QBluetoothSocket; - -class Q_BLUETOOTH_EXPORT QL2capServer : public QObject -{ - Q_OBJECT - -public: - QL2capServer(QObject *parent = 0); - ~QL2capServer(); - - void close(); - - bool listen(const QBluetoothAddress &address = QBluetoothAddress(), quint16 port = 0); - bool isListening() const; - - void setMaxPendingConnections(int numConnections); - int maxPendingConnections() const; - - bool hasPendingConnections() const; - QBluetoothSocket *nextPendingConnection(); - - QBluetoothAddress serverAddress() const; - quint16 serverPort() const; - - void setSecurityFlags(QBluetooth::SecurityFlags security); - QBluetooth::SecurityFlags securityFlags() const; - -Q_SIGNALS: - void newConnection(); - -protected: - QL2capServerPrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(QL2capServer) - -#ifdef QT_BLUEZ_BLUETOOTH - Q_PRIVATE_SLOT(d_func(), void _q_newConnection()) -#endif - -}; - -QT_END_NAMESPACE_BLUETOOTH - -#endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/ql2capserver_p.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/ql2capserver_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/ql2capserver_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/ql2capserver_p.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 "ql2capserver.h" -#include "ql2capserver_p.h" -#include "qbluetoothsocket.h" - -QT_BEGIN_NAMESPACE_BLUETOOTH - -QL2capServerPrivate::QL2capServerPrivate() -{ -} - -QL2capServerPrivate::~QL2capServerPrivate() -{ -} - -void QL2capServer::close() -{ -} - -bool QL2capServer::listen(const QBluetoothAddress &address, quint16 port) -{ - Q_UNUSED(address); - Q_UNUSED(port); - - return false; -} - -void QL2capServer::setMaxPendingConnections(int numConnections) -{ - Q_UNUSED(numConnections); -} - -bool QL2capServer::hasPendingConnections() const -{ - return false; -} - -QBluetoothSocket *QL2capServer::nextPendingConnection() -{ - return 0; -} - -QBluetoothAddress QL2capServer::serverAddress() const -{ - return QBluetoothAddress(); -} - -quint16 QL2capServer::serverPort() const -{ - return 0; -} - -void QL2capServer::setSecurityFlags(QBluetooth::SecurityFlags security) -{ - Q_UNUSED(security); -} - -QBluetooth::SecurityFlags QL2capServer::securityFlags() const -{ - return QBluetooth::NoSecurity; -} - - - -#ifdef QT_BLUEZ_BLUETOOTH -void QL2capServerPrivate::_q_newConnection() -{ -} -#endif - -QT_END_NAMESPACE_BLUETOOTH diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/ql2capserver_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/ql2capserver_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/ql2capserver_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/ql2capserver_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 QL2CAPSERVER_P_H -#define QL2CAPSERVER_P_H - -#include -#include - -#ifdef QT_BLUEZ_BLUETOOTH -QT_FORWARD_DECLARE_CLASS(QSocketNotifier) -#endif - -QT_BEGIN_NAMESPACE_BLUETOOTH - -class QBluetoothAddress; -class QBluetoothSocket; - -class QL2capServer; - -class QL2capServerPrivate -{ - Q_DECLARE_PUBLIC(QL2capServer) - -public: - QL2capServerPrivate(); - ~QL2capServerPrivate(); - -#ifdef QT_BLUEZ_BLUETOOTH - void _q_newConnection(); -#endif - - -public: - QBluetoothSocket *socket; - bool pending; - - int maxPendingConnections; - QBluetooth::SecurityFlags securityFlags; - -protected: - QL2capServer *q_ptr; - -private: -#ifdef QT_BLUEZ_BLUETOOTH - QSocketNotifier *socketNotifier; -#endif -}; - -QT_END_NAMESPACE_BLUETOOTH - -#endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qnx/ppshelpers.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qnx/ppshelpers.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qnx/ppshelpers.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qnx/ppshelpers.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,9 +42,10 @@ #include "ppshelpers_p.h" #include #include -#include "../qrfcommserver_p.h" +#include "../qbluetoothserver_p.h" +#include -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE static int count = 0; @@ -61,16 +62,29 @@ static int ctrlId = 20; -QHash __fakeServerPorts; +static QList > waitingCtrlMsgs; + +static BBSocketNotifier bbSocketNotifier; + +QHash __fakeServerPorts; QList > evtRegistration; void BBSocketNotifier::distribute() { - qBBBluetoothDebug() << "Distributing"; ppsDecodeControlResponse(); } +void BBSocketNotifier::closeControlFD() +{ + if (count <= 0) { + delete ppsCtrlNotifier; + qt_safe_close(ppsCtrlFD); + ppsCtrlFD = -1; + ppsCtrlNotifier = 0; + } +} + QPair takeObjectInWList(int id) { for (int i=0; i= 0 ; i--) { if (waitingCtrlMsgs.at(i).second == obj) @@ -124,11 +140,12 @@ bool endCtrlMessage(pps_encoder_t *encoder) { - qBBBluetoothDebug() << "writing" << pps_encoder_buffer(encoder); + qCDebug(QT_BT_QNX) << "writing" << pps_encoder_buffer(encoder); if (pps_encoder_buffer(encoder) != 0) { - int res = write(ppsCtrlFD, pps_encoder_buffer(encoder), pps_encoder_length(encoder)); + int res = qt_safe_write(ppsCtrlFD, pps_encoder_buffer(encoder), pps_encoder_length(encoder)); if (res == -1) { - qWarning() << Q_FUNC_INFO << "Error when writing to control FD. Is Bluetooth powerd on?" << errno; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "Error when writing to control FD. Is Bluetooth powerd on?" + << errno << ppsCtrlFD << count; return false; } } @@ -186,8 +203,10 @@ if (ppsCtrlFD != -1) { char buf[ppsBufferSize]; - qt_safe_read( ppsCtrlFD, &buf, sizeof(buf) ); - qBBBluetoothDebug() << "CTRL Response" << buf; + qt_safe_read(ppsCtrlFD, &buf, sizeof(buf) ); + if (buf[0] != '@') + return; + qCDebug(QT_BT_QNX) << "CTRL Response" << buf; pps_decoder_t ppsDecoder; pps_decoder_initialize(&ppsDecoder, 0); @@ -214,6 +233,11 @@ if (pps_decoder_get_string(&ppsDecoder, "errstr", &buf) == PPS_DECODER_OK) result.errorMsg = QString::fromUtf8(buf); + int dat; + if (pps_decoder_get_int(&ppsDecoder, "err", &dat) == PPS_DECODER_OK) { + result.error = dat; + } + //The dat object can be either a string or a array pps_node_type_t nodeType = pps_decoder_type(&ppsDecoder,"dat"); if (nodeType == PPS_TYPE_STRING) { @@ -242,16 +266,16 @@ } } } else { - qBBBluetoothDebug() << "Control Response: No node type" << result.msg; + qCDebug(QT_BT_QNX) << "Control Response: No node type" << result.msg; } } pps_decoder_cleanup(&ppsDecoder); } if (result.msg == QStringLiteral("radio_init")) { - qBBBluetoothDebug() << "Radio initialized"; + qCDebug(QT_BT_QNX) << "Radio initialized"; } else if (result.msg == QStringLiteral("access_changed") && __newHostMode != -1) { - qBBBluetoothDebug() << "Access changed after radio init"; + qCDebug(QT_BT_QNX) << "Access changed after radio init"; ppsSendControlMessage("set_access", QStringLiteral("{\"access\":%1}").arg(__newHostMode), 0); __newHostMode = -1; } @@ -261,6 +285,7 @@ if (wMessage.second != 0) wMessage.second->metaObject()->invokeMethod(wMessage.second, "controlReply", Q_ARG(ppsResult, result)); } else if (resType == EVENT) { + //qCDebug(QT_BT_QNX) << "Distributing event" << result.msg; for (int i=0; i < evtRegistration.size(); i++) { if (result.msg == evtRegistration.at(i).first) evtRegistration.at(i).second->metaObject()->invokeMethod(evtRegistration.at(i).second, "controlEvent", Q_ARG(ppsResult, result)); @@ -287,7 +312,7 @@ int settingsFD; char buf[ppsBufferSize]; if ((settingsFD = qt_safe_open(btSettingsFDPath, O_RDONLY)) == -1) { - qWarning() << Q_FUNC_INFO << "failed to open "<< btSettingsFDPath; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "failed to open "<< btSettingsFDPath; return QVariant(); } @@ -304,31 +329,31 @@ const char *dat; if (pps_decoder_get_string(&decoder, property, &dat) == PPS_DECODER_OK) { result = QString::fromUtf8(dat); - qBBBluetoothDebug() << "Read setting" << result; + qCDebug(QT_BT_QNX) << "Read setting" << result; } else { - qWarning() << Q_FUNC_INFO << "could not read"<< property; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "could not read"<< property; return QVariant(); } } else if (nodeType == PPS_TYPE_BOOL) { bool dat; if (pps_decoder_get_bool(&decoder, property, &dat) == PPS_DECODER_OK) { result = dat; - qBBBluetoothDebug() << "Read setting" << result; + qCDebug(QT_BT_QNX) << "Read setting" << result; } else { - qWarning() << Q_FUNC_INFO << "could not read"<< property; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "could not read"<< property; return QVariant(); } } else if (nodeType == PPS_TYPE_NUMBER) { int dat; if (pps_decoder_get_int(&decoder, property, &dat) == PPS_DECODER_OK) { result = dat; - qBBBluetoothDebug() << "Read setting" << result; + qCDebug(QT_BT_QNX) << "Read setting" << result; } else { - qWarning() << Q_FUNC_INFO << "could not read"<< property; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "could not read"<< property; return QVariant(); } } else { - qBBBluetoothDebug() << Q_FUNC_INFO << "unrecognized entry for settings"; + qCDebug(QT_BT_QNX) << Q_FUNC_INFO << "unrecognized entry for settings"; } } pps_decoder_cleanup(&decoder); @@ -344,7 +369,7 @@ filename.append(address); if ((rmFD = qt_safe_open(filename.constData(), O_RDONLY)) < 0) { - qWarning() << Q_FUNC_INFO << "failed to open "<< btRemoteDevFDPath << address; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "failed to open "<< btRemoteDevFDPath << address; return false; } @@ -367,7 +392,7 @@ pps_decoder_get_bool(&ppsDecoder,property,&dat); res = QVariant(dat); } else { - qBBBluetoothDebug() << "RDStatus: No node type" << property; + qCDebug(QT_BT_QNX) << "RDStatus: No node type" << property; } } pps_decoder_cleanup(&ppsDecoder); @@ -383,11 +408,11 @@ addr_buf[17] = '\0'; if (qt_safe_read(fd, &buf, sizeof(buf)) == -1) { - qWarning() << Q_FUNC_INFO << "Could not qt_safe_read from pps remote device file"; + qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "Could not qt_safe_read from pps remote device file"; return false; } - qBBBluetoothDebug() << "Remote device" << buf; + qCDebug(QT_BT_QNX) << "Remote device" << buf; //the address of the BT device is stored at the beginning of the qt_safe_read if (buf[0] != '-') { @@ -421,7 +446,7 @@ evtRegistration.append(QPair(evt,obj)); } -void ppsUnreguisterForEvent(const QString &str, QObject *obj) +void ppsUnregisterForEvent(const QString &str, QObject *obj) { for (int i=evtRegistration.size()-1; i >= 0; --i) { if (evtRegistration.at(i).first == str && evtRegistration.at(i).second == obj) @@ -429,4 +454,4 @@ } } -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qnx/ppshelpers_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qnx/ppshelpers_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qnx/ppshelpers_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qnx/ppshelpers_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -57,32 +57,28 @@ #include #include -#include -#include +#include +#include +#include #include #include -#ifdef BT_BBPPSDEBUG -#define qBBBluetoothDebug qDebug -#else -#define qBBBluetoothDebug QT_NO_QDEBUG_MACRO -#endif - #define BT_SPP_SERVER_SUBTYPE 1 #define BT_SPP_CLIENT_SUBTYPE 2 -QT_BEGIN_NAMESPACE_BLUETOOTH +QT_BEGIN_NAMESPACE + +Q_DECLARE_LOGGING_CATEGORY(QT_BT_QNX) class BBSocketNotifier : public QObject { Q_OBJECT public Q_SLOTS: void distribute(); + void closeControlFD(); }; -static BBSocketNotifier bbSocketNotifier; - enum ResultType {UNKNOWN, EVENT, MESSAGE, RESPONSE}; struct ppsResult { @@ -96,8 +92,6 @@ int error; }; -static QList > waitingCtrlMsgs; - QPair takeObjectInWList(int id); void ppsRegisterControl(); @@ -128,8 +122,8 @@ void ppsRegisterForEvent(const QString &evt, QObject *obj); -void ppsUnreguisterForEvent(const QString &evt, QObject *obj); +void ppsUnregisterForEvent(const QString &evt, QObject *obj); -QT_END_NAMESPACE_BLUETOOTH +QT_END_NAMESPACE #endif // PPSHELPERS_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qprivatelinearbuffer_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qprivatelinearbuffer_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qprivatelinearbuffer_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qprivatelinearbuffer_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -141,7 +141,7 @@ size_t newCapacity = qMax(capacity, size_t(QPRIVATELINEARBUFFER_BUFFERSIZE)); while (newCapacity < required) newCapacity *= 2; - int moveOffset = (where == freeSpaceAtEnd) ? 0 : newCapacity - len; + const int moveOffset = (where == freeSpaceAtEnd) ? 0 : int(newCapacity) - len; if (newCapacity > capacity) { // allocate more space char* newBuf = new char[newCapacity]; diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver_bluez.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver_bluez.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver_bluez.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver_bluez.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,251 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 "qrfcommserver.h" -#include "qrfcommserver_p.h" -#include "qbluetoothsocket.h" - -#include - -#include - -#include -#include - -#include - -QT_BEGIN_NAMESPACE_BLUETOOTH - -static inline void convertAddress(quint64 from, quint8 (&to)[6]) -{ - to[0] = (from >> 0) & 0xff; - to[1] = (from >> 8) & 0xff; - to[2] = (from >> 16) & 0xff; - to[3] = (from >> 24) & 0xff; - to[4] = (from >> 32) & 0xff; - to[5] = (from >> 40) & 0xff; -} - -QRfcommServerPrivate::QRfcommServerPrivate() -: maxPendingConnections(1), socketNotifier(0) -{ - socket = new QBluetoothSocket(QBluetoothSocket::RfcommSocket); -} - -QRfcommServerPrivate::~QRfcommServerPrivate() -{ - delete socketNotifier; - - delete socket; -} - -void QRfcommServerPrivate::_q_newConnection() -{ - // disable socket notifier until application calls nextPendingConnection(). - socketNotifier->setEnabled(false); - - emit q_ptr->newConnection(); -} - -void QRfcommServer::close() -{ - Q_D(QRfcommServer); - - delete d->socketNotifier; - d->socketNotifier = 0; - - d->socket->close(); -} - -bool QRfcommServer::listen(const QBluetoothAddress &address, quint16 port) -{ - Q_D(QRfcommServer); - - int sock = d->socket->socketDescriptor(); - if (sock < 0) - return false; - - sockaddr_rc addr; - - addr.rc_family = AF_BLUETOOTH; - addr.rc_channel = port; - - if (!address.isNull()) - convertAddress(address.toUInt64(), addr.rc_bdaddr.b); - else - convertAddress(Q_UINT64_C(0), addr.rc_bdaddr.b); - - if (::bind(sock, reinterpret_cast(&addr), sizeof(sockaddr_rc)) < 0) - return false; - - if (::listen(sock, d->maxPendingConnections) < 0) - return false; - - d->socket->setSocketState(QBluetoothSocket::ListeningState); - - if (!d->socketNotifier) { - d->socketNotifier = new QSocketNotifier(d->socket->socketDescriptor(), - QSocketNotifier::Read); - connect(d->socketNotifier, SIGNAL(activated(int)), this, SLOT(_q_newConnection())); - } - - return true; -} - -void QRfcommServer::setMaxPendingConnections(int numConnections) -{ - Q_D(QRfcommServer); - - if (d->socket->state() == QBluetoothSocket::UnconnectedState) - d->maxPendingConnections = numConnections; -} - -bool QRfcommServer::hasPendingConnections() const -{ - Q_D(const QRfcommServer); - - if (!d || !d->socketNotifier) - return false; - - // if the socket notifier is disable there is a pending connection waiting for us to accept. - return !d->socketNotifier->isEnabled(); -} - -QBluetoothSocket *QRfcommServer::nextPendingConnection() -{ - Q_D(QRfcommServer); - - if (!hasPendingConnections()) - return 0; - - sockaddr_rc addr; - socklen_t length = sizeof(sockaddr_rc); - - int pending = ::accept(d->socket->socketDescriptor(), - reinterpret_cast(&addr), &length); - if (pending >= 0) { - QBluetoothSocket *newSocket = new QBluetoothSocket; - newSocket->setSocketDescriptor(pending, QBluetoothSocket::RfcommSocket); - - d->socketNotifier->setEnabled(true); - - return newSocket; - } else { - qDebug() << "Hmm, could have sworn there was a connection waiting to be accepted!"; - d->socketNotifier->setEnabled(true); - } - - return 0; -} - -QBluetoothAddress QRfcommServer::serverAddress() const -{ - Q_D(const QRfcommServer); - - return d->socket->localAddress(); -} - -quint16 QRfcommServer::serverPort() const -{ - Q_D(const QRfcommServer); - - return d->socket->localPort(); -} - -void QRfcommServer::setSecurityFlags(QBluetooth::SecurityFlags security) -{ - Q_D(QRfcommServer); - - int lm = 0; - if(security == QBluetooth::NoSecurity){ - lm = 0; - } - if(security.testFlag(QBluetooth::Authorization)){ - lm |= RFCOMM_LM_AUTH; - } - if(security.testFlag(QBluetooth::Authentication)) { - lm |= RFCOMM_LM_TRUSTED; - } - if(security.testFlag(QBluetooth::Encryption)){ - lm |= RFCOMM_LM_ENCRYPT; - } - if(security.testFlag(QBluetooth::Secure)){ - lm |= RFCOMM_LM_SECURE; - } - - qDebug() << hex << "Setting lm to" << lm << security; - - if (setsockopt(d->socket->socketDescriptor(), SOL_RFCOMM, RFCOMM_LM, &lm, sizeof(lm)) < 0){ - qWarning() << "Failed to set socket option, closing socket for safety" << errno; - qWarning() << "Error: " << strerror(errno); - d->socket->close(); - } -} - -QBluetooth::SecurityFlags QRfcommServer::securityFlags() const -{ - Q_D(const QRfcommServer); - - int lm = 0; - int len = sizeof(lm); - int security = QBluetooth::NoSecurity; - - if (getsockopt(d->socket->socketDescriptor(), SOL_RFCOMM, RFCOMM_LM, &lm, (socklen_t *)&len) < 0) { - qWarning() << "Failed to get security flags" << strerror(errno); - return QBluetooth::NoSecurity; - } - - if(lm & RFCOMM_LM_SECURE) - security |= QBluetooth::Secure; - - if(lm & RFCOMM_LM_ENCRYPT) - security |= QBluetooth::Encryption; - - if(lm & RFCOMM_LM_TRUSTED) - security |= QBluetooth::Authentication; - - if(lm & RFCOMM_LM_AUTH) - security |= QBluetooth::Authorization; - - return static_cast(security); -} - -QT_END_NAMESPACE_BLUETOOTH diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,230 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 "qrfcommserver.h" -#include "qrfcommserver_p.h" -#include "qbluetoothsocket.h" -#include "qbluetoothserviceinfo.h" - -QT_BEGIN_NAMESPACE_BLUETOOTH - -/*! - \class QRfcommServer - \inmodule QtBluetooth - \brief The QRfcommServer class uses the RFCOMM protocol to communicate with - a Bluetooth device. - - QRfcommServer is used to implement Bluetooth services over RFCOMM. - - Start listening for incoming connections with listen(). Wait till the newConnection() signal - is emitted when a new connection is established, and call nextPendingConnection() to get a QBluetoothSocket - for the new connection. - - To enable other devices to find your service, create a QBluetoothServiceInfo with the - applicable attributes for your service and register it using QBluetoothServiceInfo::registerService(). - Call serverPort() to get the RFCOMM channel number that is being used. - - \sa QBluetoothServiceInfo, QBluetoothSocket -*/ - -/*! - \fn void QRfcommServer::newConnection() - - This signal is emitted when a new connection is available. - - The connected slot should call nextPendingConnection() to get a QBluetoothSocket object to - send and receive data over the connection. - - \sa nextPendingConnection(), hasPendingConnections() -*/ - -/*! - \fn void QRfcommServer::close() - - Closes and resets the listening socket. -*/ - -/*! - \fn bool QRfcommServer::listen(const QBluetoothAddress &address, quint16 port) - - Start listening for incoming connections to \a address on \a port. - - Returns true if the operation succeeded and the RFCOMM server is listening for - incoming connections, otherwise returns false. - - \sa isListening(), newConnection() -*/ - -/*! - \fn void QRfcommServer::setMaxPendingConnections(int numConnections) - - Sets the maximum number of pending connections to \a numConnections. - - \sa maxPendingConnections() -*/ - -/*! - \fn bool QRfcommServer::hasPendingConnections() const - Returns true if a connection is pending, otherwise false. -*/ - -/*! - \fn QBluetoothSocket *QRfcommServer::nextPendingConnection() - - Returns a pointer QBluetoothSocket for the next pending connection. It is the callers - responsibility to delete pointer. -*/ - -/*! - \fn QBluetoothAddress QRfcommServer::serverAddress() const - - Returns the server address. -*/ - -/*! - \fn quint16 QRfcommServer::serverPort() const - - Returns the server port number. -*/ - -/*! - Constructs an RFCOMM server with \a parent. -*/ -QRfcommServer::QRfcommServer(QObject *parent) - : QObject(parent), d_ptr(new QRfcommServerPrivate) -{ - d_ptr->q_ptr = this; -} - -/*! - Destroys the RFCOMM server. -*/ -QRfcommServer::~QRfcommServer() -{ - delete d_ptr; -} - -/*! - \fn QBluetoothServiceInfo QRfcommServer::listen(const QBluetoothUuid &uuid, const QString &serviceName) - - Convenience function for registering an SPP service with \a uuid and \a serviceName. - Because this function already registers the service, the QBluetoothServiceInfo object - which is returned can not be changed any more. - - Returns a registered QBluetoothServiceInfo instance if sucessful otherwise an - invalid QBluetoothServiceInfo. - - This function is equivalent to following code snippet. - - \snippet qrfcommserver.cpp listen - - \sa isListening(), newConnection(), listen() -*/ -QBluetoothServiceInfo QRfcommServer::listen(const QBluetoothUuid &uuid, const QString &serviceName) -{ - if (!listen()) - return QBluetoothServiceInfo(); -//! [listen] - QBluetoothServiceInfo serviceInfo; - serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceName, serviceName); - serviceInfo.setAttribute(QBluetoothServiceInfo::BrowseGroupList, - QBluetoothUuid(QBluetoothUuid::PublicBrowseGroup)); - - QBluetoothServiceInfo::Sequence classId; - classId << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::SerialPort)); - serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId); - serviceInfo.setAttribute(QBluetoothServiceInfo::BluetoothProfileDescriptorList, - classId); - - serviceInfo.setServiceUuid(uuid); - - QBluetoothServiceInfo::Sequence protocolDescriptorList; - QBluetoothServiceInfo::Sequence protocol; - protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap)); - protocolDescriptorList.append(QVariant::fromValue(protocol)); - protocol.clear(); - protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Rfcomm)) - << QVariant::fromValue(quint8(serverPort())); - protocolDescriptorList.append(QVariant::fromValue(protocol)); - serviceInfo.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, - protocolDescriptorList); - bool result = serviceInfo.registerService(); -//! [listen] - if (!result) - return QBluetoothServiceInfo(); - return serviceInfo; -} - -/*! - Returns true if the RFCOMM server is listening for incoming connections, otherwise false. -*/ -bool QRfcommServer::isListening() const -{ - Q_D(const QRfcommServer); - - return d->socket->state() == QBluetoothSocket::ListeningState; -} - -/*! - Returns the maximum number of pending connections. - - \sa setMaxPendingConnections() -*/ -int QRfcommServer::maxPendingConnections() const -{ - Q_D(const QRfcommServer); - - return d->maxPendingConnections; -} - -/*! - \fn QRfcommServer::setSecurityFlags(QBluetooth::SecurityFlags security) - Sets the Bluetooth security flags to \a security. This function must be called before calling listen(). -*/ - -/*! - \fn QBluetooth::SecurityFlags QRfcommServer::securityFlags() const - Returns the Bluetooth security flags. -*/ - -#include "moc_qrfcommserver.cpp" - -QT_END_NAMESPACE_BLUETOOTH diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 QRFCOMMSERVER_H -#define QRFCOMMSERVER_H - -#include - -#include - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE_BLUETOOTH - -class QRfcommServerPrivate; -class QBluetoothSocket; - -class Q_BLUETOOTH_EXPORT QRfcommServer : public QObject -{ - Q_OBJECT - -public: - QRfcommServer(QObject *parent = 0); - ~QRfcommServer(); - - void close(); - - bool listen(const QBluetoothAddress &address = QBluetoothAddress(), quint16 port = 0); - QBluetoothServiceInfo listen(const QBluetoothUuid &uuid, const QString &serviceName = QString()); - bool isListening() const; - - void setMaxPendingConnections(int numConnections); - int maxPendingConnections() const; - - bool hasPendingConnections() const; - QBluetoothSocket *nextPendingConnection(); - - QBluetoothAddress serverAddress() const; - quint16 serverPort() const; - - void setSecurityFlags(QBluetooth::SecurityFlags security); - QBluetooth::SecurityFlags securityFlags() const; - -Q_SIGNALS: - void newConnection(); - -protected: - QRfcommServerPrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(QRfcommServer) - -#ifdef QT_BLUEZ_BLUETOOTH - Q_PRIVATE_SLOT(d_func(), void _q_newConnection()) -#endif -}; - -QT_END_NAMESPACE_BLUETOOTH - -#endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver_p.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver_p.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 "qrfcommserver.h" -#include "qrfcommserver_p.h" -#include "qbluetoothsocket.h" - -QT_BEGIN_NAMESPACE_BLUETOOTH - -QRfcommServerPrivate::QRfcommServerPrivate() -{ -} - -QRfcommServerPrivate::~QRfcommServerPrivate() -{ -} - -void QRfcommServer::close() -{ -} - -bool QRfcommServer::listen(const QBluetoothAddress &address, quint16 port) -{ - Q_UNUSED(address); - Q_UNUSED(port); - return false; -} - -void QRfcommServer::setMaxPendingConnections(int numConnections) -{ - Q_UNUSED(numConnections); -} - -bool QRfcommServer::hasPendingConnections() const -{ - return false; -} - -QBluetoothSocket *QRfcommServer::nextPendingConnection() -{ - return 0; -} - -QBluetoothAddress QRfcommServer::serverAddress() const -{ - return QBluetoothAddress(); -} - -quint16 QRfcommServer::serverPort() const -{ - return 0; -} - - -#ifdef QT_BLUEZ_BLUETOOTH -void QRfcommServerPrivate::_q_newConnection() -{ -} -#endif - -void QRfcommServer::setSecurityFlags(QBluetooth::SecurityFlags security) -{ - Q_UNUSED(security); -} - -QBluetooth::SecurityFlags QRfcommServer::securityFlags() const -{ - return QBluetooth::NoSecurity; -} - -QT_END_NAMESPACE_BLUETOOTH diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver_p.h qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 QRFCOMMSERVER_P_H -#define QRFCOMMSERVER_P_H - -#include -#include -#include -#include "qbluetooth.h" - -#ifdef QTM_QNX_BLUETOOTH -#include "qnx/ppshelpers_p.h" -#endif - -#ifdef QT_BLUEZ_BLUETOOTH -QT_FORWARD_DECLARE_CLASS(QSocketNotifier) -#endif - -QT_BEGIN_NAMESPACE_BLUETOOTH - -class QBluetoothAddress; -class QBluetoothSocket; - -class QRfcommServer; - -class QRfcommServerPrivate -#ifdef QTM_QNX_BLUETOOTH -: public QObject -{ - Q_OBJECT -#else -{ -#endif - Q_DECLARE_PUBLIC(QRfcommServer) - -public: - QRfcommServerPrivate(); - ~QRfcommServerPrivate(); - -#ifdef QT_BLUEZ_BLUETOOTH - void _q_newConnection(); -#endif - -public: - QBluetoothSocket *socket; - - int maxPendingConnections; - QBluetooth::SecurityFlags securityFlags; - -#ifdef QTM_QNX_BLUETOOTH - QList activeSockets; - QString m_serviceName; -#endif - -protected: - QRfcommServer *q_ptr; - -private: -#ifdef QTM_QNX_BLUETOOTH - QBluetoothUuid m_uuid; - bool serverRegistered; - QString nextClientAddress; - -private Q_SLOTS: - void controlReply(ppsResult result); - void controlEvent(ppsResult result); -#elif defined(QT_BLUEZ_BLUETOOTH) - QSocketNotifier *socketNotifier; -#endif -}; - -QT_END_NAMESPACE_BLUETOOTH - -#endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver_qnx.cpp qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver_qnx.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/bluetooth/qrfcommserver_qnx.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/bluetooth/qrfcommserver_qnx.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,220 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** 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 "qrfcommserver.h" -#include "qrfcommserver_p.h" -#include "qbluetoothsocket.h" -#include "qbluetoothsocket_p.h" -#include "qbluetoothlocaldevice.h" - -#include - -#include - -QT_BEGIN_NAMESPACE_BLUETOOTH - -extern QHash __fakeServerPorts; - -QRfcommServerPrivate::QRfcommServerPrivate() - : socket(0),maxPendingConnections(1),securityFlags(QBluetooth::NoSecurity) -{ - socket = new QBluetoothSocket(QBluetoothSocket::RfcommSocket); - ppsRegisterControl(); -} - -QRfcommServerPrivate::~QRfcommServerPrivate() -{ - Q_Q(QRfcommServer); - if (socket) - delete socket; - q->close(); - __fakeServerPorts.remove(this); - ppsUnregisterControl(this); -} - -void QRfcommServerPrivate::controlReply(ppsResult result) -{ - Q_Q(QRfcommServer); - - if (result.msg == QStringLiteral("register_server")) { - qBBBluetoothDebug() << "SPP: Server registration succesfull"; - - } else if (result.msg == QStringLiteral("get_mount_point_path")) { - qBBBluetoothDebug() << "SPP: Mount point for server" << result.dat.first(); - - int socketFD = ::open(result.dat.first().toStdString().c_str(), O_RDWR | O_NONBLOCK); - if (socketFD == -1) { - qWarning() << Q_FUNC_INFO << "RFCOMM Server: Could not open socket FD" << errno; - } else { - socket->setSocketDescriptor(socketFD, QBluetoothSocket::RfcommSocket, - QBluetoothSocket::ConnectedState); - socket->connectToService(QBluetoothAddress(nextClientAddress), m_uuid); - activeSockets.append(socket); - socket = new QBluetoothSocket(QBluetoothSocket::RfcommSocket, this); - socket->setSocketState(QBluetoothSocket::ListeningState); - emit q->newConnection(); - } - } -} - -void QRfcommServerPrivate::controlEvent(ppsResult result) -{ - if (result.msg == QStringLiteral("service_connected")) { - qBBBluetoothDebug() << "SPP: Server: Sending request for mount point path"; - qBBBluetoothDebug() << result.dat; - for (int i=0; isocket) { - // there is no way to propagate the error to user - // so just ignore the problem ;) - return; - } - d->socket->close(); - d->socket = 0; - ppsSendControlMessage("deregister_server", 0x1101, d->m_uuid, QString(), QString(), 0); - // force active object (socket) to run and shutdown socket. - qApp->processEvents(QEventLoop::ExcludeUserInputEvents); -} - -bool QRfcommServer::listen(const QBluetoothAddress &address, quint16 port) -{ - Q_UNUSED(address) - Q_D(QRfcommServer); - // listen has already been called before - if (d->socket->state() == QBluetoothSocket::ListeningState) - return true; - - //We can not register an actual Rfcomm port, because the platform does not allow it - //but we need a way to associate a server with a service - - if (port == 0) { //Try to assign a non taken port id - for (int i=1; ; i++){ - if (__fakeServerPorts.key(i) == 0) { - port = i; - break; - } - } - } - - if (__fakeServerPorts.key(port) == 0) { - __fakeServerPorts[d] = port; - qBBBluetoothDebug() << "Port" << port << "registered"; - } else { - qWarning() << "server with port" << port << "already registered or port invalid"; - return false; - } - - d->socket->setSocketState(QBluetoothSocket::ListeningState); - - ppsRegisterForEvent(QStringLiteral("service_connected"),d); - return true; -} - -void QRfcommServer::setMaxPendingConnections(int numConnections) -{ - Q_D(QRfcommServer); - d->maxPendingConnections = numConnections; //Currently not used -} - -QBluetoothAddress QRfcommServer::serverAddress() const -{ - Q_D(const QRfcommServer); - if (d->socket) - return d->socket->localAddress(); - else - return QBluetoothAddress(); -} - -quint16 QRfcommServer::serverPort() const -{ - //Currently we do not have access to the port - Q_D(const QRfcommServer); - return __fakeServerPorts.value((QRfcommServerPrivate*)d); -} - -bool QRfcommServer::hasPendingConnections() const -{ - Q_D(const QRfcommServer); - return !d->activeSockets.isEmpty(); -} - -QBluetoothSocket *QRfcommServer::nextPendingConnection() -{ - Q_D(QRfcommServer); - if (d->activeSockets.isEmpty()) - return 0; - - return d->activeSockets.takeFirst(); -} - -void QRfcommServer::setSecurityFlags(QBluetooth::SecurityFlags security) -{ - Q_D(QRfcommServer); - d->securityFlags = security; //not used -} - -QBluetooth::SecurityFlags QRfcommServer::securityFlags() const -{ - Q_D(const QRfcommServer); - return d->securityFlags; //not used -} - -QT_END_NAMESPACE_BLUETOOTH - diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/bluetooth.pro qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/bluetooth.pro --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/bluetooth.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/bluetooth.pro 2014-02-01 20:38:03.000000000 +0000 @@ -1,18 +1,15 @@ -QT += quick bluetooth network +QT = core quick bluetooth HEADERS += \ qdeclarativebluetoothservice_p.h \ qdeclarativebluetoothsocket_p.h \ - qdeclarativebluetoothimageprovider_p.h \ qdeclarativebluetoothdiscoverymodel_p.h SOURCES += plugin.cpp \ qdeclarativebluetoothservice.cpp \ qdeclarativebluetoothsocket.cpp \ - qdeclarativebluetoothdiscoverymodel.cpp \ - qdeclarativebluetoothimageprovider.cpp + qdeclarativebluetoothdiscoverymodel.cpp -RESOURCES += bluetooth.qrc DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 load(qml_plugin) diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/bluetooth.qrc qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/bluetooth.qrc --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/bluetooth.qrc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/bluetooth.qrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ - - - default.svg - - diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/default.svg qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/default.svg --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/default.svg 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/default.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/plugin.cpp qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/plugin.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/plugin.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/plugin.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -39,12 +39,11 @@ ** ****************************************************************************/ - +#include #include #include #include "qdeclarativebluetoothdiscoverymodel_p.h" -#include "qdeclarativebluetoothimageprovider_p.h" #include "qdeclarativebluetoothservice_p.h" #include "qdeclarativebluetoothsocket_p.h" @@ -57,19 +56,28 @@ public: void registerTypes(const char *uri) { - Q_ASSERT(uri == QLatin1String("QtBluetooth")); + // @uri QtBluetooth + + Q_ASSERT(uri == QStringLiteral("QtBluetooth")); int major = 5; int minor = 0; - qmlRegisterType(uri, major, minor, "BluetoothDiscoveryModel"); - qmlRegisterType(uri, major, minor, "BluetoothService"); - qmlRegisterType(uri, major, minor, "BluetoothSocket"); - } - void initializeEngine(QQmlEngine *engine, const char *uri) { - Q_UNUSED(uri); - engine->addImageProvider("bluetoothicons", new BluetoothThumbnailImageProvider); + // Register the 5.0 types + //5.0 is silent and not advertised + qmlRegisterType(uri, major, minor, "BluetoothDiscoveryModel"); + qmlRegisterType(uri, major, minor, "BluetoothService"); + qmlRegisterType(uri, major, minor, "BluetoothSocket"); + + // Register the 5.2 types + minor = 2; + qmlRegisterType(uri, major, minor, "BluetoothDiscoveryModel"); + qmlRegisterType(uri, major, minor, "BluetoothService"); + qmlRegisterType(uri, major, minor, "BluetoothSocket"); + } }; +Q_LOGGING_CATEGORY(QT_BT_QML, "qt.bluetooth.qml") + #include "plugin.moc" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/plugins.qmltypes qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/plugins.qmltypes --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/plugins.qmltypes 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/plugins.qmltypes 2014-02-01 20:38:03.000000000 +0000 @@ -3,70 +3,74 @@ // This file describes the plugin-supplied types contained in the library. // It is used for QML tooling purposes only. // -// This file was auto-generated with the command 'qmlplugindump -notrelocatable QtBluetooth 5.0'. +// This file was auto-generated by: +// 'qmlplugindump -notrelocatable QtBluetooth 5.2' Module { Component { name: "QDeclarativeBluetoothDiscoveryModel" prototype: "QAbstractListModel" - exports: ["QtBluetooth/BluetoothDiscoveryModel 5.0"] - exportMetaObjectRevisions: [0] - Property { name: "error"; type: "string"; isReadonly: true } - Property { name: "minimalDiscovery"; type: "bool" } - Property { name: "discovery"; type: "bool" } + exports: [ + "QtBluetooth/BluetoothDiscoveryModel 5.0", + "QtBluetooth/BluetoothDiscoveryModel 5.2" + ] + exportMetaObjectRevisions: [0, 0] + Enum { + name: "DiscoveryMode" + values: { + "MinimalServiceDiscovery": 0, + "FullServiceDiscovery": 1, + "DeviceDiscovery": 2 + } + } + Enum { + name: "Error" + values: { + "NoError": 0, + "InputOutputError": 1, + "PoweredOffError": 2, + "UnknownError": 3 + } + } + Property { name: "error"; type: "Error"; isReadonly: true } + Property { name: "discoveryMode"; type: "DiscoveryMode" } + Property { name: "running"; type: "bool" } Property { name: "uuidFilter"; type: "string" } + Property { name: "remoteAddress"; type: "string" } Signal { - name: "newServiceDiscovered" + name: "serviceDiscovered" Parameter { name: "service"; type: "QDeclarativeBluetoothService"; isPointer: true } } - Method { - name: "setDiscovery" - Parameter { name: "discovery_"; type: "bool" } + Signal { + name: "deviceDiscovered" + Parameter { name: "device"; type: "string" } } } Component { name: "QDeclarativeBluetoothService" prototype: "QObject" - exports: ["QtBluetooth/BluetoothService 5.0"] - exportMetaObjectRevisions: [0] + exports: [ + "QtBluetooth/BluetoothService 5.0", + "QtBluetooth/BluetoothService 5.2" + ] + exportMetaObjectRevisions: [0, 0] + Enum { + name: "Protocol" + values: { + "RfcommProtocol": 2, + "L2CapProtocol": 1, + "UnknownProtocol": 0 + } + } Property { name: "deviceName"; type: "string"; isReadonly: true } Property { name: "deviceAddress"; type: "string" } Property { name: "serviceName"; type: "string" } Property { name: "serviceDescription"; type: "string" } Property { name: "serviceUuid"; type: "string" } - Property { name: "serviceProtocol"; type: "string" } - Property { name: "servicePort"; type: "int" } + Property { name: "serviceProtocol"; type: "Protocol" } Property { name: "registered"; type: "bool" } Signal { name: "detailsChanged" } Signal { name: "newClient" } - Method { - name: "setServiceName" - Parameter { name: "name"; type: "string" } - } - Method { - name: "setDeviceAddress" - Parameter { name: "address"; type: "string" } - } - Method { - name: "setServiceDescription" - Parameter { name: "description"; type: "string" } - } - Method { - name: "setServiceUuid" - Parameter { name: "uuid"; type: "string" } - } - Method { - name: "setServiceProtocol" - Parameter { name: "protocol"; type: "string" } - } - Method { - name: "setServicePort" - Parameter { name: "port"; type: "int" } - } - Method { - name: "setRegistered" - Parameter { name: "registered"; type: "bool" } - } Method { name: "nextClient"; type: "QDeclarativeBluetoothSocket*" } Method { name: "assignNextClient" @@ -76,13 +80,41 @@ Component { name: "QDeclarativeBluetoothSocket" prototype: "QObject" - exports: ["QtBluetooth/BluetoothSocket 5.0"] - exportMetaObjectRevisions: [0] + exports: [ + "QtBluetooth/BluetoothSocket 5.0", + "QtBluetooth/BluetoothSocket 5.2" + ] + exportMetaObjectRevisions: [0, 0] + Enum { + name: "Error" + values: { + "NoError": -2, + "UnknownSocketError": -1, + "HostNotFoundError": 2, + "ServiceNotFoundError": 9, + "NetworkError": 7, + "UnsupportedProtocolError": 8 + } + } + Enum { + name: "SocketState" + values: { + "Unconnected": 0, + "ServiceLookup": 1, + "Connecting": 2, + "Connected": 3, + "Bound": 4, + "Closing": 6, + "Listening": 5, + "NoServiceSet": 100 + } + } Property { name: "service"; type: "QDeclarativeBluetoothService"; isPointer: true } Property { name: "connected"; type: "bool" } - Property { name: "error"; type: "string"; isReadonly: true } - Property { name: "state"; type: "string"; isReadonly: true } + Property { name: "error"; type: "Error"; isReadonly: true } + Property { name: "socketState"; type: "SocketState"; isReadonly: true } Property { name: "stringData"; type: "string" } + Signal { name: "stateChanged" } Signal { name: "dataAvailable" } Method { name: "setService" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 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. @@ -43,7 +44,8 @@ #include -#include +#include +#include #include #include "qdeclarativebluetoothservice_p.h" @@ -51,53 +53,83 @@ /*! \qmltype BluetoothDiscoveryModel \instantiates QDeclarativeBluetoothDiscoveryModel - \inqmlmodule QtBluetooth 5.0 - \brief Enables you to search for the Bluetooth devices and services in + \inqmlmodule QtBluetooth + \since 5.2 + \brief Enables searching for the Bluetooth devices and services in range. - The BluetoothDiscoveryModel type was introduced in \b{QtBluetooth 5.0}. - BluetoothDiscoveryModel provides a model of connectable services. The contents of the model can be filtered by UUID allowing discovery to be limited to a single service such as a game. - The model roles provided by BluetoothDiscoveryModel are display, decoration and \c Service. - Through the \c Service role the BluetoothService can be accessed for more details. + The model roles provided by BluetoothDiscoveryModel are + \c service, \c name, \c remoteAddress and \c deviceName. The meaning of the roles + changes based on the current \l discoveryMode. + + \table + \header + \li Model role + \li Device Discovery + \li Service Discovery + \row + \li \c name + \li The device's name and address. + \li The service name and the name of the device offering the service. If the device name is empty the devices address will be used. + \row + \li \c deviceName + \li The name of the device. + \li The name of the device offering the service. + \row + \li \c service + \li The role is undefined in this mode. + \li The \l BluetoothService object describing the discovered service. + \row + \li \c remoteAddress + \li The address of the found device. + \li The address of the device offering the service. + \endtable \sa QBluetoothServiceDiscoveryAgent - */ +Q_DECLARE_LOGGING_CATEGORY(QT_BT_QML) + class QDeclarativeBluetoothDiscoveryModelPrivate { public: QDeclarativeBluetoothDiscoveryModelPrivate() - :m_agent(0), - m_error(QBluetoothServiceDiscoveryAgent::NoError), - m_minimal(true), - m_componentCompleted(false), - m_discovery(false), - m_modelDataNeedsReset(false) + : m_serviceAgent(0), + m_deviceAgent(0), + m_error(QDeclarativeBluetoothDiscoveryModel::NoError), + m_discoveryMode(QDeclarativeBluetoothDiscoveryModel::MinimalServiceDiscovery), + m_running(false), + m_runningRequested(true), + m_componentCompleted(false) { } ~QDeclarativeBluetoothDiscoveryModelPrivate() { - if (m_agent) - delete m_agent; + if (m_deviceAgent) + delete m_deviceAgent; + + if (m_serviceAgent) + delete m_serviceAgent; qDeleteAll(m_services); } - QBluetoothServiceDiscoveryAgent *m_agent; + QBluetoothServiceDiscoveryAgent *m_serviceAgent; + QBluetoothDeviceDiscoveryAgent *m_deviceAgent; - QBluetoothServiceDiscoveryAgent::Error m_error; -// QList m_services; + QDeclarativeBluetoothDiscoveryModel::Error m_error; QList m_services; - bool m_minimal; - bool m_componentCompleted; + QList m_devices; + QDeclarativeBluetoothDiscoveryModel::DiscoveryMode m_discoveryMode; QString m_uuid; - bool m_discovery; - bool m_modelDataNeedsReset; + bool m_running; + bool m_runningRequested; + bool m_componentCompleted; + QString m_remoteAddress; }; QDeclarativeBluetoothDiscoveryModel::QDeclarativeBluetoothDiscoveryModel(QObject *parent) : @@ -107,16 +139,11 @@ QHash roleNames; roleNames = QAbstractItemModel::roleNames(); - roleNames.insert(Qt::DisplayRole, "name"); - roleNames.insert(Qt::DecorationRole, "icon"); + roleNames.insert(Name, "name"); roleNames.insert(ServiceRole, "service"); + roleNames.insert(RemoteAddress, "remoteAddress"); + roleNames.insert(DeviceName, "deviceName"); setRoleNames(roleNames); - - d->m_agent = new QBluetoothServiceDiscoveryAgent(this); - connect(d->m_agent, SIGNAL(serviceDiscovered(const QBluetoothServiceInfo&)), this, SLOT(serviceDiscovered(const QBluetoothServiceInfo&))); - connect(d->m_agent, SIGNAL(finished()), this, SLOT(finishedDiscovery())); - connect(d->m_agent, SIGNAL(canceled()), this, SLOT(finishedDiscovery())); - connect(d->m_agent, SIGNAL(error(QBluetoothServiceDiscoveryAgent::Error)), this, SLOT(errorDiscovery(QBluetoothServiceDiscoveryAgent::Error))); } QDeclarativeBluetoothDiscoveryModel::~QDeclarativeBluetoothDiscoveryModel() @@ -126,121 +153,127 @@ void QDeclarativeBluetoothDiscoveryModel::componentComplete() { d->m_componentCompleted = true; - setDiscovery(true); + if (d->m_runningRequested) + setRunning(true); } -/*! - \qmlproperty bool BluetoothDiscoveryModel::discovery - - This property starts or stops discovery. A restart of the discovery process - requires setting this property to \c false and subsequemtly to \c true again. - -*/ -void QDeclarativeBluetoothDiscoveryModel::setDiscovery(bool discovery_) +void QDeclarativeBluetoothDiscoveryModel::errorDiscovery(QBluetoothServiceDiscoveryAgent::Error error) { - if (!d->m_componentCompleted) - return; - - if (d->m_discovery == discovery_) - return; - - d->m_discovery = discovery_; - - if (!discovery_) { - d->m_agent->stop(); - } else { - if (!d->m_uuid.isEmpty()) - d->m_agent->setUuidFilter(QBluetoothUuid(d->m_uuid)); - - if (d->m_minimal) - d->m_agent->start(QBluetoothServiceDiscoveryAgent::MinimalDiscovery); - else - d->m_agent->start(QBluetoothServiceDiscoveryAgent::FullDiscovery); - - d->m_modelDataNeedsReset = true; - } - - emit discoveryChanged(); + d->m_error = static_cast(error); + emit errorChanged(); } -void QDeclarativeBluetoothDiscoveryModel::errorDiscovery(QBluetoothServiceDiscoveryAgent::Error error) +void QDeclarativeBluetoothDiscoveryModel::errorDeviceDiscovery(QBluetoothDeviceDiscoveryAgent::Error error) { - d->m_error = error; + d->m_error = static_cast(error); emit errorChanged(); } -void QDeclarativeBluetoothDiscoveryModel::clearModelIfRequired() +void QDeclarativeBluetoothDiscoveryModel::clearModel() { - if (d->m_modelDataNeedsReset) { - d->m_modelDataNeedsReset = false; - - beginResetModel(); - qDeleteAll(d->m_services); - d->m_services.clear(); - endResetModel(); - } + beginResetModel(); + qDeleteAll(d->m_services); + d->m_services.clear(); + d->m_devices.clear(); + endResetModel(); } /*! - \qmlproperty string BluetoothDiscoveryModel::error + \qmlproperty enumeration BluetoothDiscoveryModel::error - This property holds the last error reported during discovery. + This property holds the last error reported during discovery. + \table + \header \li Property \li Description + \row \li \c BluetoothDiscoveryModel.NoError + \li No error occurred. + \row \li \c BluetoothDiscoveryModel.InputOutputError + \li An IO failure occurred during device discovery + \row \li \c BluetoothDiscoveryModel.PoweredOffError + \li The bluetooth device is not powered on. + \row \li \c BluetoothDiscoveryModel.UnknownError + \li An unknown error occurred. + \endtable This property is read-only. */ -QString QDeclarativeBluetoothDiscoveryModel::error() const +QDeclarativeBluetoothDiscoveryModel::Error QDeclarativeBluetoothDiscoveryModel::error() const { - switch (d->m_error){ - case QBluetoothServiceDiscoveryAgent::NoError: - break; - default: - return QLatin1String("UnknownError"); - } - return QLatin1String("NoError"); - + return d->m_error; } int QDeclarativeBluetoothDiscoveryModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent); - return d->m_services.count(); + if (discoveryMode() == DeviceDiscovery) + return d->m_devices.count(); + else + return d->m_services.count(); } QVariant QDeclarativeBluetoothDiscoveryModel::data(const QModelIndex &index, int role) const { - if (!index.isValid()) + if (!index.isValid() || index.row() < 0) return QVariant(); - QDeclarativeBluetoothService *service = d->m_services.value(index.row()); + if (discoveryMode() != DeviceDiscovery) { + if (index.row() >= d->m_services.count()){ + qCWarning(QT_BT_QML) << "index out of bounds"; + return QVariant(); + } + + QDeclarativeBluetoothService *service = d->m_services.value(index.row()); + + switch (role) { + case Name: { + QString label = service->deviceName(); + if (label.isEmpty()) + label += service->deviceAddress(); + else + label+= QStringLiteral(":"); + label += QStringLiteral(" ") + service->serviceName(); + return label; + } + case ServiceRole: + return QVariant::fromValue(service); + case DeviceName: + return service->deviceName(); + case RemoteAddress: + return service->deviceAddress(); + } + } else { + if (index.row() >= d->m_devices.count()) { + qCWarning(QT_BT_QML) << "index out of bounds"; + return QVariant(); + } - switch (role) { - case Qt::DisplayRole: - { - QString label = service->deviceName(); - if (label.isEmpty()) - label += service->deviceAddress(); - else - label+= QStringLiteral(":"); - label += QStringLiteral(" ") + service->serviceName(); - return label; + QBluetoothDeviceInfo device = d->m_devices.value(index.row()); + switch (role) { + case Name: + return (device.name() + QStringLiteral(" (") + device.address().toString() + QStringLiteral(")")); + case ServiceRole: + break; + case DeviceName: + return device.name(); + case RemoteAddress: + return device.address().toString(); } - case Qt::DecorationRole: - return QLatin1String("image://bluetoothicons/default"); - case ServiceRole: - return QVariant::fromValue(service); } + return QVariant(); } /*! - \qmlsignal BluetoothDiscoveryModel::newServiceDiscovered() + \qmlsignal BluetoothDiscoveryModel::serviceDiscovered(BluetoothService service) + + This handler is called when a new service is discovered. The \a service + parameter contains the service details. - This handler is called when a new service is discovered. + \sa BluetoothService */ void QDeclarativeBluetoothDiscoveryModel::serviceDiscovered(const QBluetoothServiceInfo &service) { - clearModelIfRequired(); + //qDebug() << "service discovered"; QDeclarativeBluetoothService *bs = new QDeclarativeBluetoothService(service, this); QDeclarativeBluetoothService *current = 0; @@ -256,47 +289,126 @@ beginInsertRows(QModelIndex(),d->m_services.count(), d->m_services.count()); d->m_services.append(bs); endInsertRows(); - emit newServiceDiscovered(bs); + emit serviceDiscovered(bs); } /*! - \qmlsignal BluetoothDiscoveryModel::discoveryChanged() + \qmlsignal BluetoothDiscoveryModel::deviceDiscovered(string device) - This handler is called when discovery has completed and no - further results will be generated. -*/ + This handler is called when a new device is discovered. \a device contains + the Bluetooth address of the discovred device. + */ + +void QDeclarativeBluetoothDiscoveryModel::deviceDiscovered(const QBluetoothDeviceInfo &device) +{ + //qDebug() << "Device discovered" << device.address().toString() << device.name(); + + beginInsertRows(QModelIndex(),d->m_devices.count(), d->m_devices.count()); + d->m_devices.append(device); + endInsertRows(); + emit deviceDiscovered(device.address().toString()); +} void QDeclarativeBluetoothDiscoveryModel::finishedDiscovery() { - clearModelIfRequired(); - if (d->m_discovery) { - d->m_discovery = false; - emit discoveryChanged(); - } + setRunning(false); } /*! - \qmlproperty bool BluetoothDiscoveryModel::minimalDiscovery + \qmlproperty enumeration BluetoothDiscoveryModel::discoveryMode - This property controls minimalDiscovery, which is faster than full discocvery but it - only guarantees the device and UUID information to be correct. + Sets the discovery mode. The discovery mode has to be set before the discovery is started + \table + \header \li Property \li Description + \row \li \c BluetoothDiscoveryModel.FullServiceDiscovery + \li Starts a full discovery of all services of all devices in range. + \row \li \c BluetoothDiscoveryModel.MinimalServiceDiscovery + \li (Default) Starts a minimal discovery of all services of all devices in range. A minimal discovery is + faster but only guarantees the device and UUID information to be correct. + \row \li \c BluetoothDiscoveryModel.DeviceDiscovery + \li Discovers only devices in range. The service role will be 0 for any model item. + \endtable +*/ - */ +QDeclarativeBluetoothDiscoveryModel::DiscoveryMode QDeclarativeBluetoothDiscoveryModel::discoveryMode() const +{ + return d->m_discoveryMode; +} -bool QDeclarativeBluetoothDiscoveryModel::minimalDiscovery() const +void QDeclarativeBluetoothDiscoveryModel::setDiscoveryMode(DiscoveryMode discovery) { - return d->m_minimal; + d->m_discoveryMode = discovery; + emit discoveryModeChanged(); } -void QDeclarativeBluetoothDiscoveryModel::setMinimalDiscovery(bool minimalDiscovery_) +/*! + \qmlproperty bool BluetoothDiscoveryModel::running + + This property starts or stops discovery. A restart of the discovery process + requires setting this property to \c false and subsequemtly to \c true again. + +*/ + +bool QDeclarativeBluetoothDiscoveryModel::running() const { - d->m_minimal = minimalDiscovery_; - emit minimalDiscoveryChanged(); + return d->m_running; } -bool QDeclarativeBluetoothDiscoveryModel::discovery() const +void QDeclarativeBluetoothDiscoveryModel::setRunning(bool running) { - return d->m_discovery; + if (!d->m_componentCompleted) { + d->m_runningRequested = running; + return; + } + + if (d->m_running == running) + return; + + d->m_running = running; + + if (!running) { + if (d->m_deviceAgent) { + d->m_deviceAgent->stop(); + } else if (d->m_serviceAgent) { + d->m_serviceAgent->stop(); + } + } else { + clearModel(); + d->m_error = NoError; + if (d->m_discoveryMode == DeviceDiscovery) { + if (!d->m_deviceAgent) { + d->m_deviceAgent = new QBluetoothDeviceDiscoveryAgent(this); + connect(d->m_deviceAgent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)), this, SLOT(deviceDiscovered(QBluetoothDeviceInfo))); + connect(d->m_deviceAgent, SIGNAL(finished()), this, SLOT(finishedDiscovery())); + connect(d->m_deviceAgent, SIGNAL(canceled()), this, SLOT(finishedDiscovery())); + connect(d->m_deviceAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error)), this, SLOT(errorDeviceDiscovery(QBluetoothDeviceDiscoveryAgent::Error))); + } + d->m_deviceAgent->start(); + } else { + if (!d->m_serviceAgent) { + d->m_serviceAgent = new QBluetoothServiceDiscoveryAgent(this); + connect(d->m_serviceAgent, SIGNAL(serviceDiscovered(const QBluetoothServiceInfo&)), this, SLOT(serviceDiscovered(const QBluetoothServiceInfo&))); + connect(d->m_serviceAgent, SIGNAL(finished()), this, SLOT(finishedDiscovery())); + connect(d->m_serviceAgent, SIGNAL(canceled()), this, SLOT(finishedDiscovery())); + connect(d->m_serviceAgent, SIGNAL(error(QBluetoothServiceDiscoveryAgent::Error)), this, SLOT(errorDiscovery(QBluetoothServiceDiscoveryAgent::Error))); + } + + d->m_serviceAgent->setRemoteAddress(QBluetoothAddress(d->m_remoteAddress)); + + if (!d->m_uuid.isEmpty()) + d->m_serviceAgent->setUuidFilter(QBluetoothUuid(d->m_uuid)); + + if (discoveryMode() == FullServiceDiscovery) { + //qDebug() << "Full Discovery"; + d->m_serviceAgent->start(QBluetoothServiceDiscoveryAgent::FullDiscovery); + } else { + //qDebug() << "Minimal Discovery"; + d->m_serviceAgent->start(QBluetoothServiceDiscoveryAgent::MinimalDiscovery); + } + } + } + + Q_EMIT runningChanged(); } /*! @@ -323,9 +435,32 @@ QBluetoothUuid qbuuid(uuid); if (qbuuid.isNull()) { - qWarning() << "Invalid UUID providded " << uuid; + qCWarning(QT_BT_QML) << "Invalid UUID providded " << uuid; return; } d->m_uuid = uuid; emit uuidFilterChanged(); } + +/*! + \qmlproperty string BluetoothDiscoveryModel::remoteAddress + + This property holds an optional bluetooth address for a remote bluetooth device. + Only services on this remote device will be discovered. It has no effect if + an invalid bluetooth address was set or if the property was set after the discovery + was started. + + The property is ignored if device discovery is selected. + +*/ + +QString QDeclarativeBluetoothDiscoveryModel::remoteAddress() +{ + return d->m_remoteAddress; +} + +void QDeclarativeBluetoothDiscoveryModel::setRemoteAddress(QString address) +{ + d->m_remoteAddress = address; + Q_EMIT remoteAddressChanged(); +} diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel_p.h qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 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. @@ -48,66 +49,91 @@ #include #include +#include #include #include "qdeclarativebluetoothservice_p.h" -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE class QDeclarativeBluetoothDiscoveryModelPrivate; class QDeclarativeBluetoothDiscoveryModel : public QAbstractListModel, public QQmlParserStatus { Q_OBJECT - Q_PROPERTY(QString error READ error NOTIFY errorChanged) - Q_PROPERTY(bool minimalDiscovery READ minimalDiscovery WRITE setMinimalDiscovery NOTIFY minimalDiscoveryChanged) - Q_PROPERTY(bool discovery READ discovery WRITE setDiscovery NOTIFY discoveryChanged) + Q_ENUMS(DiscoveryMode) + Q_ENUMS(Error) + Q_PROPERTY(Error error READ error NOTIFY errorChanged) + Q_PROPERTY(DiscoveryMode discoveryMode READ discoveryMode WRITE setDiscoveryMode NOTIFY discoveryModeChanged) + Q_PROPERTY(bool running READ running WRITE setRunning NOTIFY runningChanged) Q_PROPERTY(QString uuidFilter READ uuidFilter WRITE setUuidFilter NOTIFY uuidFilterChanged) + Q_PROPERTY(QString remoteAddress READ remoteAddress WRITE setRemoteAddress NOTIFY remoteAddressChanged) Q_INTERFACES(QQmlParserStatus) public: explicit QDeclarativeBluetoothDiscoveryModel(QObject *parent = 0); virtual ~QDeclarativeBluetoothDiscoveryModel(); enum { - ServiceRole = Qt::UserRole + 500, - AddressRole, - NameRole + Name = Qt::UserRole + 1, + ServiceRole, + DeviceName, + RemoteAddress }; - QString error() const; + enum DiscoveryMode { + MinimalServiceDiscovery, + FullServiceDiscovery, + DeviceDiscovery + }; + + enum Error + { + NoError, + InputOutputError, + PoweredOffError, + UnknownError + }; - // From QDeclarativeParserStatus - virtual void classBegin() {} + Error error() const; - virtual void componentComplete(); + void componentComplete(); + + void classBegin() { } // From QAbstractListModel int rowCount(const QModelIndex &parent) const; QVariant data(const QModelIndex &index, int role) const; - bool minimalDiscovery() const; - void setMinimalDiscovery(bool minimalDiscovery_); + DiscoveryMode discoveryMode() const; + void setDiscoveryMode(DiscoveryMode discovery); - bool discovery() const; - void setDiscovery(bool discovery_); + bool running() const; + void setRunning(bool running); QString uuidFilter() const; void setUuidFilter(QString uuid); + QString remoteAddress(); + void setRemoteAddress(QString); + signals: void errorChanged(); - void minimalDiscoveryChanged(); - void newServiceDiscovered(QDeclarativeBluetoothService *service); - void discoveryChanged(); + void discoveryModeChanged(); + void serviceDiscovered(QDeclarativeBluetoothService *service); + void deviceDiscovered(const QString& device); + void runningChanged(); void uuidFilterChanged(); + void remoteAddressChanged(); private slots: void serviceDiscovered(const QBluetoothServiceInfo &service); + void deviceDiscovered(const QBluetoothDeviceInfo &device); void finishedDiscovery(); void errorDiscovery(QBluetoothServiceDiscoveryAgent::Error error); + void errorDeviceDiscovery(QBluetoothDeviceDiscoveryAgent::Error); private: - void clearModelIfRequired(); + void clearModel(); private: QDeclarativeBluetoothDiscoveryModelPrivate* d; diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothimageprovider.cpp qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothimageprovider.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothimageprovider.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothimageprovider.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 -#include - -#include -#include -#include "qdeclarativebluetoothimageprovider_p.h" - - -QT_USE_NAMESPACE_BLUETOOTH - -// This is run in a low priority thread. -QImage BluetoothThumbnailImageProvider::requestImage(const QString &id, QSize *size, const QSize &req_size) -{ - if (m_thumbnails.contains(id)) { - if (size) - *size = req_size; - return m_thumbnails.value(id).scaled(req_size); - } - - /* url format: - image://bluetoothicons/{hosttype} - */ - - - QImage image( - req_size.width() > 0 ? req_size.width() : 100, - req_size.height() > 0 ? req_size.height() : 50, - QImage::Format_RGB32); - - QString imageUrl; - - if (id == "default") - imageUrl = QLatin1String(":/default.svg"); - - imageUrl = imageUrl.isEmpty() ? QLatin1String(":/default.svg") : imageUrl; - image.load(imageUrl); - - if (size) - *size = image.size(); - - m_thumbnails.insert(id, image); - - return image; -} - -BluetoothThumbnailImageProvider::BluetoothThumbnailImageProvider() - :QQuickImageProvider(QQuickImageProvider::Image) -{ - -} - -BluetoothThumbnailImageProvider::~BluetoothThumbnailImageProvider() -{ -} - - diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothimageprovider_p.h qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothimageprovider_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothimageprovider_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothimageprovider_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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 -#include - -#include - -QT_USE_NAMESPACE_BLUETOOTH - - -class BluetoothThumbnailImageProvider : public QQuickImageProvider -{ -public: - // This is run in a low priority thread. - QImage requestImage(const QString &id, QSize *size, const QSize &req_size); - BluetoothThumbnailImageProvider(); - ~BluetoothThumbnailImageProvider(); - -private: - QMap m_thumbnails; -}; - diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothservice.cpp qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothservice.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothservice.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothservice.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -41,11 +41,12 @@ #include "qdeclarativebluetoothservice_p.h" -#include +#include + +#include #include #include -#include -#include +#include #include @@ -54,14 +55,13 @@ /*! \qmltype BluetoothService \instantiates QDeclarativeBluetoothService - \inqmlmodule QtBluetooth 5.0 + \inqmlmodule QtBluetooth + \since 5.2 \brief Provides information about a particular Bluetooth service. \sa QBluetoothAddress \sa QBluetoothSocket - The BluetoothService type was introduced in \b{QtBluetooth 5.0}. - It allows a QML project to get information about a remote service, or describe a service for a BluetoothSocket to connect to. */ @@ -82,14 +82,15 @@ \endlist */ +Q_DECLARE_LOGGING_CATEGORY(QT_BT_QML) + class QDeclarativeBluetoothServicePrivate { public: QDeclarativeBluetoothServicePrivate() : m_componentComplete(false), - m_service(0), m_port(0), - m_needsRegistration(false), - m_listen(0) + m_service(0), + m_server(0) { } @@ -103,20 +104,15 @@ bool m_componentComplete; QBluetoothServiceInfo *m_service; - QString m_protocol; - qint32 m_port; - QString m_description; - QString m_name; - QString m_uuid; - bool m_needsRegistration; - QObject *m_listen; - + QDeclarativeBluetoothService::Protocol m_protocol; + QBluetoothServer *m_server; }; QDeclarativeBluetoothService::QDeclarativeBluetoothService(QObject *parent) : QObject(parent) { d = new QDeclarativeBluetoothServicePrivate; + d->m_service = new QBluetoothServiceInfo(); } QDeclarativeBluetoothService::QDeclarativeBluetoothService(const QBluetoothServiceInfo &service, QObject *parent) @@ -135,7 +131,7 @@ { d->m_componentComplete = true; - if (d->m_needsRegistration) + if (!d->m_service->isRegistered()) setRegistered(true); } @@ -149,8 +145,6 @@ QString QDeclarativeBluetoothService::deviceName() const { - if (!d->m_service) - return QString(); return d->m_service->device().name(); } @@ -166,19 +160,13 @@ QString QDeclarativeBluetoothService::deviceAddress() const { - if (!d->m_service) - return QString(); - return d->m_service->device().address().toString(); } -void QDeclarativeBluetoothService::setDeviceAddress(QString address) +void QDeclarativeBluetoothService::setDeviceAddress(const QString &newAddress) { - if (!d->m_service) - d->m_service = new QBluetoothServiceInfo(); - - QBluetoothAddress a(address); - QBluetoothDeviceInfo device(a, QString(), QBluetoothDeviceInfo::ComputerDevice); + QBluetoothAddress address(newAddress); + QBluetoothDeviceInfo device(address, QString(), QBluetoothDeviceInfo::ComputerDevice); d->m_service->setDevice(device); } @@ -191,18 +179,12 @@ QString QDeclarativeBluetoothService::serviceName() const { - if (!d->m_service) - return QString(); - - if (!d->m_name.isEmpty()) - return d->m_name; - return d->m_service->serviceName(); } -void QDeclarativeBluetoothService::setServiceName(QString name) +void QDeclarativeBluetoothService::setServiceName(const QString &name) { - d->m_name = name; + d->m_service->setServiceName(name); } @@ -214,51 +196,43 @@ */ QString QDeclarativeBluetoothService::serviceDescription() const { - if (!d->m_service) - return QString(); - - if (!d->m_description.isEmpty()) - return d->m_name; - return d->m_service->serviceDescription(); } -void QDeclarativeBluetoothService::setServiceDescription(QString description) +void QDeclarativeBluetoothService::setServiceDescription(const QString &description) { - d->m_description = description; + d->m_service->setServiceDescription(description); emit detailsChanged(); } /*! - \qmlproperty string BluetoothService::serviceProtocol + \qmlproperty enumeration BluetoothService::serviceProtocol - This property holds the protocol used for the service. Can be the string, - "l2cap" or "rfcomm". Changing this property emits the + This property holds the protocol used for the service. Changing this property emits the detailsChanged signal. - */ - -QString QDeclarativeBluetoothService::serviceProtocol() const -{ - if (!d->m_protocol.isEmpty()) - return d->m_protocol; + Possible values for this property are: + \table + \header \li Property \li Description + \row \li \c BluetoothService.RfcommProtocol + \li The Rfcomm protocol is used. + \row \li \c BluetoothService.L2capProtocol + \li The L2cap protocol is used. + \row \li \c BluetoothService.UnknownProtocol + \li The protocol is unknown. + \endtable - if (!d->m_service) - return QString(); + \sa QBluetoothServiceInfo::Protocol - if (d->m_service->socketProtocol() == QBluetoothServiceInfo::L2capProtocol) - return QLatin1String("l2cap"); - if (d->m_service->socketProtocol() == QBluetoothServiceInfo::RfcommProtocol) - return QLatin1String("rfcomm"); + */ - return QLatin1String("unknown"); +QDeclarativeBluetoothService::Protocol QDeclarativeBluetoothService::serviceProtocol() const +{ + return d->m_protocol; } -void QDeclarativeBluetoothService::setServiceProtocol(QString protocol) +void QDeclarativeBluetoothService::setServiceProtocol(QDeclarativeBluetoothService::Protocol protocol) { - if (protocol != "rfcomm" && protocol != "l2cap") - qWarning() << "Invalid protocol" << protocol; - d->m_protocol = protocol; emit detailsChanged(); } @@ -266,70 +240,24 @@ /*! \qmlproperty string BluetoothService::serviceUuid - This property holds the UUID of the remote service. Service UUID or port, - and the address must be set to connect to a remote service. If UUID and - port are set, the port is used. The UUID takes longer to connect as - service discovery must be initiated to discover the port value. Changing + This property holds the UUID of the remote service. Service UUID, + and the address must be set to connect to a remote service. Changing this property emits the detailsChanged signal. */ QString QDeclarativeBluetoothService::serviceUuid() const { - if (!d->m_uuid.isEmpty()) - return d->m_uuid; - - if (!d->m_service) - return QString(); - - return d->m_service->attribute(QBluetoothServiceInfo::ServiceId).toString(); + return d->m_service->serviceUuid().toString(); } -void QDeclarativeBluetoothService::setServiceUuid(QString uuid) +void QDeclarativeBluetoothService::setServiceUuid(const QString &uuid) { - d->m_uuid = uuid; - if (!d->m_service) - d->m_service = new QBluetoothServiceInfo(); - d->m_service->setAttribute(QBluetoothServiceInfo::ServiceId, QBluetoothUuid(uuid)); - + d->m_service->setServiceUuid(QBluetoothUuid(uuid)); emit detailsChanged(); } /*! - \qmlproperty int BluetoothService::servicePort - - This property holds the port value for the remote service. Bluetooth does not - use well defined port values, so port values should not be stored and used - later. Connecting using UUID is much more consistent. Changing this property emits the - detailsChanged signal. -*/ -qint32 QDeclarativeBluetoothService::servicePort() const -{ - if (d->m_port > 0) - return d->m_port; - - if (!d->m_service) - return -1; - - if (d->m_service->serverChannel() > 0) - return d->m_service->serverChannel(); - if (d->m_service->protocolServiceMultiplexer() > 0) - return d->m_service->protocolServiceMultiplexer(); - - return -1; -} - -void QDeclarativeBluetoothService::setServicePort(qint32 port) -{ - if (d->m_port != port){ - d->m_port = port; - if (isRegistered()) - setRegistered(true); - emit detailsChanged(); - } -} - -/*! \qmlproperty string BluetoothService::registered This property holds the registration/publication status of the service. If true, the service @@ -338,81 +266,57 @@ bool QDeclarativeBluetoothService::isRegistered() const { - if (!d->m_service) - return false; - return d->m_service->isRegistered(); } int QDeclarativeBluetoothServicePrivate::listen() { - if (m_protocol == "l2cap") { - QL2capServer *server = new QL2capServer(); - - server->setMaxPendingConnections(1); - server->listen(QBluetoothAddress(), m_port); - m_port = server->serverPort(); - m_listen = server; - } - else if (m_protocol == "rfcomm") { - QRfcommServer *server = new QRfcommServer(); - - server->setMaxPendingConnections(1); - server->listen(QBluetoothAddress(), m_port); - m_port = server->serverPort(); - m_listen = server; - } - else { - qDebug() << "Unknown protocol, can't make service" << m_protocol; + if (m_service->socketProtocol() == QBluetoothServiceInfo::UnknownProtocol) { + qCWarning(QT_BT_QML) << "Unknown protocol, can't make service" << m_protocol; + return -1; } + QBluetoothServiceInfo::Protocol serverType = QBluetoothServiceInfo::UnknownProtocol; + if (m_service->socketProtocol() == QBluetoothServiceInfo::L2capProtocol) + serverType = QBluetoothServiceInfo::L2capProtocol; + else if (m_service->socketProtocol() == QBluetoothServiceInfo::RfcommProtocol) + serverType = QBluetoothServiceInfo::RfcommProtocol; + + QBluetoothServer *server = new QBluetoothServer(serverType); + server->setMaxPendingConnections(1); + server->listen(QBluetoothAddress()); + server->serverPort(); + m_server = server; - return m_port; - + return server->serverPort(); } void QDeclarativeBluetoothService::setRegistered(bool registered) { - - d->m_needsRegistration = registered; - if (!d->m_componentComplete) { return; } + delete d->m_server; + d->m_server = 0; + if (!registered) { - if (!d->m_service) - return; d->m_service->unregisterService(); emit registeredChanged(); + return; } - if (!d->m_service) { - d->m_service = new QBluetoothServiceInfo(); - } - - - delete d->m_listen; - d->m_listen = 0; - d->listen(); - connect(d->m_listen, SIGNAL(newConnection()), this, SLOT(new_connection())); + connect(d->m_server, SIGNAL(newConnection()), this, SLOT(new_connection())); d->m_service->setAttribute(QBluetoothServiceInfo::ServiceRecordHandle, (uint)0x00010010); -// QBluetoothServiceInfo::Sequence classId; -//// classId << QVariant::fromVhttp://theunderstatement.com/alue(QBluetoothUuid(serviceUuid)); -// classId << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::SerialPort)); -// d->m_service->setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId); - - d->m_service->setAttribute(QBluetoothServiceInfo::ServiceName, d->m_name); - d->m_service->setAttribute(QBluetoothServiceInfo::ServiceDescription, - d->m_description); + QBluetoothServiceInfo::Sequence classId; + classId << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::SerialPort)); + d->m_service->setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId); - d->m_service->setServiceUuid(QBluetoothUuid(d->m_uuid)); - - qDebug() << "name/uuid" << d->m_name << d->m_uuid << d->m_port; + //qDebug() << "name/uuid" << d->m_name << d->m_uuid << d->m_port; d->m_service->setAttribute(QBluetoothServiceInfo::BrowseGroupList, QBluetoothUuid(QBluetoothUuid::PublicBrowseGroup)); @@ -420,30 +324,28 @@ QBluetoothServiceInfo::Sequence protocolDescriptorList; QBluetoothServiceInfo::Sequence protocol; - qDebug() << "Port" << d->m_port; - - if (d->m_protocol == "l2cap") { + if (d->m_protocol == L2CapProtocol) { protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap)) - << QVariant::fromValue(quint16(d->m_port)); + << QVariant::fromValue(quint16(d->m_server->serverPort())); protocolDescriptorList.append(QVariant::fromValue(protocol)); } - else if (d->m_protocol == "rfcomm") { + else if (d->m_protocol == RfcommProtocol) { protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Rfcomm)) - << QVariant::fromValue(quint8(d->m_port)); + << QVariant::fromValue(quint8(d->m_server->serverPort())); protocolDescriptorList.append(QVariant::fromValue(protocol)); } else { - qWarning() << "No protocol specified for bluetooth service"; + qCWarning(QT_BT_QML) << "No protocol specified for bluetooth service"; } d->m_service->setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList); if (d->m_service->registerService()) { - qDebug() << "registered"; emit registeredChanged(); } else { - qDebug() << "Failed"; + qCWarning(QT_BT_QML) << "Register service failed"; + //TODO propaget this error to the user } } @@ -459,34 +361,23 @@ QDeclarativeBluetoothSocket *QDeclarativeBluetoothService::nextClient() { - QL2capServer *server = qobject_cast(d->m_listen); + QBluetoothServer *server = qobject_cast(d->m_server); if (server) { if (server->hasPendingConnections()) { QBluetoothSocket *socket = server->nextPendingConnection(); - return new QDeclarativeBluetoothSocket(socket, this, 0x0); - } - else { - qDebug() << "Socket has no pending connection, failing"; - return 0x0; - } - } - QRfcommServer *rserver = qobject_cast(d->m_listen); - if (rserver) { - if (rserver->hasPendingConnections()) { - QBluetoothSocket *socket = rserver->nextPendingConnection(); - return new QDeclarativeBluetoothSocket(socket, this, 0x0);; + return new QDeclarativeBluetoothSocket(socket, this, 0); } else { - qDebug() << "Socket has no pending connection, failing"; - return 0x0; + qCWarning(QT_BT_QML) << "Socket has no pending connection, failing"; + return 0; } } - return 0x0; + return 0; } void QDeclarativeBluetoothService::assignNextClient(QDeclarativeBluetoothSocket *dbs) { - QL2capServer *server = qobject_cast(d->m_listen); + QBluetoothServer *server = qobject_cast(d->m_server); if (server) { if (server->hasPendingConnections()) { QBluetoothSocket *socket = server->nextPendingConnection(); @@ -494,19 +385,7 @@ return; } else { - qDebug() << "Socket has no pending connection, failing"; - return; - } - } - QRfcommServer *rserver = qobject_cast(d->m_listen); - if (rserver) { - if (rserver->hasPendingConnections()) { - QBluetoothSocket *socket = rserver->nextPendingConnection(); - dbs->newSocket(socket, this); - return; - } - else { - qDebug() << "Socket has no pending connection, failing"; + qCWarning(QT_BT_QML) << "Socket has no pending connection, failing"; return; } } diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothservice_p.h qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothservice_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothservice_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothservice_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -49,7 +49,7 @@ class QDeclarativeBluetoothSocket; -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE class QDeclarativeBluetoothServicePrivate; @@ -61,13 +61,19 @@ Q_PROPERTY(QString serviceName READ serviceName WRITE setServiceName NOTIFY detailsChanged) Q_PROPERTY(QString serviceDescription READ serviceDescription WRITE setServiceDescription NOTIFY detailsChanged) Q_PROPERTY(QString serviceUuid READ serviceUuid WRITE setServiceUuid NOTIFY detailsChanged) - Q_PROPERTY(QString serviceProtocol READ serviceProtocol WRITE setServiceProtocol NOTIFY detailsChanged) - Q_PROPERTY(qint32 servicePort READ servicePort WRITE setServicePort NOTIFY detailsChanged) + Q_PROPERTY(Protocol serviceProtocol READ serviceProtocol WRITE setServiceProtocol NOTIFY detailsChanged) Q_PROPERTY(bool registered READ isRegistered WRITE setRegistered NOTIFY registeredChanged) Q_INTERFACES(QQmlParserStatus) + Q_ENUMS(Protocol) public: + enum Protocol { + RfcommProtocol = QBluetoothServiceInfo::RfcommProtocol, + L2CapProtocol = QBluetoothServiceInfo::L2capProtocol, + UnknownProtocol = QBluetoothServiceInfo::UnknownProtocol + }; + explicit QDeclarativeBluetoothService(QObject *parent = 0); explicit QDeclarativeBluetoothService(const QBluetoothServiceInfo &service, QObject *parent = 0); @@ -78,8 +84,7 @@ QString serviceName() const; QString serviceDescription() const; QString serviceUuid() const; - QString serviceProtocol() const; - qint32 servicePort() const; + Protocol serviceProtocol() const; bool isRegistered() const; QBluetoothServiceInfo *serviceInfo() const; @@ -91,21 +96,18 @@ void classBegin() {} void componentComplete(); + void setServiceName(const QString &name); + void setDeviceAddress(const QString &address); + void setServiceDescription(const QString &description); + void setServiceUuid(const QString &uuid); + void setServiceProtocol(QDeclarativeBluetoothService::Protocol protocol); + void setRegistered(bool registered); + signals: void detailsChanged(); void registeredChanged(); void newClient(); -public slots: - void setServiceName(QString name); - void setDeviceAddress(QString address); - void setServiceDescription(QString description); - void setServiceUuid(QString uuid); - void setServiceProtocol(QString protocol); - void setServicePort(qint32 port); - void setRegistered(bool registered); - - private slots: void new_connection(); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -41,32 +41,27 @@ #include "qdeclarativebluetoothsocket_p.h" -#include -#include -#include -#include +#include +#include +#include +#include +#include - -#include +#include #include #include -#include -#include - -/* ==================== QDeclarativeBluetoothSocket ======================= */ /*! \qmltype BluetoothSocket \instantiates QDeclarativeBluetoothSocket - \inqmlmodule QtBluetooth 5.0 - \brief Enables you to connect and communicate with a Bluetooth service or + \inqmlmodule QtBluetooth + \since 5.2 + \brief Enables connecting and communicating with a Bluetooth service or device. \sa QBluetoothSocket \sa QDataStream - The BluetoothSocket type was introduced in \b{QtBluetooth 5.0}. - It allows a QML class connect to another Bluetooth device and exchange strings with it. Data is sent and received using a QDataStream object allowing type safe transfers of QStrings. QDataStream is a well known format and can be @@ -80,13 +75,15 @@ or passing in the service return from BluetoothDiscoveryModel. */ +Q_DECLARE_LOGGING_CATEGORY(QT_BT_QML) + class QDeclarativeBluetoothSocketPrivate { public: QDeclarativeBluetoothSocketPrivate(QDeclarativeBluetoothSocket *bs) : m_dbs(bs), m_service(0), m_socket(0), - m_error(QLatin1String("No Error")), - m_state(QLatin1String("No Service Set")), + m_error(QDeclarativeBluetoothSocket::NoError), + m_state(QDeclarativeBluetoothSocket::NoServiceSet), m_componentCompleted(false), m_connected(false) { @@ -101,33 +98,36 @@ void connect() { Q_ASSERT(m_service); - qDebug() << "Connecting to: " << m_service->serviceInfo()->device().address().toString(); - m_error = QLatin1String("No Error"); + //qDebug() << "Connecting to: " << m_service->serviceInfo()->device().address().toString(); + m_error = QDeclarativeBluetoothSocket::NoError; if (m_socket) m_socket->deleteLater(); -// delete m_socket; - m_socket = new QBluetoothSocket(); + QBluetoothServiceInfo::Protocol socketProtocol; + if (m_service->serviceInfo()->socketProtocol() == QBluetoothServiceInfo::L2capProtocol) + socketProtocol = QBluetoothServiceInfo::L2capProtocol; + else if (m_service->serviceInfo()->socketProtocol() == QBluetoothServiceInfo::RfcommProtocol) + socketProtocol = QBluetoothServiceInfo::RfcommProtocol; + else + socketProtocol = QBluetoothServiceInfo::UnknownProtocol; + + m_socket = new QBluetoothSocket(socketProtocol); m_socket->connectToService(*m_service->serviceInfo()); QObject::connect(m_socket, SIGNAL(connected()), m_dbs, SLOT(socket_connected())); QObject::connect(m_socket, SIGNAL(disconnected()), m_dbs, SLOT(socket_disconnected())); QObject::connect(m_socket, SIGNAL(error(QBluetoothSocket::SocketError)), m_dbs, SLOT(socket_error(QBluetoothSocket::SocketError))); QObject::connect(m_socket, SIGNAL(stateChanged(QBluetoothSocket::SocketState)), m_dbs, SLOT(socket_state(QBluetoothSocket::SocketState))); QObject::connect(m_socket, SIGNAL(readyRead()), m_dbs, SLOT(socket_readyRead())); - - m_stream = new QDataStream(m_socket); } QDeclarativeBluetoothSocket *m_dbs; QDeclarativeBluetoothService *m_service; QBluetoothSocket *m_socket; - QString m_error; - QString m_state; + QDeclarativeBluetoothSocket::Error m_error; + QDeclarativeBluetoothSocket::SocketState m_state; bool m_componentCompleted; bool m_connected; - QDataStream *m_stream; - }; QDeclarativeBluetoothSocket::QDeclarativeBluetoothSocket(QObject *parent) : @@ -157,9 +157,6 @@ QObject::connect(socket, SIGNAL(error(QBluetoothSocket::SocketError)), this, SLOT(socket_error(QBluetoothSocket::SocketError))); QObject::connect(socket, SIGNAL(stateChanged(QBluetoothSocket::SocketState)), this, SLOT(socket_state(QBluetoothSocket::SocketState))); QObject::connect(socket, SIGNAL(readyRead()), this, SLOT(socket_readyRead())); - - d->m_stream = new QDataStream(socket); - } @@ -213,7 +210,7 @@ */ -bool QDeclarativeBluetoothSocket::connected() +bool QDeclarativeBluetoothSocket::connected() const { if (!d->m_socket) return false; @@ -229,7 +226,7 @@ d->connect(); } else { - qWarning() << "BluetoothSocket::setConnected called before a service was set"; + qCWarning(QT_BT_QML) << "BluetoothSocket::setConnected called before a service was set"; } } @@ -239,14 +236,23 @@ } /*! - \qmlproperty string BluetoothSocket::error + \qmlproperty enumeration BluetoothSocket::error - This property holds the string for the last reported error - This property is read-only. - */ + This property holds the last error that happened. + \list + \li \c{NoError} + \li \c{UnknownSocketError} + \li \c{HostNotFoundError} + \li \c{ServiceNotFoundError} + \li \c{NetworkError} + \li \c{UnsupportedProtocolError} + \endlist + + The errors are derived from \l QBluetoothSocket::SocketError. This property is read-only. +*/ -QString QDeclarativeBluetoothSocket::error() +QDeclarativeBluetoothSocket::Error QDeclarativeBluetoothSocket::error() const { return d->m_error; } @@ -263,61 +269,29 @@ emit connectedChanged(); } -void QDeclarativeBluetoothSocket::socket_error(QBluetoothSocket::SocketError err) +void QDeclarativeBluetoothSocket::socket_error(QBluetoothSocket::SocketError error) { - if (err == QBluetoothSocket::ConnectionRefusedError) - d->m_error = QLatin1String("Connection Refused"); - else if (err == QBluetoothSocket::RemoteHostClosedError) - d->m_error = QLatin1String("Connection Closed by Remote Host"); - else if (err == QBluetoothSocket::HostNotFoundError) - d->m_error = QLatin1String("Host Not Found"); - else if (err == QBluetoothSocket::ServiceNotFoundError) - d->m_error = QLatin1String("Could not find service at remote host"); - else - d->m_error = QLatin1String("Unknown Error"); + d->m_error = static_cast(error); emit errorChanged(); } void QDeclarativeBluetoothSocket::socket_state(QBluetoothSocket::SocketState state) { - switch (state) { - case QBluetoothSocket::UnconnectedState: - d->m_state = QLatin1String("Unconnected"); - break; - case QBluetoothSocket::ServiceLookupState: - d->m_state = QLatin1String("Service Lookup"); - break; - case QBluetoothSocket::ConnectingState: - d->m_state = QLatin1String("Connecting"); - break; - case QBluetoothSocket::ConnectedState: - d->m_state = QLatin1String("Connected"); - break; - case QBluetoothSocket::ClosingState: - d->m_state = QLatin1String("Closing"); - break; - case QBluetoothSocket::ListeningState: - d->m_state = QLatin1String("Listening"); - break; - case QBluetoothSocket::BoundState: - d->m_state = QLatin1String("Bound"); - break; - } + d->m_state = static_cast(state); emit stateChanged(); } /*! - \qmlproperty string BluetoothSocket::state + \qmlproperty enumeration BluetoothSocket::state - This property holds the current state of the socket. The property can be one - of the following strings: + This property holds the current state of the socket. \list - \li \c{No Service Set} + \li \c{NoServiceSet} \li \c{Unconnected} - \li \c{Service Lookup} + \li \c{ServiceLookup} \li \c{Connecting} \li \c{Connected} \li \c{Closing} @@ -325,22 +299,13 @@ \li \c{Bound} \endlist - The states are derived from QBluetoothSocket::SocketState. This property is read-only. + The states are derived from \l QBluetoothSocket::SocketState. This property is read-only. */ -QString QDeclarativeBluetoothSocket::state() +QDeclarativeBluetoothSocket::SocketState QDeclarativeBluetoothSocket::state() const { return d->m_state; } -/*! - \qmlsignal BluetoothSocket::dataAvailable() - - This signal indicates the arrival of new data. It is emitted each time the socket has new - data available. The data can be read from the property stringData. - \sa stringData - \sa sendStringData - */ - void QDeclarativeBluetoothSocket::socket_readyRead() { emit dataAvailable(); @@ -349,13 +314,11 @@ /*! \qmlproperty string BluetoothSocket::stringData - This property receives or sends data to remote Bluetooth device. Arrival of - data is signaled by the dataAvailable signal and can be read by - stringData. Calling sendStringData will transmit the string. + This property receives or sends data to a remote Bluetooth device. Arrival of + data can be detected by connecting to this properties changed signal and can be read via + stringData. Setting stringData will transmit the string. If excessive amounts of data are sent, the function may block sending. Reading will never block. - \sa dataAvailable - \sa sendStringData */ QString QDeclarativeBluetoothSocket::stringData() @@ -364,30 +327,28 @@ return QString(); QString data; - *d->m_stream >> data; + while (d->m_socket->canReadLine()) { + QByteArray line = d->m_socket->readLine(); + data += QString::fromUtf8(line.constData(), line.length()); + } + return data; } /*! - \qmlmethod BluetoothSocket::sendStringData(data) - This method transmits the string data passed with "data" to the remote device. If excessive amounts of data are sent, the function may block sending. - \sa dataAvailable - \sa stringData */ -void QDeclarativeBluetoothSocket::sendStringData(QString data) +void QDeclarativeBluetoothSocket::sendStringData(const QString &data) { if (!d->m_connected || !d->m_socket){ - qWarning() << "Writing data to unconnected socket"; + qCWarning(QT_BT_QML) << "Writing data to unconnected socket"; return; } - QByteArray b; - QDataStream s(&b, QIODevice::WriteOnly); - s << data; - d->m_socket->write(b); + QByteArray text = data.toUtf8() + '\n'; + d->m_socket->write(text); } void QDeclarativeBluetoothSocket::newSocket(QBluetoothSocket *socket, QDeclarativeBluetoothService *service) @@ -400,7 +361,7 @@ d->m_socket = socket; d->m_connected = true; d->m_componentCompleted = true; - d->m_error = QLatin1String("No Error"); + d->m_error = NoError; QObject::connect(socket, SIGNAL(connected()), this, SLOT(socket_connected())); QObject::connect(socket, SIGNAL(disconnected()), this, SLOT(socket_disconnected())); @@ -408,8 +369,6 @@ QObject::connect(socket, SIGNAL(stateChanged(QBluetoothSocket::SocketState)), this, SLOT(socket_state(QBluetoothSocket::SocketState))); QObject::connect(socket, SIGNAL(readyRead()), this, SLOT(socket_readyRead())); - d->m_stream = new QDataStream(socket); - socket_state(socket->state()); emit connectedChanged(); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothsocket_p.h qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothsocket_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/bluetooth/qdeclarativebluetoothsocket_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/bluetooth/qdeclarativebluetoothsocket_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -50,7 +50,7 @@ #include "qdeclarativebluetoothservice_p.h" -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE class QDeclarativeBluetoothSocketPrivate; class QDeclarativeBluetoothService; @@ -60,12 +60,35 @@ Q_OBJECT Q_PROPERTY(QDeclarativeBluetoothService *service READ service WRITE setService NOTIFY serviceChanged) Q_PROPERTY(bool connected READ connected WRITE setConnected NOTIFY connectedChanged) - Q_PROPERTY(QString error READ error NOTIFY errorChanged) - Q_PROPERTY(QString state READ state NOTIFY stateChanged) + Q_PROPERTY(Error error READ error NOTIFY errorChanged) + Q_PROPERTY(SocketState socketState READ state NOTIFY stateChanged) Q_PROPERTY(QString stringData READ stringData WRITE sendStringData NOTIFY dataAvailable) Q_INTERFACES(QQmlParserStatus) + Q_ENUMS(Error) + Q_ENUMS(SocketState) public: + + enum Error { + NoError = QBluetoothSocket::NoSocketError, + UnknownSocketError = QBluetoothSocket::UnknownSocketError, + HostNotFoundError = QBluetoothSocket::HostNotFoundError, + ServiceNotFoundError = QBluetoothSocket::ServiceNotFoundError, + NetworkError = QBluetoothSocket::NetworkError, + UnsupportedProtocolError = QBluetoothSocket::UnsupportedProtocolError + }; + + enum SocketState { + Unconnected = QBluetoothSocket::UnconnectedState, + ServiceLookup = QBluetoothSocket::ServiceLookupState, + Connecting = QBluetoothSocket::ConnectingState, + Connected = QBluetoothSocket::ConnectedState, + Bound = QBluetoothSocket::BoundState, + Closing = QBluetoothSocket::ClosingState, + Listening = QBluetoothSocket::ListeningState, + NoServiceSet = 100 //Leave gap for future enums and to avoid collision with QBluetoothSocket enums + }; + explicit QDeclarativeBluetoothSocket(QObject *parent = 0); explicit QDeclarativeBluetoothSocket(QDeclarativeBluetoothService *service, QObject *parent = 0); @@ -74,9 +97,9 @@ ~QDeclarativeBluetoothSocket(); QDeclarativeBluetoothService *service(); - bool connected(); - QString error(); - QString state(); + bool connected() const; + Error error() const; + SocketState state() const; QString stringData(); @@ -96,7 +119,7 @@ public slots: void setService(QDeclarativeBluetoothService *service); void setConnected(bool connected); - void sendStringData(QString data); + void sendStringData(const QString& data); private slots: void socket_connected(); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/nfc.pro qtconnectivity-opensource-src-5.2.1/src/imports/nfc/nfc.pro --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/nfc.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/nfc.pro 2014-02-01 20:38:03.000000000 +0000 @@ -2,7 +2,7 @@ # Input HEADERS += \ - qdeclarativenearfieldsocket_p.h \ + #qdeclarativenearfieldsocket_p.h \ qdeclarativenearfield_p.h \ qdeclarativendeffilter_p.h \ qdeclarativendeftextrecord_p.h \ @@ -10,7 +10,7 @@ qdeclarativendefmimerecord_p.h SOURCES += plugin.cpp \ - qdeclarativenearfieldsocket.cpp \ + #qdeclarativenearfieldsocket.cpp \ qdeclarativenearfield.cpp \ qdeclarativendeffilter.cpp \ qdeclarativendeftextrecord.cpp \ diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/plugin.cpp qtconnectivity-opensource-src-5.2.1/src/imports/nfc/plugin.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/plugin.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/plugin.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,8 +42,8 @@ #include #include -#include "qdeclarativendefrecord.h" -#include "qdeclarativenearfieldsocket_p.h" +#include "qqmlndefrecord.h" +//#include "qdeclarativenearfieldsocket_p.h" #include "qdeclarativenearfield_p.h" #include "qdeclarativendeffilter_p.h" #include "qdeclarativendeftextrecord_p.h" @@ -55,23 +55,32 @@ class QNfcQmlPlugin : public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: void registerTypes(const char *uri) { - Q_ASSERT(uri == QLatin1String("QtNfc")); + Q_ASSERT(uri == QStringLiteral("QtNfc")); // @uri QtNfc + // Register the 5.0 types int major = 5; int minor = 0; - qmlRegisterType(uri, major, minor, "NearFieldSocket"); + //qmlRegisterType(uri, major, minor, "NearFieldSocket"); + + qmlRegisterType(uri, major, minor, "NearField"); + qmlRegisterType(uri, major, minor, "NdefFilter"); + qmlRegisterType(uri, major, minor, "NdefRecord"); + qmlRegisterType(uri, major, minor, "NdefTextRecord"); + qmlRegisterType(uri, major, minor, "NdefUriRecord"); + qmlRegisterType(uri, major, minor, "NdefMimeRecord"); + // Register the 5.2 types + minor = 2; qmlRegisterType(uri, major, minor, "NearField"); qmlRegisterType(uri, major, minor, "NdefFilter"); - qmlRegisterType(uri, major, minor, "NdefRecord"); + qmlRegisterType(uri, major, minor, "NdefRecord"); qmlRegisterType(uri, major, minor, "NdefTextRecord"); qmlRegisterType(uri, major, minor, "NdefUriRecord"); qmlRegisterType(uri, major, minor, "NdefMimeRecord"); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/plugins.qmltypes qtconnectivity-opensource-src-5.2.1/src/imports/nfc/plugins.qmltypes --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/plugins.qmltypes 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/plugins.qmltypes 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,81 @@ +import QtQuick.tooling 1.1 + +// This file describes the plugin-supplied types contained in the library. +// It is used for QML tooling purposes only. +// +// This file was auto-generated by: +// 'qmlplugindump -notrelocatable QtNfc 5.2' + +Module { + Component { + name: "QDeclarativeNdefFilter" + prototype: "QObject" + exports: ["QtNfc/NdefFilter 5.0", "QtNfc/NdefFilter 5.2"] + exportMetaObjectRevisions: [0, 0] + Property { name: "type"; type: "string" } + Property { name: "typeNameFormat"; type: "QQmlNdefRecord::TypeNameFormat" } + Property { name: "minimum"; type: "int" } + Property { name: "maximum"; type: "int" } + } + Component { + name: "QDeclarativeNdefMimeRecord" + prototype: "QQmlNdefRecord" + exports: ["QtNfc/NdefMimeRecord 5.0", "QtNfc/NdefMimeRecord 5.2"] + exportMetaObjectRevisions: [0, 0] + Property { name: "uri"; type: "string"; isReadonly: true } + } + Component { + name: "QDeclarativeNdefTextRecord" + prototype: "QQmlNdefRecord" + exports: ["QtNfc/NdefTextRecord 5.0", "QtNfc/NdefTextRecord 5.2"] + exportMetaObjectRevisions: [0, 0] + Enum { + name: "LocaleMatch" + values: { + "LocaleMatchedNone": 0, + "LocaleMatchedEnglish": 1, + "LocaleMatchedLanguage": 2, + "LocaleMatchedLanguageAndCountry": 3 + } + } + Property { name: "text"; type: "string" } + Property { name: "locale"; type: "string" } + Property { name: "localeMatch"; type: "LocaleMatch"; isReadonly: true } + } + Component { + name: "QDeclarativeNdefUriRecord" + prototype: "QQmlNdefRecord" + exports: ["QtNfc/NdefUriRecord 5.0", "QtNfc/NdefUriRecord 5.2"] + exportMetaObjectRevisions: [0, 0] + Property { name: "uri"; type: "string" } + } + Component { + name: "QDeclarativeNearField" + prototype: "QObject" + exports: ["QtNfc/NearField 5.0", "QtNfc/NearField 5.2"] + exportMetaObjectRevisions: [0, 0] + Property { name: "messageRecords"; type: "QQmlNdefRecord"; isList: true; isReadonly: true } + Property { name: "filter"; type: "QDeclarativeNdefFilter"; isList: true; isReadonly: true } + Property { name: "orderMatch"; type: "bool" } + } + Component { + name: "QQmlNdefRecord" + prototype: "QObject" + exports: ["QtNfc/NdefRecord 5.0", "QtNfc/NdefRecord 5.2"] + exportMetaObjectRevisions: [0, 0] + Enum { + name: "TypeNameFormat" + values: { + "Empty": 0, + "NfcRtd": 1, + "Mime": 2, + "Uri": 3, + "ExternalRtd": 4, + "Unknown": 5 + } + } + Property { name: "type"; type: "string" } + Property { name: "typeNameFormat"; type: "TypeNameFormat" } + Property { name: "record"; type: "QNdefRecord" } + } +} diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendeffilter.cpp qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendeffilter.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendeffilter.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendeffilter.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -44,16 +44,15 @@ /*! \qmltype NdefFilter \instantiates QDeclarativeNdefFilter - \brief The NdefFilter type represents a filtering constraint for NDEF message records. + \since 5.2 + \brief Represents a filtering constraint for NDEF message records. \ingroup nfc-qml - \inqmlmodule QtNfc 5.0 + \inqmlmodule QtNfc \sa NearField \sa QNdefFilter - The NdefFilter type was introduced in \b {QtNfc 5.0}. - The NdefFilter type is used with the NearField type to read NDEF messages from NFC Forum tags that match a given structure. @@ -119,6 +118,20 @@ emit typeChanged(); } +QQmlNdefRecord::TypeNameFormat QDeclarativeNdefFilter::typeNameFormat() const +{ + return m_typeNameFormat; +} + +void QDeclarativeNdefFilter::setTypeNameFormat(QQmlNdefRecord::TypeNameFormat format) +{ + if (m_typeNameFormat == format) + return; + + m_typeNameFormat = format; + Q_EMIT(typeNameFormatChanged()); +} + int QDeclarativeNdefFilter::minimum() const { return m_minimum; diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendeffilter_p.h qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendeffilter_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendeffilter_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendeffilter_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -43,21 +43,25 @@ #define QDECLARATIVENDEFFILTER_P_H #include +#include class QDeclarativeNdefFilter : public QObject { Q_OBJECT Q_PROPERTY(QString type READ type WRITE setType NOTIFY typeChanged) + Q_PROPERTY(QQmlNdefRecord::TypeNameFormat typeNameFormat READ typeNameFormat WRITE setTypeNameFormat NOTIFY typeNameFormatChanged) Q_PROPERTY(int minimum READ minimum WRITE setMinimum NOTIFY minimumChanged) Q_PROPERTY(int maximum READ maximum WRITE setMaximum NOTIFY maximumChanged) - public: explicit QDeclarativeNdefFilter(QObject *parent = 0); QString type() const; void setType(const QString &t); + QQmlNdefRecord::TypeNameFormat typeNameFormat() const; + void setTypeNameFormat(QQmlNdefRecord::TypeNameFormat format); + int minimum() const; void setMinimum(int value); @@ -68,11 +72,13 @@ void typeChanged(); void minimumChanged(); void maximumChanged(); + void typeNameFormatChanged(); private: QString m_type; int m_minimum; int m_maximum; + QQmlNdefRecord::TypeNameFormat m_typeNameFormat; }; #endif // QDECLARATIVENDEFFILTER_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendefmimerecord.cpp qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendefmimerecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendefmimerecord.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendefmimerecord.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,16 +43,14 @@ /*! \qmltype NdefMimeRecord - \instantiates QDeclarativeNdefMimeRecord - \brief The NdefMimeRecord type represents an NFC MIME record. + \since 5.2 + \brief Represents an NFC MIME record. \ingroup connectivity-nfc - \inqmlmodule QtNfc 5.0 + \inqmlmodule QtNfc \inherits NdefRecord - The NdefMimeRecord type was introduced in \b {QtNfc 5.0}. - The NdefMimeRecord type can contain data with an associated MIME type. The data is accessible from the uri in the \l {NdefMimeRecord::uri}{uri} property. */ @@ -81,12 +79,12 @@ } QDeclarativeNdefMimeRecord::QDeclarativeNdefMimeRecord(QObject *parent) -: QDeclarativeNdefRecord(createMimeRecord(), parent) +: QQmlNdefRecord(createMimeRecord(), parent) { } QDeclarativeNdefMimeRecord::QDeclarativeNdefMimeRecord(const QNdefRecord &record, QObject *parent) -: QDeclarativeNdefRecord(castToMimeRecord(record), parent) +: QQmlNdefRecord(castToMimeRecord(record), parent) { } diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendefmimerecord_p.h qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendefmimerecord_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendefmimerecord_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendefmimerecord_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -42,11 +42,11 @@ #ifndef QDECLARATIVENDEFMIMERECORD_P_H #define QDECLARATIVENDEFMIMERECORD_P_H -#include +#include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE -class QDeclarativeNdefMimeRecord : public QDeclarativeNdefRecord +class QDeclarativeNdefMimeRecord : public QQmlNdefRecord { Q_OBJECT diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendeftextrecord.cpp qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendeftextrecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendeftextrecord.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendeftextrecord.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -45,18 +45,16 @@ /*! \qmltype NdefTextRecord - \instantiates QDeclarativeNdefTextRecord - \brief The NdefTextRecord type represents an NFC RTD-Text NDEF record. + \since 5.2 + \brief Represents an NFC RTD-Text NDEF record. \ingroup nfc-qml - \inqmlmodule QtNfc 5.0 + \inqmlmodule QtNfc \inherits NdefRecord \sa QNdefNfcTextRecord - The NdefTextRecord type was introduced in \b {QtNfc 5.0}. - The NdefTextRecord type contains a localized piece of text that can be display to the user. An NDEF message may contain many text records for different locales, it is up to the application to select the most appropriate one to display to the user. The localeMatch @@ -109,12 +107,12 @@ Q_DECLARE_NDEFRECORD(QDeclarativeNdefTextRecord, QNdefRecord::NfcRtd, "T") QDeclarativeNdefTextRecord::QDeclarativeNdefTextRecord(QObject *parent) -: QDeclarativeNdefRecord(QNdefNfcTextRecord(), parent) +: QQmlNdefRecord(QNdefNfcTextRecord(), parent) { } QDeclarativeNdefTextRecord::QDeclarativeNdefTextRecord(const QNdefRecord &record, QObject *parent) -: QDeclarativeNdefRecord(QNdefNfcTextRecord(record), parent) +: QQmlNdefRecord(QNdefNfcTextRecord(record), parent) { } diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendeftextrecord_p.h qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendeftextrecord_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendeftextrecord_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendeftextrecord_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -42,13 +42,13 @@ #ifndef QDECLARATIVENDEFTEXTRECORD_P_H #define QDECLARATIVENDEFTEXTRECORD_P_H -#include +#include #include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE -class QDeclarativeNdefTextRecord : public QDeclarativeNdefRecord +class QDeclarativeNdefTextRecord : public QQmlNdefRecord { Q_OBJECT diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendefurirecord.cpp qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendefurirecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendefurirecord.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendefurirecord.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -45,17 +45,17 @@ /*! \qmltype NdefUriRecord - \instantiates QDeclarativeNdefUriRecord - \brief The NdefUriRecord type represents an NFC RTD-URI NDEF record. + \since 5.2 + \brief Represents an NFC RTD-URI NDEF record. \ingroup nfc-qml - \inqmlmodule QtNfc 5.0 + \inqmlmodule QtNfc \inherits NdefRecord \sa QNdefNfcUriRecord - The NdefUriRecord type was introduced in \b {QtNfc 5.0}. + The NdefUriRecord type can contain a uniform resource identifier. */ /*! @@ -67,12 +67,12 @@ Q_DECLARE_NDEFRECORD(QDeclarativeNdefUriRecord, QNdefRecord::NfcRtd, "U") QDeclarativeNdefUriRecord::QDeclarativeNdefUriRecord(QObject *parent) -: QDeclarativeNdefRecord(QNdefNfcUriRecord(), parent) +: QQmlNdefRecord(QNdefNfcUriRecord(), parent) { } QDeclarativeNdefUriRecord::QDeclarativeNdefUriRecord(const QNdefRecord &record, QObject *parent) -: QDeclarativeNdefRecord(QNdefNfcUriRecord(record), parent) +: QQmlNdefRecord(QNdefNfcUriRecord(record), parent) { } diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendefurirecord_p.h qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendefurirecord_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativendefurirecord_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativendefurirecord_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -42,15 +42,15 @@ #ifndef QDECLARATIVENDEFURIRECORD_P_H #define QDECLARATIVENDEFURIRECORD_P_H -#include +#include #include #include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE -class QDeclarativeNdefUriRecord : public QDeclarativeNdefRecord +class QDeclarativeNdefUriRecord : public QQmlNdefRecord { Q_OBJECT diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativenearfield.cpp qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativenearfield.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativenearfield.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativenearfield.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -52,10 +52,11 @@ /*! \qmltype NearField \instantiates QDeclarativeNearField - \brief The NearField type provides access to NDEF messages stored on NFC Forum tags. + \since 5.2 + \brief Provides access to NDEF messages stored on NFC Forum tags. \ingroup nfc-qml - \inqmlmodule QtNfc 5.0 + \inqmlmodule QtNfc \sa NdefFilter \sa NdefRecord @@ -64,15 +65,13 @@ \sa QNdefMessage \sa QNdefRecord - The NearField type was introduced in \b {QtNfc 5.0}. - The NearField type can be used to read NDEF messages from NFC Forum tags. Set the \l filter and \l orderMatch properties to match the required NDEF messages. Once an NDEF message is successfully read from a tag the \l messageRecords property is updated. \code NearField { - filter: [ NdefFilter { type: "urn:nfc:wkt:U"; minimum: 1; maximum: 1 } ] + filter: [ NdefFilter { type: "U"; typeNameFormat: NdefRecord.NfcRtd; minimum: 1; maximum: 1 } ] orderMatch: false onMessageRecordsChanged: displayMessage() @@ -90,7 +89,10 @@ \qmlproperty list NearField::filter This property holds the NDEF filter constraints. The \l messageRecords property will only be - set to NDEF messages which match the filter. + set to NDEF messages which match the filter. If no filter is set, a message handler for + all NDEF messages will be registered. + + \l QNearFieldManager::registerNdefMessageHandler() */ /*! @@ -106,9 +108,9 @@ { } -QQmlListProperty QDeclarativeNearField::messageRecords() +QQmlListProperty QDeclarativeNearField::messageRecords() { - return QQmlListProperty(this, 0, + return QQmlListProperty(this, 0, &QDeclarativeNearField::append_messageRecord, &QDeclarativeNearField::count_messageRecords, &QDeclarativeNearField::at_messageRecord, @@ -143,8 +145,7 @@ { m_componentCompleted = true; - if (!m_filter.isEmpty()) - registerMessageHandler(); + registerMessageHandler(); } void QDeclarativeNearField::registerMessageHandler() @@ -155,28 +156,17 @@ if (m_messageHandlerId != -1) m_manager->unregisterNdefMessageHandler(m_messageHandlerId); - // no filter abort - if (m_filter.isEmpty()) - return; + QNdefFilter ndefFilter; + ndefFilter.setOrderMatch(m_orderMatch); + foreach (const QDeclarativeNdefFilter *filter, m_filterList) { + const QString type = filter->type(); + uint min = filter->minimum() < 0 ? UINT_MAX : filter->minimum(); + uint max = filter->maximum() < 0 ? UINT_MAX : filter->maximum(); - QNdefFilter filter; - filter.setOrderMatch(m_orderMatch); - foreach (QDeclarativeNdefFilter *f, m_filter) { - const QString type = f->type(); - uint min = f->minimum() < 0 ? UINT_MAX : f->minimum(); - uint max = f->maximum() < 0 ? UINT_MAX : f->maximum(); - - if (type.startsWith(QLatin1String("urn:nfc:wkt:"))) - filter.appendRecord(QNdefRecord::NfcRtd, type.mid(12).toUtf8(), min, max); - else if (type.startsWith(QLatin1String("urn:nfc:ext:"))) - filter.appendRecord(QNdefRecord::ExternalRtd, type.mid(12).toUtf8(), min, max); - else if (type.startsWith(QLatin1String("urn:nfc:mime"))) - filter.appendRecord(QNdefRecord::Mime, type.mid(13).toUtf8(), min, max); - else - qWarning("Unknown NDEF record type %s", qPrintable(type)); + ndefFilter.appendRecord(static_cast(filter->typeNameFormat()), type.toUtf8(), min, max); } - m_messageHandlerId = m_manager->registerNdefMessageHandler(filter, this, SLOT(_q_handleNdefMessage(QNdefMessage))); + m_messageHandlerId = m_manager->registerNdefMessageHandler(ndefFilter, this, SLOT(_q_handleNdefMessage(QNdefMessage))); } void QDeclarativeNearField::_q_handleNdefMessage(const QNdefMessage &message) @@ -195,8 +185,8 @@ emit messageRecordsChanged(); } -void QDeclarativeNearField::append_messageRecord(QQmlListProperty *list, - QDeclarativeNdefRecord *record) +void QDeclarativeNearField::append_messageRecord(QQmlListProperty *list, + QQmlNdefRecord *record) { QDeclarativeNearField *nearField = qobject_cast(list->object); if (!nearField) @@ -208,7 +198,7 @@ emit nearField->messageRecordsChanged(); } -int QDeclarativeNearField::count_messageRecords(QQmlListProperty *list) +int QDeclarativeNearField::count_messageRecords(QQmlListProperty *list) { QDeclarativeNearField *nearField = qobject_cast(list->object); if (!nearField) @@ -217,7 +207,7 @@ return nearField->m_message.count(); } -QDeclarativeNdefRecord *QDeclarativeNearField::at_messageRecord(QQmlListProperty *list, +QQmlNdefRecord *QDeclarativeNearField::at_messageRecord(QQmlListProperty *list, int index) { QDeclarativeNearField *nearField = qobject_cast(list->object); @@ -227,7 +217,7 @@ return nearField->m_message.at(index); } -void QDeclarativeNearField::clear_messageRecords(QQmlListProperty *list) +void QDeclarativeNearField::clear_messageRecords(QQmlListProperty *list) { QDeclarativeNearField *nearField = qobject_cast(list->object); if (nearField) { @@ -246,7 +236,7 @@ return; filter->setParent(nearField); - nearField->m_filter.append(filter); + nearField->m_filterList.append(filter); emit nearField->filterChanged(); if (nearField->m_componentCompleted) @@ -259,7 +249,7 @@ if (!nearField) return 0; - return nearField->m_filter.count(); + return nearField->m_filterList.count(); } QDeclarativeNdefFilter *QDeclarativeNearField::at_filter(QQmlListProperty *list, @@ -269,7 +259,7 @@ if (!nearField) return 0; - return nearField->m_filter.at(index); + return nearField->m_filterList.at(index); } void QDeclarativeNearField::clear_filter(QQmlListProperty *list) @@ -278,8 +268,8 @@ if (!nearField) return; - qDeleteAll(nearField->m_filter); - nearField->m_filter.clear(); + qDeleteAll(nearField->m_filterList); + nearField->m_filterList.clear(); emit nearField->filterChanged(); if (nearField->m_componentCompleted) nearField->registerMessageHandler(); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativenearfield_p.h qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativenearfield_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativenearfield_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativenearfield_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -47,17 +47,17 @@ #include #include -#include "qdeclarativendefrecord.h" +#include "qqmlndefrecord.h" -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE class QDeclarativeNdefFilter; class QDeclarativeNearField : public QObject, public QQmlParserStatus { Q_OBJECT - Q_PROPERTY(QQmlListProperty messageRecords READ messageRecords NOTIFY messageRecordsChanged) + Q_PROPERTY(QQmlListProperty messageRecords READ messageRecords NOTIFY messageRecordsChanged) Q_PROPERTY(QQmlListProperty filter READ filter NOTIFY filterChanged) Q_PROPERTY(bool orderMatch READ orderMatch WRITE setOrderMatch NOTIFY orderMatchChanged) @@ -66,7 +66,7 @@ public: explicit QDeclarativeNearField(QObject *parent = 0); - QQmlListProperty messageRecords(); + QQmlListProperty messageRecords(); QQmlListProperty filter(); @@ -86,8 +86,8 @@ void _q_handleNdefMessage(const QNdefMessage &message); private: - QList m_message; - QList m_filter; + QList m_message; + QList m_filterList; bool m_orderMatch; bool m_componentCompleted; bool m_messageUpdating; @@ -97,12 +97,12 @@ void registerMessageHandler(); - static void append_messageRecord(QQmlListProperty *list, - QDeclarativeNdefRecord *record); - static int count_messageRecords(QQmlListProperty *list); - static QDeclarativeNdefRecord *at_messageRecord(QQmlListProperty *list, + static void append_messageRecord(QQmlListProperty *list, + QQmlNdefRecord *record); + static int count_messageRecords(QQmlListProperty *list); + static QQmlNdefRecord *at_messageRecord(QQmlListProperty *list, int index); - static void clear_messageRecords(QQmlListProperty *list); + static void clear_messageRecords(QQmlListProperty *list); static void append_filter(QQmlListProperty *list, QDeclarativeNdefFilter *filter); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativenearfieldsocket.cpp qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativenearfieldsocket.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativenearfieldsocket.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativenearfieldsocket.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -46,18 +46,16 @@ /*! \qmltype NearFieldSocket \instantiates QDeclarativeNearFieldSocket - \brief The NearFieldSocket type represents an LLCP socket. + \since 5.2 + \brief Represents an LLCP socket. \ingroup nfc-qml - \inqmlmodule QtNfc 5.0 - - \sa QLlcpSocket - \sa QLlcpServer - - The NearFieldSocket type was introduced in \b {QtNfc 5.0}. + \inqmlmodule QtNfc The NearFieldSocket type can be used to create a peer-to-peer connection over NFC LLCP sockets. NearfieldSocket can be used for both client and server side sockets. + + \internal */ /*! diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativenearfieldsocket_p.h qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativenearfieldsocket_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/imports/nfc/qdeclarativenearfieldsocket_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/imports/nfc/qdeclarativenearfieldsocket_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -47,7 +47,7 @@ #include #include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE class QDeclarativeNearFieldSocketPrivate; diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/checksum_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/checksum_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/checksum_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/checksum_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtNfc 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 CHECKSUM_P_H -#define CHECKSUM_P_H - -// Copied from qbytearray.cpp -// Modified to initialise the crc with 0x6363 instead of 0xffff and to not invert the final result. -static const quint16 crc_tbl[16] = { - 0x0000, 0x1081, 0x2102, 0x3183, - 0x4204, 0x5285, 0x6306, 0x7387, - 0x8408, 0x9489, 0xa50a, 0xb58b, - 0xc60c, 0xd68d, 0xe70e, 0xf78f -}; - -quint16 qNfcChecksum(const char *data, uint len) -{ - register quint16 crc = 0x6363; - uchar c; - const uchar *p = reinterpret_cast(data); - while (len--) { - c = *p++; - crc = ((crc >> 4) & 0x0fff) ^ crc_tbl[((crc ^ c) & 15)]; - c >>= 4; - crc = ((crc >> 4) & 0x0fff) ^ crc_tbl[((crc ^ c) & 15)]; - } - return crc; -} - -#endif // CHECKSUM_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/qtnfc.qdocconf qtconnectivity-opensource-src-5.2.1/src/nfc/doc/qtnfc.qdocconf --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/qtnfc.qdocconf 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/doc/qtnfc.qdocconf 2014-02-01 20:38:03.000000000 +0000 @@ -2,7 +2,7 @@ project = QtNfc description = Qt NFC Reference Documentation -url = http://qt-project.org/doc/qt-$QT_VER/qtnfc +url = http://qt-project.org/doc/qt-$QT_VER version = $QT_VERSION examplesinstallpath = nfc diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/snippets/doc_src_qtnfc.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/doc/snippets/doc_src_qtnfc.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/snippets/doc_src_qtnfc.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/doc/snippets/doc_src_qtnfc.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,6 +43,6 @@ //! [include] //! [namespace] -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE //! [namespace] diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/snippets/doc_src_qtnfc.qml qtconnectivity-opensource-src-5.2.1/src/nfc/doc/snippets/doc_src_qtnfc.qml --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/snippets/doc_src_qtnfc.qml 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/doc/snippets/doc_src_qtnfc.qml 2014-02-01 20:38:03.000000000 +0000 @@ -39,7 +39,7 @@ ****************************************************************************/ //! [import] -import QtNfc 5.0 +import QtNfc 5.2 //! [import] Item { } diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/snippets/foorecord.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/doc/snippets/foorecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/snippets/foorecord.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/doc/snippets/foorecord.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,7 +42,7 @@ #include //! [Declare foo record] -Q_DECLARE_NDEFRECORD(QDeclarativeNdefFooRecord, QNdefRecord::ExternalRtd, "com.example:f") +Q_DECLARE_NDEFRECORD(QQmlNdefFooRecord, QNdefRecord::ExternalRtd, "com.example:f") //! [Declare foo record] //! [createFooRecord] @@ -69,22 +69,22 @@ //! [copyFooRecord] //! [Constructors] -QDeclarativeNdefFooRecord::QDeclarativeNdefFooRecord(QObject *parent) -: QDeclarativeNdefRecord(createFooRecord(), parent) +QQmlNdefFooRecord::QQmlNdefFooRecord(QObject *parent) +: QQmlNdefRecord(createFooRecord(), parent) { } -QDeclarativeNdefFooRecord::QDeclarativeNdefFooRecord(const QNdefRecord &record, QObject *parent) -: QDeclarativeNdefRecord(copyFooRecord(record), parent) +QQmlNdefFooRecord::QQmlNdefFooRecord(const QNdefRecord &record, QObject *parent) +: QQmlNdefRecord(copyFooRecord(record), parent) { } //! [Constructors] -QDeclarativeNdefFooRecord::~QDeclarativeNdefFooRecord() +QQmlNdefFooRecord::~QQmlNdefFooRecord() { } -int QDeclarativeNdefFooRecord::foo() const +int QQmlNdefFooRecord::foo() const { QByteArray payload = record().payload(); @@ -96,7 +96,7 @@ return value; } -void QDeclarativeNdefFooRecord::setFoo(int value) +void QQmlNdefFooRecord::setFoo(int value) { if (foo() == value) return; diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/snippets/foorecord.h qtconnectivity-opensource-src-5.2.1/src/nfc/doc/snippets/foorecord.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/snippets/foorecord.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/doc/snippets/foorecord.h 2014-02-01 20:38:03.000000000 +0000 @@ -41,21 +41,21 @@ #ifndef FOORECORD_H #define FOORECORD_H -#include +#include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE //! [Foo declaration] -class QDeclarativeNdefFooRecord : public QDeclarativeNdefRecord +class QQmlNdefFooRecord : public QQmlNdefRecord { Q_OBJECT Q_PROPERTY(int foo READ foo WRITE setFoo NOTIFY fooChanged) public: - explicit QDeclarativeNdefFooRecord(QObject *parent = 0); - Q_INVOKABLE QDeclarativeNdefFooRecord(const QNdefRecord &record, QObject *parent = 0); - ~QDeclarativeNdefFooRecord(); + explicit QQmlNdefFooRecord(QObject *parent = 0); + Q_INVOKABLE QQmlNdefFooRecord(const QNdefRecord &record, QObject *parent = 0); + ~QQmlNdefFooRecord(); int foo() const; void setFoo(int value); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/snippets/nfc.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/doc/snippets/nfc.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/snippets/nfc.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/doc/snippets/nfc.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,7 +43,7 @@ #include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE void snippet_recordConversion() { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/src/examples.qdoc qtconnectivity-opensource-src-5.2.1/src/nfc/doc/src/examples.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/src/examples.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/doc/src/examples.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -29,10 +29,10 @@ \ingroup all-examples \page nfc-examples.html \title Qt NFC Examples -\brief Examples for the QtNfc module +\brief Examples for the Qt NFC module. -This is a variety of examples that cover the entire range of the the Qt NFC API. You will find them -in their own documentation but are also accessible from here. +This is a variety of examples that cover the entire range of the Qt NFC API. You will find them +in their own documentation, but they are also accessible from here. \section2 C++ Tutorial diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/src/nfc-cpp.qdoc qtconnectivity-opensource-src-5.2.1/src/nfc/doc/src/nfc-cpp.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/src/nfc-cpp.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/doc/src/nfc-cpp.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -28,12 +28,12 @@ \module QtNfc \ingroup modules +\qtvariable nfc \title Qt NFC C++ Classes -\brief An API for accessing NFC Forum Tags and communication with NFC Forum Devices. +\brief An API for accessing NFC Forum Tags. -The \l{Qt NFC} C++ API enables an application to access NFC Forum Tags and communication with NFC -Forum Devices. +The \l{Qt NFC} C++ API enables an application to access NFC Forum Tags. To use the C++ library in your application, add the following configuration option to your \c .pro file: diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/src/nfc-index.qdoc qtconnectivity-opensource-src-5.2.1/src/nfc/doc/src/nfc-index.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/src/nfc-index.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/doc/src/nfc-index.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -28,16 +28,15 @@ /*! \page qtnfc-index.html \title Qt NFC -\brief Qt NFC enables connectivity between NFC enabled devices. +\brief Enables connectivity between NFC enabled devices. NFC is an extremely short-range (less than 20 centimeters) wireless technology and has a -maximum transfer rate of 424 kbit/s. NFC is ideal for transferring small packets of data when two +maximum transfer rate of 424 kbit/s. NFC is ideal for transferring small packets of data when two devices are touched together. The NFC API provides APIs for interacting with NFC Forum Tags and NFC Forum Devices, including target detection and loss, registering NDEF message handlers, reading and writing NDEF messages -on NFC Forum Tags, sending tag specific commands, client and server LLCP sockets for bidirectional -communication between two NFC Forum Devices. +on NFC Forum Tags and sending tag specific commands. \section1 Getting started diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/src/nfc-overview.qdoc qtconnectivity-opensource-src-5.2.1/src/nfc/doc/src/nfc-overview.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/src/nfc-overview.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/doc/src/nfc-overview.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -29,25 +29,21 @@ \ingroup technology-apis \title Qt NFC Overview \page qtnfc-overview.html -\brief The Qt NFC classes provides access to NFC enabled devices. +\brief Provides access to NFC enabled devices. \tableofcontents With the Qt NFC API typical use cases are: \list - \li Detect NFC devices entering and leaving communication range. + \li Detect NFC tags entering and leaving the communication range. \li Read and write NDEF message on NFC Forum Tags. - \li Create an LLCP server listening for incoming LLCP socket connections. - \li Create an LLCP socket connection to a NFC Forum Device. \li Register an NDEF message handler for a particular content type. \endlist -The following sections describe how to use QtNfc C++ classes for the above use cases. +The following sections describe how to use Qt NFC C++ classes for the above use cases. -\section1 Detect NFC devices entering and leaving communication range. -\section1 Read and write NDEF message on NFC Forum Tags. -\section1 Create an LLCP server listening for incoming LLCP socket connections. -\section1 Create an LLCP socket connection to a NFC Forum Device. +\section1 Detect NFC tags entering and leaving communication range. +\section1 Read and write an NDEF message on NFC Forum Tags. \section1 Register an NDEF message handler for a particular content type. */ diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/src/nfc-qml.qdoc qtconnectivity-opensource-src-5.2.1/src/nfc/doc/src/nfc-qml.qdoc --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/doc/src/nfc-qml.qdoc 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/doc/src/nfc-qml.qdoc 2014-02-01 20:38:03.000000000 +0000 @@ -28,12 +28,12 @@ /*! -\qmlmodule QtNfc 5.0 +\qmlmodule QtNfc 5.2 \title Qt NFC QML Types \ingroup qmlmodules -\brief Provides QML types for accessing NFC Forum Tags and Devices +\brief Provides QML types for accessing NFC Forum Tags. -To use the classes of the module in your application you need the following +To use the classes of the module in your application, you need the following import statement in your \c .qml file: \snippet doc_src_qtnfc.qml import diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/nfc.pro qtconnectivity-opensource-src-5.2.1/src/nfc/nfc.pro --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/nfc.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/nfc.pro 2014-02-01 20:38:03.000000000 +0000 @@ -15,12 +15,12 @@ qndefmessage.h \ qndeffilter.h \ qndefnfcurirecord.h \ - qllcpsocket.h \ - qllcpserver.h \ - qdeclarativendefrecord.h \ + qqmlndefrecord.h \ qndefnfcsmartposterrecord.h PRIVATE_HEADERS += \ + qllcpsocket_p.h \ + qllcpserver_p.h \ qndefrecord_p.h \ qnearfieldtarget_p.h \ qnearfieldmanager_p.h \ @@ -29,7 +29,6 @@ qnearfieldtagtype3_p.h \ qnearfieldtagtype4_p.h \ qtlv_p.h \ - checksum_p.h \ qndefnfcsmartposterrecord_p.h SOURCES += \ @@ -47,14 +46,14 @@ qnearfieldtagtype4.cpp \ qtlv.cpp \ qllcpserver.cpp \ - qdeclarativendefrecord.cpp \ + qqmlndefrecord.cpp \ qndefnfcsmartposterrecord.cpp -qnx { +CONFIG(blackberry) { NFC_BACKEND_AVAILABLE = yes DEFINES += QNX_NFC #QQNXNFC_DEBUG - LIBS += -lnfc + LIBS_PRIVATE += -lnfc PRIVATE_HEADERS += \ qllcpserver_qnx_p.h \ @@ -94,8 +93,8 @@ message("Unsupported NFC platform, will not build a working QtNfc library.") PRIVATE_HEADERS += \ - qllcpsocket_p.h \ - qllcpserver_p.h \ + qllcpsocket_p_p.h \ + qllcpserver_p_p.h \ qnearfieldmanagerimpl_p.h SOURCES += \ diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qdeclarativendefrecord.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qdeclarativendefrecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qdeclarativendefrecord.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qdeclarativendefrecord.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,291 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtNfc 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 "qdeclarativendefrecord.h" - -#include -#include - -QT_BEGIN_NAMESPACE_NFC - -/*! - \class QDeclarativeNdefRecord - \brief The QDeclarativeNdefRecord class implements the NdefRecord type in QML. - - \ingroup connectivity-nfc - \inmodule QtNfc - - \sa NdefRecord - - The QDeclarativeNdefRecord class is the base class for all NdefRecord types in QML. To - support a new NDEF record type in QML subclass this class and expose new properties, member - functions and signals appropriate for the new record type. The following must be done to - create a new NDEF record type in QML: - - \list - \li The subclass must have a Q_OBJECT macro in its declaration. - \li The subclass must have an \l {Q_INVOKABLE}{invokable} constructor that takes a - QNdefRecord and a QObject pointer. - \li The subclass must be declared as an NDEF record by expanding the Q_DECLARE_NDEFRECORD() - macro in the implementation file of the subclass. - \li The subclass must be registered with QML. - \endlist - - For example the declaration of such a class may look like the following. - - \snippet foorecord.h Foo declaration - - Within the implementation file the Q_DECLARE_NDEFRECORD() macro is expanded: - - \snippet foorecord.cpp Declare foo record - - Finially the application or plugin code calls qmlRegisterType(): - - \code - qmlRegisterType(uri, 1, 0, "NdefFooRecord"); - \endcode -*/ - -/*! - \qmltype NdefRecord - \instantiates QDeclarativeNdefRecord - \brief The NdefRecord type represents a record in an NDEF message. - - \ingroup nfc-qml - \inqmlmodule QtNfc 5.0 - - \sa NdefFilter - \sa NearField - - \sa QNdefRecord - - The NdefRecord type is the base type for all NDEF record types in QML. It contains - a single property holding the type of record. - - This class is not intended to be used directly, but extended from C++. - - \sa QDeclarativeNdefRecord -*/ - -/*! - \qmlproperty string NdefRecord::recordType - - This property holds the fully qualified record type of the NDEF record. The fully qualified - record type includes the NIS and NSS prefixes. -*/ - -/*! - \qmlproperty string NdefRecord::record - - This property holds the NDEF record. -*/ - -/*! - \fn void QDeclarativeNdefRecord::recordTypeChanged() - - This signal is emitted when the record type changes. -*/ - -/*! - \property QDeclarativeNdefRecord::record - - This property hold the NDEF record that this class represents. -*/ - -/*! - \property QDeclarativeNdefRecord::recordType - - This property hold the record type of the NDEF record that this class represents. -*/ - -/*! - \macro Q_DECLARE_NDEFRECORD(className, typeNameFormat, type) - \relates QDeclarativeNdefRecord - - This macro ensures that \a className is declared as the class implementing the NDEF record - identified by \a typeNameFormat and \a type. - - This macro should be expanded in the implementation file for \a className. -*/ - -static QMap registeredNdefRecordTypes; - -class QDeclarativeNdefRecordPrivate -{ -public: - QNdefRecord record; -}; - -static QString urnForRecordType(QNdefRecord::TypeNameFormat typeNameFormat, const QByteArray &type) -{ - switch (typeNameFormat) { - case QNdefRecord::NfcRtd: - return QLatin1String("urn:nfc:wkt:") + QString::fromLatin1(type); - case QNdefRecord::ExternalRtd: - return QLatin1String("urn:nfc:ext:") + QString::fromLatin1(type); - case QNdefRecord::Mime: - return QLatin1String("urn:nfc:mime:") + QString::fromLatin1(type); - default: - return QString(); - } -} - -/*! - \internal -*/ -void qRegisterNdefRecordTypeHelper(const QMetaObject *metaObject, - QNdefRecord::TypeNameFormat typeNameFormat, - const QByteArray &type) -{ - registeredNdefRecordTypes.insert(urnForRecordType(typeNameFormat, type), metaObject); -} - -/*! - \internal -*/ -QDeclarativeNdefRecord *qNewDeclarativeNdefRecordForNdefRecord(const QNdefRecord &record) -{ - const QString urn = urnForRecordType(record.typeNameFormat(), record.type()); - - QMapIterator i(registeredNdefRecordTypes); - while (i.hasNext()) { - i.next(); - - QRegExp ex(i.key()); - if (!ex.exactMatch(urn)) - continue; - - const QMetaObject *metaObject = i.value(); - if (!metaObject) - continue; - - return static_cast(metaObject->newInstance( - Q_ARG(QNdefRecord, record), Q_ARG(QObject *, 0))); - } - - return new QDeclarativeNdefRecord(record); -} - -/*! - Constructs a new empty QDeclarativeNdefRecord with \a parent. -*/ -QDeclarativeNdefRecord::QDeclarativeNdefRecord(QObject *parent) -: QObject(parent), d_ptr(new QDeclarativeNdefRecordPrivate) -{ -} - -/*! - Constructs a new QDeclarativeNdefRecord representing \a record. The parent of the newly - constructed object will be set to \a parent. -*/ -QDeclarativeNdefRecord::QDeclarativeNdefRecord(const QNdefRecord &record, QObject *parent) -: QObject(parent), d_ptr(new QDeclarativeNdefRecordPrivate) -{ - d_ptr->record = record; -} - -/*! - Returns the fully qualified record type of the record. The fully qualified record type - includes both the NIS and NSS prefixes. -*/ -QString QDeclarativeNdefRecord::recordType() const -{ - Q_D(const QDeclarativeNdefRecord); - - if (d->record.typeNameFormat() == QNdefRecord::Empty) - return QString(); - - return urnForRecordType(d->record.typeNameFormat(), d->record.type()); -} - -/*! - Sets the record type to \a type if it is not currently equal to \a type; otherwise does - nothing. If the record type is set the recordTypeChanged() signal will be emitted. -*/ -void QDeclarativeNdefRecord::setRecordType(const QString &type) -{ - if (type == recordType()) - return; - - Q_D(QDeclarativeNdefRecord); - - if (type.startsWith(QLatin1String("urn:nfc:wkt:"))) { - d->record.setTypeNameFormat(QNdefRecord::NfcRtd); - d->record.setType(type.mid(12).toUtf8()); - } else if (type.startsWith(QLatin1String("urn:nfc:ext:"))) { - d->record.setTypeNameFormat(QNdefRecord::ExternalRtd); - d->record.setType(type.mid(12).toUtf8()); - } else if (type.startsWith(QLatin1String("urn:nfc:mime:"))) { - d->record.setTypeNameFormat(QNdefRecord::Mime); - d->record.setType(type.mid(13).toUtf8()); - } else { - qWarning("Don't know how to decode NDEF type %s\n", qPrintable(type)); - } - - emit recordTypeChanged(); -} - -/*! - Returns a copy of the record. -*/ -QNdefRecord QDeclarativeNdefRecord::record() const -{ - Q_D(const QDeclarativeNdefRecord); - - return d->record; -} - -/*! - Sets the record to \a record. If the record is set the recordChanged() signal will - be emitted. -*/ -void QDeclarativeNdefRecord::setRecord(const QNdefRecord &record) -{ - Q_D(QDeclarativeNdefRecord); - - if (d->record == record) - return; - - d->record = record; - emit recordChanged(); -} - -QT_END_NAMESPACE_NFC diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qdeclarativendefrecord.h qtconnectivity-opensource-src-5.2.1/src/nfc/qdeclarativendefrecord.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qdeclarativendefrecord.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qdeclarativendefrecord.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtNfc 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 QDECLARATIVENDEFRECORD_P_H -#define QDECLARATIVENDEFRECORD_P_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE_NFC - -class QDeclarativeNdefRecordPrivate; - -class Q_NFC_EXPORT QDeclarativeNdefRecord : public QObject -{ - Q_OBJECT - - Q_DECLARE_PRIVATE(QDeclarativeNdefRecord) - - Q_PROPERTY(QString recordType READ recordType WRITE setRecordType NOTIFY recordTypeChanged) - Q_PROPERTY(QNdefRecord record READ record WRITE setRecord NOTIFY recordChanged) - -public: - explicit QDeclarativeNdefRecord(QObject *parent = 0); - explicit QDeclarativeNdefRecord(const QNdefRecord &record, QObject *parent = 0); - - QString recordType() const; - void setRecordType(const QString &t); - - QNdefRecord record() const; - void setRecord(const QNdefRecord &record); - -Q_SIGNALS: - void recordTypeChanged(); - void recordChanged(); - -private: - QDeclarativeNdefRecordPrivate *d_ptr; -}; - -void Q_NFC_EXPORT qRegisterNdefRecordTypeHelper(const QMetaObject *metaObject, - QNdefRecord::TypeNameFormat typeNameFormat, - const QByteArray &type); - -Q_NFC_EXPORT QDeclarativeNdefRecord *qNewDeclarativeNdefRecordForNdefRecord(const QNdefRecord &record); - -template -bool qRegisterNdefRecordType(QNdefRecord::TypeNameFormat typeNameFormat, const QByteArray &type) -{ - qRegisterNdefRecordTypeHelper(&T::staticMetaObject, typeNameFormat, type); - return true; -} - -#define Q_DECLARE_NDEFRECORD(className, typeNameFormat, type) \ -static bool _q_##className##_registered = qRegisterNdefRecordType(typeNameFormat, type); - -QT_END_NAMESPACE_NFC - -#endif // QDECLARATIVENDEFRECORD_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -39,21 +39,22 @@ ** ****************************************************************************/ -#include "qllcpserver.h" +#include "qllcpserver_p.h" #if defined(QT_SIMULATOR) #include "qllcpserver_simulator_p.h" #elif defined(QNX_NFC) #include "qllcpserver_qnx_p.h" #else -#include "qllcpserver_p.h" +#include "qllcpserver_p_p.h" #endif -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QLlcpServer \brief The QLlcpServer class provides an NFC LLCP socket based server. + \internal \ingroup connectivity-nfc \inmodule QtNfc @@ -198,4 +199,4 @@ return d->serverError(); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver.h qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtNfc 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 QLLCPSERVER_H -#define QLLCPSERVER_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE_NFC - -class QLlcpServerPrivate; - -class Q_NFC_EXPORT QLlcpServer : public QObject -{ - Q_OBJECT - - Q_DECLARE_PRIVATE(QLlcpServer) - -public: - explicit QLlcpServer(QObject *parent = 0); - virtual ~QLlcpServer(); - - bool listen(const QString &serviceUri); - bool isListening() const; - - void close(); - - QString serviceUri() const; - quint8 serverPort() const; - - virtual bool hasPendingConnections() const; - virtual QLlcpSocket *nextPendingConnection(); - - QLlcpSocket::SocketError serverError() const; - -Q_SIGNALS: - void newConnection(); - -private: - QLlcpServerPrivate *d_ptr; -}; - -QT_END_NAMESPACE_NFC - -#endif // QLLCPSERVER_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_p.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qllcpserver_p.h" +#include "qllcpserver_p_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE QLlcpServerPrivate::QLlcpServerPrivate(QLlcpServer *q) : q_ptr(q) @@ -93,4 +93,4 @@ return QLlcpSocket::UnknownSocketError; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -39,22 +39,37 @@ ** ****************************************************************************/ -#ifndef QLLCPSERVER_P_H -#define QLLCPSERVER_P_H +#ifndef QLLCPSERVER_H +#define QLLCPSERVER_H -#include "qnfcglobal.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 +#include +#include "qllcpsocket_p.h" -#include "qllcpserver.h" +QT_BEGIN_NAMESPACE -QT_BEGIN_NAMESPACE_NFC +class QLlcpServerPrivate; -class QLlcpServerPrivate +class Q_NFC_EXPORT QLlcpServer : public QObject { - Q_DECLARE_PUBLIC(QLlcpServer) + Q_OBJECT + + Q_DECLARE_PRIVATE(QLlcpServer) public: - QLlcpServerPrivate(QLlcpServer *q); - ~QLlcpServerPrivate(); + explicit QLlcpServer(QObject *parent = 0); + virtual ~QLlcpServer(); bool listen(const QString &serviceUri); bool isListening() const; @@ -64,15 +79,18 @@ QString serviceUri() const; quint8 serverPort() const; - bool hasPendingConnections() const; - QLlcpSocket *nextPendingConnection(); + virtual bool hasPendingConnections() const; + virtual QLlcpSocket *nextPendingConnection(); QLlcpSocket::SocketError serverError() const; +Q_SIGNALS: + void newConnection(); + private: - QLlcpServer *q_ptr; + QLlcpServerPrivate *d_ptr; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE -#endif // QLLCPSERVER_P_H +#endif // QLLCPSERVER_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_p_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_p_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_p_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_p_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtNfc 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 QLLCPSERVER_P_H +#define QLLCPSERVER_P_H + +#include "qnfcglobal.h" + +#include "qllcpserver_p.h" + +QT_BEGIN_NAMESPACE + +class QLlcpServerPrivate +{ + Q_DECLARE_PUBLIC(QLlcpServer) + +public: + QLlcpServerPrivate(QLlcpServer *q); + ~QLlcpServerPrivate(); + + bool listen(const QString &serviceUri); + bool isListening() const; + + void close(); + + QString serviceUri() const; + quint8 serverPort() const; + + bool hasPendingConnections() const; + QLlcpSocket *nextPendingConnection(); + + QLlcpSocket::SocketError serverError() const; + +private: + QLlcpServer *q_ptr; +}; + +QT_END_NAMESPACE + +#endif // QLLCPSERVER_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_qnx_p.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_qnx_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_qnx_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_qnx_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,7 +42,7 @@ #include "qllcpserver_qnx_p.h" #include "qnx/qnxnfcmanager_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE QLlcpServerPrivate::QLlcpServerPrivate(QLlcpServer *q) : q_ptr(q), m_llcpSocket(0), m_connected(false), m_conListener(0) @@ -123,6 +123,6 @@ m_llcpSocket->bind(serverPort()); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_qnx_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_qnx_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_qnx_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_qnx_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -42,10 +42,10 @@ #ifndef QLLCPSERVER_QNX_P_H #define QLLCPSERVER_QNX_P_H -#include "qllcpserver.h" +#include "qllcpserver_p.h" #include "nfc/nfc.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QLlcpServerPrivate : public QObject { @@ -78,6 +78,6 @@ nfc_target_t *m_target; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QLLCPSERVER_QNX_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_simulator_p.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_simulator_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_simulator_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_simulator_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -41,7 +41,7 @@ #include "qllcpserver_simulator_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE QLlcpServerPrivate::QLlcpServerPrivate(QLlcpServer *q) : q_ptr(q) @@ -89,4 +89,4 @@ return QLlcpSocket::UnknownSocketError; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_simulator_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_simulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpserver_simulator_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpserver_simulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -44,9 +44,9 @@ #include -#include "qllcpserver.h" +#include "qllcpserver_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QLlcpServerPrivate { @@ -70,6 +70,6 @@ QLlcpServer *q_ptr; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QLLCPSERVER_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -39,21 +39,22 @@ ** ****************************************************************************/ -#include "qllcpsocket.h" +#include "qllcpsocket_p.h" #if defined(QT_SIMULATOR) #include "qllcpsocket_simulator_p.h" #elif defined(QNX_NFC) #include "qllcpsocket_qnx_p.h" #else -#include "qllcpsocket_p.h" +#include "qllcpsocket_p_p.h" #endif -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QLlcpSocket \brief The QLlcpSocket class provides an NFC LLCP socket. + \internal \ingroup connectivity-nfc \inmodule QtNfc @@ -400,4 +401,4 @@ return d->writeData(data, len); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket.h qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtNfc 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 QLLCPSOCKET_H -#define QLLCPSOCKET_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE_NFC - -class QNearFieldTarget; -class QLlcpSocketPrivate; - -class Q_NFC_EXPORT QLlcpSocket : public QIODevice -{ - Q_OBJECT - - Q_DECLARE_PRIVATE(QLlcpSocket) - - friend class QLlcpServerPrivate; - -public: - enum SocketState { - UnconnectedState = QAbstractSocket::UnconnectedState, - ConnectingState = QAbstractSocket::ConnectingState, - ConnectedState = QAbstractSocket::ConnectedState, - ClosingState = QAbstractSocket::ClosingState, - BoundState = QAbstractSocket::BoundState, - ListeningState = QAbstractSocket::ListeningState - }; - - enum SocketError { - UnknownSocketError = QAbstractSocket::UnknownSocketError, - RemoteHostClosedError = QAbstractSocket::RemoteHostClosedError, - SocketAccessError = QAbstractSocket::SocketAccessError, - SocketResourceError = QAbstractSocket::SocketResourceError - }; - - explicit QLlcpSocket(QObject *parent = 0); - ~QLlcpSocket(); - - void connectToService(QNearFieldTarget *target, const QString &serviceUri); - void disconnectFromService(); - - void close(); - - bool bind(quint8 port); - - bool hasPendingDatagrams() const; - qint64 pendingDatagramSize() const; - - qint64 writeDatagram(const char *data, qint64 size); - qint64 writeDatagram(const QByteArray &datagram); - - qint64 readDatagram(char *data, qint64 maxSize, - QNearFieldTarget **target = 0, quint8 *port = 0); - qint64 writeDatagram(const char *data, qint64 size, - QNearFieldTarget *target, quint8 port); - qint64 writeDatagram(const QByteArray &datagram, QNearFieldTarget *target, quint8 port); - - SocketError error() const; - SocketState state() const; - - qint64 bytesAvailable() const; - bool canReadLine() const; - - bool waitForReadyRead(int msecs = 30000); - bool waitForBytesWritten(int msecs = 30000); - virtual bool waitForConnected(int msecs = 30000); - virtual bool waitForDisconnected(int msecs = 30000); - bool isSequential() const; - -Q_SIGNALS: - void connected(); - void disconnected(); - void error(QLlcpSocket::SocketError socketError); - void stateChanged(QLlcpSocket::SocketState socketState); - -protected: - qint64 readData(char *data, qint64 maxlen); - qint64 writeData(const char *data, qint64 len); - -private: - QLlcpSocket(QLlcpSocketPrivate *d, QObject *parent); - - QLlcpSocketPrivate *d_ptr; -}; - -QT_END_NAMESPACE_NFC - -#endif // QLLCPSOCKET_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_p.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qllcpsocket_p.h" +#include "qllcpsocket_p_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE QLlcpSocketPrivate::QLlcpSocketPrivate(QLlcpSocket *q) : q_ptr(q) @@ -191,4 +191,4 @@ return false; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -39,27 +39,62 @@ ** ****************************************************************************/ -#ifndef QLLCPSOCKET_P_H -#define QLLCPSOCKET_P_H +#ifndef QLLCPSOCKET_H +#define QLLCPSOCKET_H -#include "qnfcglobal.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 +#include +#include -#include "qllcpsocket.h" +QT_BEGIN_NAMESPACE -QT_BEGIN_NAMESPACE_NFC +class QNearFieldTarget; +class QLlcpSocketPrivate; -class QLlcpSocketPrivate +class Q_NFC_EXPORT QLlcpSocket : public QIODevice { - Q_DECLARE_PUBLIC(QLlcpSocket) + Q_OBJECT + + Q_DECLARE_PRIVATE(QLlcpSocket) + + friend class QLlcpServerPrivate; public: - QLlcpSocketPrivate(QLlcpSocket *q); + enum SocketState { + UnconnectedState = QAbstractSocket::UnconnectedState, + ConnectingState = QAbstractSocket::ConnectingState, + ConnectedState = QAbstractSocket::ConnectedState, + ClosingState = QAbstractSocket::ClosingState, + BoundState = QAbstractSocket::BoundState, + ListeningState = QAbstractSocket::ListeningState + }; + + enum SocketError { + UnknownSocketError = QAbstractSocket::UnknownSocketError, + RemoteHostClosedError = QAbstractSocket::RemoteHostClosedError, + SocketAccessError = QAbstractSocket::SocketAccessError, + SocketResourceError = QAbstractSocket::SocketResourceError + }; + + explicit QLlcpSocket(QObject *parent = 0); + ~QLlcpSocket(); - ~QLlcpSocketPrivate(); - void connectToService(QNearFieldTarget *target, const QString &serviceUri); void disconnectFromService(); + void close(); + bool bind(quint8 port); bool hasPendingDatagrams() const; @@ -74,24 +109,34 @@ QNearFieldTarget *target, quint8 port); qint64 writeDatagram(const QByteArray &datagram, QNearFieldTarget *target, quint8 port); - QLlcpSocket::SocketError error() const; - QLlcpSocket::SocketState state() const; - - qint64 readData(char *data, qint64 maxlen); - qint64 writeData(const char *data, qint64 len); + SocketError error() const; + SocketState state() const; qint64 bytesAvailable() const; bool canReadLine() const; - bool waitForReadyRead(int msecs); - bool waitForBytesWritten(int msecs); - bool waitForConnected(int msecs); - bool waitForDisconnected(int msecs); + bool waitForReadyRead(int msecs = 30000); + bool waitForBytesWritten(int msecs = 30000); + virtual bool waitForConnected(int msecs = 30000); + virtual bool waitForDisconnected(int msecs = 30000); + bool isSequential() const; + +Q_SIGNALS: + void connected(); + void disconnected(); + void error(QLlcpSocket::SocketError socketError); + void stateChanged(QLlcpSocket::SocketState socketState); + +protected: + qint64 readData(char *data, qint64 maxlen); + qint64 writeData(const char *data, qint64 len); private: - QLlcpSocket *q_ptr; + QLlcpSocket(QLlcpSocketPrivate *d, QObject *parent); + + QLlcpSocketPrivate *d_ptr; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE -#endif // QLLCPSOCKET_P_H +#endif // QLLCPSOCKET_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_p_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_p_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_p_p.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_p_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtNfc 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 QLLCPSOCKET_P_H +#define QLLCPSOCKET_P_H + +#include "qnfcglobal.h" + +#include "qllcpsocket_p.h" + +QT_BEGIN_NAMESPACE + +class QLlcpSocketPrivate +{ + Q_DECLARE_PUBLIC(QLlcpSocket) + +public: + QLlcpSocketPrivate(QLlcpSocket *q); + + ~QLlcpSocketPrivate(); + + void connectToService(QNearFieldTarget *target, const QString &serviceUri); + void disconnectFromService(); + + bool bind(quint8 port); + + bool hasPendingDatagrams() const; + qint64 pendingDatagramSize() const; + + qint64 writeDatagram(const char *data, qint64 size); + qint64 writeDatagram(const QByteArray &datagram); + + qint64 readDatagram(char *data, qint64 maxSize, + QNearFieldTarget **target = 0, quint8 *port = 0); + qint64 writeDatagram(const char *data, qint64 size, + QNearFieldTarget *target, quint8 port); + qint64 writeDatagram(const QByteArray &datagram, QNearFieldTarget *target, quint8 port); + + QLlcpSocket::SocketError error() const; + QLlcpSocket::SocketState state() const; + + qint64 readData(char *data, qint64 maxlen); + qint64 writeData(const char *data, qint64 len); + + qint64 bytesAvailable() const; + bool canReadLine() const; + + bool waitForReadyRead(int msecs); + bool waitForBytesWritten(int msecs); + bool waitForConnected(int msecs); + bool waitForDisconnected(int msecs); + +private: + QLlcpSocket *q_ptr; +}; + +QT_END_NAMESPACE + +#endif // QLLCPSOCKET_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_qnx_p.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_qnx_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_qnx_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_qnx_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,7 +42,7 @@ #include "qllcpsocket_qnx_p.h" #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE QLlcpSocketPrivate::QLlcpSocketPrivate(QLlcpSocket *q) : q_ptr(q), m_conListener(0), m_state(QLlcpSocket::UnconnectedState), m_server(false) @@ -313,5 +313,5 @@ } } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_qnx_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_qnx_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_qnx_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_qnx_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -42,11 +42,11 @@ #ifndef QLLCPSOCKET_QNX_P_H #define QLLCPSOCKET_QNX_P_H -#include "qllcpsocket.h" +#include "qllcpsocket_p.h" #include "qnearfieldtarget_qnx_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QLlcpSocketPrivate : public QObject { @@ -120,6 +120,6 @@ void enteringIdle(); }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QLLCPSOCKET_QNX_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_simulator_p.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_simulator_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_simulator_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_simulator_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -41,7 +41,7 @@ #include "qllcpsocket_simulator_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE QLlcpSocketPrivate::QLlcpSocketPrivate(QLlcpSocket *q) : q_ptr(q) @@ -186,4 +186,4 @@ return false; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_simulator_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_simulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qllcpsocket_simulator_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qllcpsocket_simulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -44,9 +44,9 @@ #include -#include "qllcpsocket.h" +#include "qllcpsocket_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QLlcpSocketPrivate { @@ -90,6 +90,6 @@ QLlcpSocket *q_ptr; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QLLCPSOCKET_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndeffilter.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qndeffilter.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndeffilter.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndeffilter.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,7 +43,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNdefFilter @@ -201,4 +201,4 @@ return d->filterRecords.count(); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndeffilter.h qtconnectivity-opensource-src-5.2.1/src/nfc/qndeffilter.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndeffilter.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndeffilter.h 2014-02-01 20:38:03.000000000 +0000 @@ -46,7 +46,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNdefFilterPrivate; class Q_NFC_EXPORT QNdefFilter @@ -91,6 +91,6 @@ appendRecord(record.typeNameFormat(), record.type(), min, max); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNDEFFILTER_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefmessage.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qndefmessage.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefmessage.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefmessage.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -42,7 +42,7 @@ #include "qndefmessage.h" #include "qndefrecord_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNdefMessage @@ -321,4 +321,4 @@ return m; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefmessage.h qtconnectivity-opensource-src-5.2.1/src/nfc/qndefmessage.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefmessage.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefmessage.h 2014-02-01 20:38:03.000000000 +0000 @@ -49,7 +49,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class Q_NFC_EXPORT QNdefMessage : public QList { @@ -66,8 +66,8 @@ static QNdefMessage fromByteArray(const QByteArray &message); }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE -Q_DECLARE_METATYPE(QtNfc::QNdefMessage) +Q_DECLARE_METATYPE(QNdefMessage) #endif // QNDEFMESSAGE_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfcsmartposterrecord.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfcsmartposterrecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfcsmartposterrecord.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfcsmartposterrecord.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -47,7 +47,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNdefNfcSmartPosterRecord @@ -91,6 +91,14 @@ } /*! + Constructs a new smart poster that is a copy of \a other. +*/ +QNdefNfcSmartPosterRecord::QNdefNfcSmartPosterRecord(const QNdefNfcSmartPosterRecord &other) + : QNdefRecord(other, QNdefRecord::NfcRtd, "Sp"), d(other.d) +{ +} + +/*! Destroys the smart poster. */ QNdefNfcSmartPosterRecord::~QNdefNfcSmartPosterRecord() @@ -729,4 +737,4 @@ return payload(); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfcsmartposterrecord.h qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfcsmartposterrecord.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfcsmartposterrecord.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfcsmartposterrecord.h 2014-02-01 20:38:03.000000000 +0000 @@ -50,17 +50,17 @@ QT_FORWARD_DECLARE_CLASS(QUrl) -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNdefNfcSmartPosterRecordPrivate; #define Q_DECLARE_ISRECORDTYPE_FOR_MIME_NDEF_RECORD(className) \ - QT_BEGIN_NAMESPACE_NFC \ + QT_BEGIN_NAMESPACE \ template<> inline bool QNdefRecord::isRecordType() const\ { \ return (typeNameFormat() == QNdefRecord::Mime); \ } \ - QT_END_NAMESPACE_NFC + QT_END_NAMESPACE #define Q_DECLARE_MIME_NDEF_RECORD(className, initialPayload) \ className() : QNdefRecord(QNdefRecord::Mime, "") { setPayload(initialPayload); } \ @@ -87,6 +87,7 @@ QNdefNfcSmartPosterRecord(); QNdefNfcSmartPosterRecord(const QNdefRecord &other); + QNdefNfcSmartPosterRecord(const QNdefNfcSmartPosterRecord &other); ~QNdefNfcSmartPosterRecord(); void setPayload(const QByteArray &payload); @@ -144,7 +145,7 @@ void addIconInternal(const QNdefNfcIconRecord &icon); }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE Q_DECLARE_ISRECORDTYPE_FOR_NDEF_RECORD(QNdefNfcSmartPosterRecord, QNdefRecord::NfcRtd, "Sp") Q_DECLARE_ISRECORDTYPE_FOR_MIME_NDEF_RECORD(QNdefNfcIconRecord) diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfcsmartposterrecord_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfcsmartposterrecord_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfcsmartposterrecord_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfcsmartposterrecord_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -42,7 +42,7 @@ #ifndef QNDEFNFCSMARTPOSTERRECORD_P_H #define QNDEFNFCSMARTPOSTERRECORD_P_H -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNdefNfcActRecord : public QNdefRecord { @@ -85,7 +85,7 @@ QNdefNfcTypeRecord *m_type; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE Q_DECLARE_ISRECORDTYPE_FOR_NDEF_RECORD(QNdefNfcActRecord, QNdefRecord::NfcRtd, "act") Q_DECLARE_ISRECORDTYPE_FOR_NDEF_RECORD(QNdefNfcSizeRecord, QNdefRecord::NfcRtd, "s") diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfctextrecord.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfctextrecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfctextrecord.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfctextrecord.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -44,7 +44,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNdefNfcTextRecord @@ -200,4 +200,4 @@ setText(string); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfctextrecord.h qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfctextrecord.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfctextrecord.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfctextrecord.h 2014-02-01 20:38:03.000000000 +0000 @@ -45,7 +45,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class Q_NFC_EXPORT QNdefNfcTextRecord : public QNdefRecord { @@ -72,7 +72,7 @@ void setEncoding(Encoding encoding); }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE Q_DECLARE_ISRECORDTYPE_FOR_NDEF_RECORD(QNdefNfcTextRecord, QNdefRecord::NfcRtd, "T") diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfcurirecord.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfcurirecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfcurirecord.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfcurirecord.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -46,7 +46,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNdefNfcUriRecord @@ -154,4 +154,4 @@ setPayload(p); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfcurirecord.h qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfcurirecord.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefnfcurirecord.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefnfcurirecord.h 2014-02-01 20:38:03.000000000 +0000 @@ -47,7 +47,7 @@ QT_FORWARD_DECLARE_CLASS(QUrl) -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class Q_NFC_EXPORT QNdefNfcUriRecord : public QNdefRecord { @@ -63,7 +63,7 @@ void setUri(const QUrl &uri); }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE Q_DECLARE_ISRECORDTYPE_FOR_NDEF_RECORD(QNdefNfcUriRecord, QNdefRecord::NfcRtd, "U") diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefrecord.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qndefrecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefrecord.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefrecord.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -45,7 +45,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNdefRecord @@ -57,7 +57,7 @@ QNdefRecord and derived classes are used to parse the contents of \l {QNdefMessage}{NDEF messages} and create new NDEF messages. - Use typeNameFormat(), userTypeNameFormat(), setTypeNameFormat() and setUserTypeNameFormat() to + Use typeNameFormat() and setTypeNameFormat() to get and set the type name format of the NDEF record. Use type() and setType() to get and set the type of the NDEF record. @@ -366,4 +366,4 @@ return true; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefrecord.h qtconnectivity-opensource-src-5.2.1/src/nfc/qndefrecord.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefrecord.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefrecord.h 2014-02-01 20:38:03.000000000 +0000 @@ -46,7 +46,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNdefRecordPrivate; @@ -106,15 +106,15 @@ className(const QNdefRecord &other) : QNdefRecord(other, typeNameFormat, type) { } #define Q_DECLARE_ISRECORDTYPE_FOR_NDEF_RECORD(className, typeNameFormat_, type_) \ - QT_BEGIN_NAMESPACE_NFC \ + QT_BEGIN_NAMESPACE \ template<> inline bool QNdefRecord::isRecordType() const\ { \ return (typeNameFormat() == typeNameFormat_ && type() == type_); \ } \ - QT_END_NAMESPACE_NFC + QT_END_NAMESPACE Q_NFC_EXPORT uint qHash(const QNdefRecord &key); -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNDEFRECORD_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefrecord_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qndefrecord_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qndefrecord_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qndefrecord_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,13 +48,16 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNdefRecordPrivate : public QSharedData { public: - //bool messageBegin : 1; - //bool messageEnd : 1; + QNdefRecordPrivate() : QSharedData() + { + typeNameFormat = 0; //TypeNameFormat::Empty + } + unsigned int typeNameFormat : 3; QByteArray type; @@ -62,6 +65,6 @@ QByteArray payload; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNDEFRECORD_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -53,7 +53,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNearFieldManager @@ -71,10 +71,7 @@ NFC Forum devices generally operate as the master in master/slave communications. Some devices are also capable of operating as the slave, so called Card Emulation mode. In this mode the - local NFC device emulates a NFC Forum Tag or Contactless Card and can be used to perform - transactions. The transaction happens entirely within a secure element on the device and only a - notification of the transaction is provided. The transactionDetected() signal is emitted - whenever a transaction occurs. + local NFC device emulates a NFC Forum Tag or Contactless Card. NFC Forum Tags can contain one or more messages in a standardized format. These messages are encapsulated by the QNdefMessage class. Use the registerNdefMessageHandler() functions to @@ -82,9 +79,9 @@ unregisterNdefMessageHandler() function. Applications can connect to the targetDetected() and targetLost() signals to get notified when - an NFC Forum Device or NFC Forum Tag enters or leaves proximity. Before these signals are - emitted target detection must be started with the startTargetDetection() function, which takes - a parameter to limit the type of device or tags detected. Target detection can be stopped with + an NFC Forum Tag enters or leaves proximity. Before these signals are + emitted target detection must be started with the startTargetDetection() function. + Target detection can be stopped with the stopTargetDetection() function. Before a detected target can be accessed it is necessary to request access rights. This must be done before the target device is touched. The setTargetAccessModes() function is used to set the types of access the application wants to @@ -111,6 +108,21 @@ manager->registerNdefMessageHandler(this, SLOT(handleNdefMessage(QNdefMessage,QNearFieldTarget))); \endcode + + On BlackBerry the registration for NDEF message handlers is done over the + \l{https://developer.blackberry.com/native/documentation/core/invocation_framework.html}{Invocation Framework}. + This means that the application has to set an invoke target in the bar descriptor xml file when using + \l registerNdefMessageHandler(). + + \code + + APPLICATION + + bb.action.OPEN + application/vnd.rim.nfc.ndef + + + \endcode */ /*! @@ -159,17 +171,6 @@ */ /*! - \fn void QNearFieldManager::transactionDetected(const QByteArray &applicationIdentifier) - - This signal is emitted when ever a transaction is performed with the application identified by - \a applicationIdentifier. - - The \a applicationIdentifier is a byte array of up to 16 bytes as defined by ISO 7816-4 and - uniquely identifies the application and application vendor that was involved in the - transaction. -*/ - -/*! Constructs a new near field manager with \a parent. */ QNearFieldManager::QNearFieldManager(QObject *parent) @@ -217,34 +218,17 @@ } /*! - Starts detecting targets of type \a targetTypes. Returns true if target detection is - successfully started; otherwise returns false. - - Causes the targetDetected() signal to be emitted when a target with a type in \a targetTypes is - within proximity. If \a targetTypes is empty targets of all types will be detected. + \fn bool QNearFieldManager::startTargetDetection() + Starts detecting targets and returns true if target detection is + successfully started; otherwise returns false. Causes the targetDetected() signal to be emitted + when a target is within proximity. \sa stopTargetDetection() */ -bool QNearFieldManager::startTargetDetection(const QList &targetTypes) +bool QNearFieldManager::startTargetDetection() { Q_D(QNearFieldManager); - - if (targetTypes.isEmpty()) - return d->startTargetDetection(QList() << QNearFieldTarget::AnyTarget); - else - return d->startTargetDetection(targetTypes); -} - -/*! - \overload - - Starts detecting targets of type \a targetType. Returns true if target detection is - successfully started; otherwise returns false. Causes the targetDetected() signal to be emitted - when a target with the type \a targetType is within proximity. -*/ -bool QNearFieldManager::startTargetDetection(QNearFieldTarget::Type targetType) -{ - return startTargetDetection(QList() << targetType); + return d->startTargetDetection(); } /*! @@ -411,4 +395,4 @@ return d->m_requestedModes; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_emulator.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_emulator.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_emulator.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_emulator.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -47,7 +47,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE QNearFieldManagerPrivateImpl::QNearFieldManagerPrivateImpl() { @@ -101,4 +101,4 @@ targetDeactivated(target); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_emulator_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_emulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_emulator_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_emulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -49,7 +49,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class TagBase; class QNearFieldManagerPrivateImpl : public QNearFieldManagerPrivateVirtualBase @@ -75,6 +75,6 @@ }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDMANAGER_EMULATOR_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNearFieldManagerPrivate; class Q_NFC_EXPORT QNearFieldManager : public QObject @@ -75,12 +75,9 @@ void setTargetAccessModes(TargetAccessModes accessModes); TargetAccessModes targetAccessModes() const; - bool startTargetDetection(const QList &targetTypes); - bool startTargetDetection(QNearFieldTarget::Type targetType = QNearFieldTarget::AnyTarget); + bool startTargetDetection(); void stopTargetDetection(); - template - int registerNdefMessageHandler(QObject *object, const char *method); int registerNdefMessageHandler(QObject *object, const char *method); int registerNdefMessageHandler(QNdefRecord::TypeNameFormat typeNameFormat, const QByteArray &type, @@ -93,23 +90,13 @@ Q_SIGNALS: void targetDetected(QNearFieldTarget *target); void targetLost(QNearFieldTarget *target); - void transactionDetected(const QByteArray &applicationIdentifier); private: QNearFieldManagerPrivate *d_ptr; }; -template -int QNearFieldManager::registerNdefMessageHandler(QObject *object, const char *method) -{ - T record; - - return registerNdefMessageHandler(record.userTypeNameFormat(), record.type(), - object, method); -} - Q_DECLARE_OPERATORS_FOR_FLAGS(QNearFieldManager::TargetAccessModes) -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDMANAGER_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanagerimpl_p.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanagerimpl_p.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanagerimpl_p.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanagerimpl_p.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,7 +43,7 @@ #include "qnearfieldmanagerimpl_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /* Constructs a new near field manager private implementation. @@ -59,4 +59,4 @@ { } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanagerimpl_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanagerimpl_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanagerimpl_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanagerimpl_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -44,7 +44,7 @@ #include "qnearfieldmanager_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNearFieldManagerPrivateImpl : public QNearFieldManagerPrivate { @@ -53,6 +53,6 @@ ~QNearFieldManagerPrivateImpl(); }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDMANAGERIMPL_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -50,7 +50,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNdefFilter; @@ -73,10 +73,8 @@ return false; } - virtual bool startTargetDetection(const QList &targetTypes) + virtual bool startTargetDetection() { - Q_UNUSED(targetTypes); - return false; } @@ -124,6 +122,6 @@ QNearFieldManager::TargetAccessModes m_requestedModes; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDMANAGER_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_qnx.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_qnx.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_qnx.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_qnx.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -46,7 +46,7 @@ #include "qndeffilter.h" #include "qndefrecord.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE QNearFieldManagerPrivateImpl::QNearFieldManagerPrivateImpl() : m_handlerID(0) @@ -70,10 +70,10 @@ return QNXNFCManager::instance()->isAvailable(); } -bool QNearFieldManagerPrivateImpl::startTargetDetection(const QList &targetTypes) +bool QNearFieldManagerPrivateImpl::startTargetDetection() { - qQNXNFCDebug() << "STarting targetdetection in nearfieldmanager"; - if (QNXNFCManager::instance()->startTargetDetection(targetTypes)) { + qQNXNFCDebug() << "Starting targetdetection in nearfieldmanager"; + if (QNXNFCManager::instance()->startTargetDetection()) { connect(QNXNFCManager::instance(), SIGNAL(targetDetected(QNearFieldTarget *, const QList&)), this, SLOT(newTarget(QNearFieldTarget *, const QList&))); return true; @@ -204,4 +204,4 @@ } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_qnx_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_qnx_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_qnx_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_qnx_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include "qnx/qnxnfcmanager_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNearFieldManagerPrivateImpl : public QNearFieldManagerPrivate { @@ -60,7 +60,7 @@ bool isAvailable() const; - bool startTargetDetection(const QList &targetTypes); + bool startTargetDetection(); void stopTargetDetection(); @@ -87,6 +87,6 @@ QList< QPair, QPair > > ndefFilterHandlers; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDMANAGER_QNX_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_simulator.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_simulator.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_simulator.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_simulator.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -50,7 +50,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE using namespace QtSimulatorPrivate; @@ -202,6 +202,6 @@ targetDeactivated(target); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #include "qnearfieldmanager_simulator.moc" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_simulator_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_simulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanager_simulator_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanager_simulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -46,7 +46,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE namespace Simulator { class NfcConnection; @@ -71,6 +71,6 @@ QMap > m_targets; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDMANAGER_SIMULATOR_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanagervirtualbase.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanagervirtualbase.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanagervirtualbase.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanagervirtualbase.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,13 +43,13 @@ #include "qndefmessage.h" #include "qtlv_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE -static inline bool matchesTarget(QNearFieldTarget::Type type, - const QList &types) -{ - return types.contains(type) || types.contains(QNearFieldTarget::AnyTarget); -} +//static inline bool matchesTarget(QNearFieldTarget::Type type, +// const QList &types) +//{ +// return types.contains(type) || types.contains(QNearFieldTarget::AnyTarget); +//} QNearFieldManagerPrivateVirtualBase::QNearFieldManagerPrivateVirtualBase() { @@ -59,15 +59,13 @@ { } -bool QNearFieldManagerPrivateVirtualBase::startTargetDetection(const QList &targetTypes) +bool QNearFieldManagerPrivateVirtualBase::startTargetDetection() { - m_detectTargetTypes = targetTypes; return true; } void QNearFieldManagerPrivateVirtualBase::stopTargetDetection() { - m_detectTargetTypes.clear(); } int QNearFieldManagerPrivateVirtualBase::getFreeId() @@ -125,8 +123,8 @@ void QNearFieldManagerPrivateVirtualBase::targetActivated(QNearFieldTarget *target) { - if (matchesTarget(target->type(), m_detectTargetTypes)) - emit targetDetected(target); + //if (matchesTarget(target->type(), m_detectTargetTypes)) + emit targetDetected(target); if (target->hasNdefMessage()) { QTlvReader reader(target); @@ -214,4 +212,4 @@ } } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanagervirtualbase_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanagervirtualbase_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldmanagervirtualbase_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldmanagervirtualbase_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -46,7 +46,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNearFieldManagerPrivateVirtualBase : public QNearFieldManagerPrivate { @@ -56,7 +56,7 @@ QNearFieldManagerPrivateVirtualBase(); ~QNearFieldManagerPrivateVirtualBase(); - bool startTargetDetection(const QList &targetTypes); + bool startTargetDetection(); void stopTargetDetection(); int registerNdefMessageHandler(QObject *object, const QMetaMethod &method); @@ -85,6 +85,6 @@ QList m_detectTargetTypes; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDMANAGERVIRTUALBASE_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype1.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype1.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype1.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype1.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -49,7 +49,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNearFieldTagType1 @@ -734,4 +734,4 @@ return handled; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype1_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype1_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype1_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype1_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -55,7 +55,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNearFieldTagType1Private; @@ -104,6 +104,6 @@ QNearFieldTagType1Private *d_ptr; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDTAGTYPE1_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype2.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype2.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype2.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype2.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNearFieldTagType2 @@ -117,7 +117,7 @@ */ bool QNearFieldTagType2::hasNdefMessage() { - qDebug() << Q_FUNC_INFO << "is unimplemeted"; + qWarning() << Q_FUNC_INFO << "is unimplemeted"; return false; } @@ -327,4 +327,4 @@ } } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype2_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype2_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype2_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype2_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -55,7 +55,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNearFieldTagType2Private; @@ -91,6 +91,6 @@ QNearFieldTagType2Private *d_ptr; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDTAGTYPE2_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype3.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype3.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype3.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype3.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -41,7 +41,7 @@ #include "qnearfieldtagtype3_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNearFieldTagType3 @@ -184,4 +184,4 @@ return QNearFieldTarget::handleResponse(id, response); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype3_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype3_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype3_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype3_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -57,7 +57,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class Q_AUTOTEST_EXPORT QNearFieldTagType3 : public QNearFieldTarget { @@ -83,6 +83,6 @@ bool handleResponse(const QNearFieldTarget::RequestId &id, const QByteArray &response); }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDTAGTYPE3_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype4.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype4.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype4.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype4.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -41,7 +41,7 @@ #include "qnearfieldtagtype4_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNearFieldTagType4 @@ -160,4 +160,4 @@ return QNearFieldTarget::handleResponse(id, response); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype4_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype4_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtagtype4_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtagtype4_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -55,7 +55,7 @@ // We mean it. // -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class Q_AUTOTEST_EXPORT QNearFieldTagType4 : public QNearFieldTarget { @@ -79,6 +79,6 @@ bool handleResponse(const QNearFieldTarget::RequestId &id, const QByteArray &response); }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDTAGTYPE4_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -52,7 +52,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE /*! \class QNearFieldTarget @@ -88,15 +88,12 @@ This enum describes the type of tag the target is detected as. - \value AnyTarget This value is only used when registering handlers to indicate that any - compatible target can be used. \value ProprietaryTag An unidentified proprietary target tag. \value NfcTagType1 An NFC tag type 1 target. \value NfcTagType2 An NFC tag type 2 target. \value NfcTagType3 An NFC tag type 3 target. \value NfcTagType4 An NFC tag type 4 target. \value MifareTag A Mifare target. - \value NfcForumDevice An NFC Forum device target. */ /*! @@ -129,14 +126,33 @@ \value NdefWriteError Failed to write NDEF messages to the target. */ -/*! - \fn qNfcChecksum(const char *data, uint len) +// Copied from qbytearray.cpp +// Modified to initialize the crc with 0x6363 instead of 0xffff and to not invert the final result. +static const quint16 crc_tbl[16] = { + 0x0000, 0x1081, 0x2102, 0x3183, + 0x4204, 0x5285, 0x6306, 0x7387, + 0x8408, 0x9489, 0xa50a, 0xb58b, + 0xc60c, 0xd68d, 0xe70e, 0xf78f +}; +/*! \relates QNearFieldTarget Returns the NFC checksum of the first \a len bytes of \a data. */ -#include "checksum_p.h" +quint16 qNfcChecksum(const char *data, uint len) +{ + register quint16 crc = 0x6363; + uchar c; + const uchar *p = reinterpret_cast(data); + while (len--) { + c = *p++; + crc = ((crc >> 4) & 0x0fff) ^ crc_tbl[((crc ^ c) & 15)]; + c >>= 4; + crc = ((crc >> 4) & 0x0fff) ^ crc_tbl[((crc ^ c) & 15)]; + } + return crc; +} /*! \fn void QNearFieldTarget::disconnected() @@ -469,4 +485,4 @@ return true; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget_emulator.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget_emulator.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget_emulator.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget_emulator.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE static QMutex tagMutex; static QMap tagMap; @@ -300,4 +300,4 @@ tagMutex.unlock(); } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget_emulator_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget_emulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget_emulator_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget_emulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class TagType1 : public QNearFieldTagType1 { @@ -113,6 +113,6 @@ int timerId; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDTARGET_EMULATOR_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget.h 2014-02-01 20:38:03.000000000 +0000 @@ -53,7 +53,7 @@ class QUrl; QT_END_NAMESPACE -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNdefMessage; class QNearFieldTargetPrivate; @@ -66,14 +66,12 @@ public: enum Type { - AnyTarget, ProprietaryTag, NfcTagType1, NfcTagType2, NfcTagType3, NfcTagType4, MifareTag, - NfcForumDevice }; enum AccessMethod { @@ -165,9 +163,9 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QNearFieldTarget::AccessMethods) -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE -Q_DECLARE_METATYPE(QtNfc::QNearFieldTarget::RequestId) -Q_DECLARE_METATYPE(QtNfc::QNearFieldTarget::Error) +Q_DECLARE_METATYPE(QNearFieldTarget::RequestId) +Q_DECLARE_METATYPE(QNearFieldTarget::Error) #endif // QNEARFIELDTARGET_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -49,7 +49,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNearFieldTarget::RequestIdPrivate : public QSharedData { @@ -61,6 +61,6 @@ QMap m_decodedResponses; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDTARGET_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget_qnx_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget_qnx_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnearfieldtarget_qnx_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnearfieldtarget_qnx_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -51,7 +51,7 @@ #include "qnx/qnxnfcmanager_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE #define TAG_NAME_BUFFER 64 @@ -219,6 +219,6 @@ QList m_ndefMessages; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNEARFIELDTARGET_QNX_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnfcglobal.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnfcglobal.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnfcglobal.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnfcglobal.h 2014-02-01 20:38:03.000000000 +0000 @@ -44,17 +44,7 @@ #include -#if defined(QT_NAMESPACE) -# define QT_PREPEND_NAMESPACE_NFC(name) ::QT_NAMESPACE::QtNfc::name -# define QT_BEGIN_NAMESPACE_NFC namespace QT_NAMESPACE { namespace QtNfc { -# define QT_END_NAMESPACE_NFC } } -# define QT_USE_NAMESPACE_NFC using namespace QT_NAMESPACE; using namespace QtNfc; -#else -# define QT_PREPEND_NAMESPACE_NFC(name) ::QtNfc::name -# define QT_BEGIN_NAMESPACE_NFC namespace QtNfc { -# define QT_END_NAMESPACE_NFC } -# define QT_USE_NAMESPACE_NFC using namespace QtNfc; -#endif +QT_BEGIN_NAMESPACE #ifndef QT_STATIC # if defined(QT_BUILD_NFC_LIB) @@ -66,4 +56,6 @@ # define Q_NFC_EXPORT #endif +QT_END_NAMESPACE + #endif // QTNFC_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnx/qnxnfceventfilter.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnx/qnxnfceventfilter.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnx/qnxnfceventfilter.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnx/qnxnfceventfilter.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -44,7 +44,7 @@ #include "nfc/nfc.h" #include "qnxnfcmanager_p.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE QNXNFCEventFilter::QNXNFCEventFilter() { @@ -100,4 +100,4 @@ return false; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnx/qnxnfceventfilter_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnx/qnxnfceventfilter_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnx/qnxnfceventfilter_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnx/qnxnfceventfilter_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -51,7 +51,7 @@ #include "../qnfcglobal.h" #include "../qndefmessage.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNXNFCEventFilter : public QObject, public QAbstractNativeEventFilter { @@ -70,6 +70,6 @@ void ndefEvent(const QNdefMessage &msg); }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QNXNFCEVENTFILTER_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnx/qnxnfcmanager.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qnx/qnxnfcmanager.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnx/qnxnfcmanager.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnx/qnxnfcmanager.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,8 +43,9 @@ #include #include #include "../qllcpsocket_qnx_p.h" +#include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE QNXNFCManager *QNXNFCManager::m_instance = 0; @@ -360,10 +361,14 @@ QByteArray filter = "actions=bb.action.OPEN;types=application/vnd.rim.nfc.ndef;" + uriFilter; filters[0] = filter.constData(); - if (BPS_SUCCESS != navigator_invoke_set_filters("20", "org.qtm.NFCTest", filters, 1)) { + //Get the correct target-id + QString targetId = QCoreApplication::instance()->arguments().first(); + targetId = targetId.left(targetId.lastIndexOf(QLatin1Char('.'))); + + if (BPS_SUCCESS != navigator_invoke_set_filters("20", targetId.toLatin1().constData(), filters, 1)) { qWarning() << "NFC Error setting share target filter"; } else { - qQNXNFCDebug() << "NFC share target filter set" << filters[0]; + qQNXNFCDebug() << "NFC share target filter set" << filters[0] << " Target:" << targetId; } } @@ -386,9 +391,8 @@ } } -bool QNXNFCManager::startTargetDetection(const QList &targetTypes) +bool QNXNFCManager::startTargetDetection() { - Q_UNUSED(targetTypes) qQNXNFCDebug() << "Start target detection for all types"; //TODO handle the target types if (nfc_register_tag_readerwriter(TAG_TYPE_ALL) == NFC_RESULT_SUCCESS) { @@ -484,4 +488,4 @@ return newNdefMessage; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnx/qnxnfcmanager_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qnx/qnxnfcmanager_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qnx/qnxnfcmanager_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qnx/qnxnfcmanager_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -59,7 +59,7 @@ #define qQNXNFCDebug QT_NO_QDEBUG_MACRO #endif -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QLlcpSocketPrivate; @@ -120,7 +120,7 @@ public: //TODO add a parameter to only detect a special target for now we are detecting all target types - bool startTargetDetection(const QList &targetTypes); + bool startTargetDetection(); void updateNdefFilters(QList,QObject *); @@ -134,7 +134,7 @@ void llcpDisconnected(); }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qqmlndefrecord.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qqmlndefrecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qqmlndefrecord.cpp 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qqmlndefrecord.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,346 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtNfc 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 "qqmlndefrecord.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +/*! + \class QQmlNdefRecord + \brief The QQmlNdefRecord class implements the NdefRecord type in QML. + + \ingroup connectivity-nfc + \inmodule QtNfc + + \sa NdefRecord + + The QQmlNdefRecord class is the base class for all NdefRecord types in QML. To + support a new NDEF record type in QML subclass this class and expose new properties, member + functions and signals appropriate for the new record type. The following must be done to + create a new NDEF record type in QML: + + \list + \li The subclass must have a Q_OBJECT macro in its declaration. + \li The subclass must have an \l {Q_INVOKABLE}{invokable} constructor that takes a + QNdefRecord and a QObject pointer. + \li The subclass must be declared as an NDEF record by expanding the Q_DECLARE_NDEFRECORD() + macro in the implementation file of the subclass. + \li The subclass must be registered with QML. + \endlist + + For example the declaration of such a class may look like the following. + + \snippet foorecord.h Foo declaration + + Within the implementation file the Q_DECLARE_NDEFRECORD() macro is expanded: + + \snippet foorecord.cpp Declare foo record + + Finially the application or plugin code calls qmlRegisterType(): + + \code + qmlRegisterType(uri, 1, 0, "NdefFooRecord"); + \endcode +*/ + +/*! + \qmltype NdefRecord + \instantiates QQmlNdefRecord + \brief The NdefRecord type represents a record in an NDEF message. + + \ingroup nfc-qml + \inqmlmodule QtNfc + + \sa NdefFilter + \sa NearField + + \sa QNdefRecord + + The NdefRecord type is the base type for all NDEF record types in QML. It contains + a single property holding the type of record. + + This class is not intended to be used directly, but extended from C++. + + \sa QQmlNdefRecord +*/ + +/*! + \qmlproperty string NdefRecord::type + + This property holds the type of the NDEF record. +*/ + +/*! + \qmlproperty enumeration NdefRecord::typeNameFormat + + This property holds the TNF of the NDEF record. + + \table + \header \li Property \li Description + \row \li \c NdefRecord.Empty + \li An empty NDEF record, the record does not contain a payload. + \row \li \c NdefRecord.NfcRtd + \li The NDEF record type is defined by an NFC RTD Specification. + \row \li \c NdefRecord.Mime + \li The NDEF record type follows the construct described in RFC 2046. + \row \li \c NdefRecord.Uri + \li The NDEF record type follows the construct described in RFC 3986. + \row \li \c NdefRecord.ExternalRtd + \li The NDEF record type follows the construct for external type names + described the NFC RTD Specification. + \endtable + + \sa QNdefRecord::typeNameFormat() +*/ + +/*! + \qmlproperty string NdefRecord::record + + This property holds the NDEF record. +*/ + +/*! + \fn void QQmlNdefRecord::typeChanged() + + This signal is emitted when the record type changes. +*/ + +/*! + \property QQmlNdefRecord::record + + This property hold the NDEF record that this class represents. +*/ + +/*! + \property QQmlNdefRecord::type + + This property hold the type of the NDEF record. +*/ + +/*! + \property QQmlNdefRecord::typeNameFormat + + This property hold the TNF of the NDEF record. +*/ + +/*! + \macro Q_DECLARE_NDEFRECORD(className, typeNameFormat, type) + \relates QQmlNdefRecord + + This macro ensures that \a className is declared as the class implementing the NDEF record + identified by \a typeNameFormat and \a type. + + This macro should be expanded in the implementation file for \a className. +*/ + +static QMap registeredNdefRecordTypes; + +class QQmlNdefRecordPrivate +{ +public: + QNdefRecord record; +}; + +static QString urnForRecordType(QNdefRecord::TypeNameFormat typeNameFormat, const QByteArray &type) +{ + switch (typeNameFormat) { + case QNdefRecord::NfcRtd: + return QLatin1String("urn:nfc:wkt:") + QString::fromLatin1(type); + case QNdefRecord::ExternalRtd: + return QLatin1String("urn:nfc:ext:") + QString::fromLatin1(type); + case QNdefRecord::Mime: + return QLatin1String("urn:nfc:mime:") + QString::fromLatin1(type); + default: + return QString(); + } +} + +/*! + \internal +*/ +void qRegisterNdefRecordTypeHelper(const QMetaObject *metaObject, + QNdefRecord::TypeNameFormat typeNameFormat, + const QByteArray &type) +{ + registeredNdefRecordTypes.insert(urnForRecordType(typeNameFormat, type), metaObject); +} + +/*! + \internal +*/ +QQmlNdefRecord *qNewDeclarativeNdefRecordForNdefRecord(const QNdefRecord &record) +{ + const QString urn = urnForRecordType(record.typeNameFormat(), record.type()); + + QMapIterator i(registeredNdefRecordTypes); + while (i.hasNext()) { + i.next(); + + QRegExp ex(i.key()); + if (!ex.exactMatch(urn)) + continue; + + const QMetaObject *metaObject = i.value(); + if (!metaObject) + continue; + + return static_cast(metaObject->newInstance( + Q_ARG(QNdefRecord, record), Q_ARG(QObject *, 0))); + } + + return new QQmlNdefRecord(record); +} + +/*! + Constructs a new empty QQmlNdefRecord with \a parent. +*/ +QQmlNdefRecord::QQmlNdefRecord(QObject *parent) +: QObject(parent), d_ptr(new QQmlNdefRecordPrivate) +{ +} + +/*! + Constructs a new QQmlNdefRecord representing \a record. The parent of the newly + constructed object will be set to \a parent. +*/ +QQmlNdefRecord::QQmlNdefRecord(const QNdefRecord &record, QObject *parent) +: QObject(parent), d_ptr(new QQmlNdefRecordPrivate) +{ + d_ptr->record = record; +} + +/*! + \enum QQmlNdefRecord::TypeNameFormat + + This enum describes the type name format of an NDEF record. The values of this enum are according to + \l QNdefRecord::TypeNameFormat + + \value Empty An empty NDEF record, the record does not contain a payload. + \value NfcRtd The NDEF record type is defined by an NFC RTD Specification. + \value Mime The NDEF record type follows the construct described in RFC 2046. + \value Uri The NDEF record type follows the construct described in RFC 3986. + \value ExternalRtd The NDEF record type follows the construct for external type names + described the NFC RTD Specification. +*/ + +/*! + Returns the type of the record. + + \sa QNdefRecord::setType(), QNdefRecord::type() +*/ +QString QQmlNdefRecord::type() const +{ + Q_D(const QQmlNdefRecord); + + return QLatin1String(d->record.type()); +} + +/*! + Sets the record type to \a type if it is not currently equal to \a type; otherwise does + nothing. If the record type is set the typeChanged() signal will be emitted. + + \sa QNdefRecord::setType(), QNdefRecord::type() +*/ +void QQmlNdefRecord::setType(const QString &newtype) +{ + if (newtype == type()) + return; + + Q_D(QQmlNdefRecord); + d->record.setType(newtype.toUtf8()); + + emit typeChanged(); +} + +/*! + Sets the type name format of the NDEF record to \a newTypeNameFormat. +*/ +void QQmlNdefRecord::setTypeNameFormat(QQmlNdefRecord::TypeNameFormat newTypeNameFormat) +{ + if (newTypeNameFormat == typeNameFormat()) + return; + + Q_D(QQmlNdefRecord); + d->record.setTypeNameFormat(static_cast(newTypeNameFormat)); + + emit typeNameFormatChanged(); +} + +/*! + \fn QQmlNdefRecord::TypeNameFormat QQmlNdefRecord::typeNameFormat() const + + Returns the type name format of the NDEF record. +*/ +QQmlNdefRecord::TypeNameFormat QQmlNdefRecord::typeNameFormat() const +{ + Q_D(const QQmlNdefRecord); + return static_cast(d->record.typeNameFormat()); +} + +/*! + Returns a copy of the record. +*/ +QNdefRecord QQmlNdefRecord::record() const +{ + Q_D(const QQmlNdefRecord); + + return d->record; +} + +/*! + Sets the record to \a record. If the record is set the recordChanged() signal will + be emitted. +*/ +void QQmlNdefRecord::setRecord(const QNdefRecord &record) +{ + Q_D(QQmlNdefRecord); + + if (d->record == record) + return; + + d->record = record; + emit recordChanged(); +} + +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qqmlndefrecord.h qtconnectivity-opensource-src-5.2.1/src/nfc/qqmlndefrecord.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qqmlndefrecord.h 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qqmlndefrecord.h 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtNfc 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 QQMLNDEFRECORD_H +#define QQMLNDEFRECORD_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QQmlNdefRecordPrivate; + +class Q_NFC_EXPORT QQmlNdefRecord : public QObject +{ + Q_OBJECT + + Q_DECLARE_PRIVATE(QQmlNdefRecord) + + Q_PROPERTY(QString type READ type WRITE setType NOTIFY typeChanged) + Q_PROPERTY(TypeNameFormat typeNameFormat READ typeNameFormat WRITE setTypeNameFormat NOTIFY typeNameFormatChanged) + Q_PROPERTY(QNdefRecord record READ record WRITE setRecord NOTIFY recordChanged) + + Q_ENUMS(TypeNameFormat) +public: + enum TypeNameFormat { + Empty = QNdefRecord::Empty, + NfcRtd = QNdefRecord::NfcRtd, + Mime = QNdefRecord::Mime, + Uri = QNdefRecord::Uri, + ExternalRtd = QNdefRecord::ExternalRtd, + Unknown = QNdefRecord::Unknown + }; + + explicit QQmlNdefRecord(QObject *parent = 0); + explicit QQmlNdefRecord(const QNdefRecord &record, QObject *parent = 0); + + QString type() const; + void setType(const QString &t); + + void setTypeNameFormat(TypeNameFormat typeNameFormat); + TypeNameFormat typeNameFormat() const; + + QNdefRecord record() const; + void setRecord(const QNdefRecord &record); + +Q_SIGNALS: + void typeChanged(); + void typeNameFormatChanged(); + void recordChanged(); + +private: + QQmlNdefRecordPrivate *d_ptr; +}; + +void Q_NFC_EXPORT qRegisterNdefRecordTypeHelper(const QMetaObject *metaObject, + QNdefRecord::TypeNameFormat typeNameFormat, + const QByteArray &type); + +Q_NFC_EXPORT QQmlNdefRecord *qNewDeclarativeNdefRecordForNdefRecord(const QNdefRecord &record); + +template +bool qRegisterNdefRecordType(QNdefRecord::TypeNameFormat typeNameFormat, const QByteArray &type) +{ + qRegisterNdefRecordTypeHelper(&T::staticMetaObject, typeNameFormat, type); + return true; +} + +#define Q_DECLARE_NDEFRECORD(className, typeNameFormat, type) \ +static bool _q_##className##_registered = qRegisterNdefRecordType(typeNameFormat, type); + +QT_END_NAMESPACE + +#endif // QQMLNDEFRECORD_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qtlv.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/qtlv.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qtlv.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qtlv.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -47,7 +47,7 @@ #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE QPair qParseReservedMemoryControlTlv(const QByteArray &tlvData) { @@ -529,4 +529,4 @@ return length; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qtlv_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/qtlv_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/qtlv_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/qtlv_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -50,7 +50,7 @@ #include #include -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class QNearFieldTarget; class Q_AUTOTEST_EXPORT QTlvReader @@ -119,6 +119,6 @@ QPair qParseReservedMemoryControlTlv(const QByteArray &tlvData); QPair qParseLockControlTlv(const QByteArray &tlvData); -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // QTLV_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/targetemulator.cpp qtconnectivity-opensource-src-5.2.1/src/nfc/targetemulator.cpp --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/targetemulator.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/targetemulator.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -47,9 +47,9 @@ #include // Implementation of qNfcChecksum -#include "checksum_p.h" +#include "qnearfieldtarget.h" -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE TagBase::TagBase() : lastAccess(0) @@ -391,4 +391,4 @@ return response; } -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/nfc/targetemulator_p.h qtconnectivity-opensource-src-5.2.1/src/nfc/targetemulator_p.h --- qtconnectivity-opensource-src-5.0~git20130802/src/nfc/targetemulator_p.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/nfc/targetemulator_p.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ QT_FORWARD_DECLARE_CLASS(QSettings) -QT_BEGIN_NAMESPACE_NFC +QT_BEGIN_NAMESPACE class TagBase { @@ -107,6 +107,6 @@ bool expectPacket2; }; -QT_END_NAMESPACE_NFC +QT_END_NAMESPACE #endif // TARGETEMULATOR_P_H diff -Nru qtconnectivity-opensource-src-5.0~git20130802/src/src.pro qtconnectivity-opensource-src-5.2.1/src/src.pro --- qtconnectivity-opensource-src-5.0~git20130802/src/src.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/src/src.pro 2014-02-01 20:38:03.000000000 +0000 @@ -1,4 +1,5 @@ TEMPLATE = subdirs CONFIG += ordered -SUBDIRS += bluetooth nfc imports +SUBDIRS += bluetooth nfc +qtHaveModule(quick): SUBDIRS += imports diff -Nru qtconnectivity-opensource-src-5.0~git20130802/sync.profile qtconnectivity-opensource-src-5.2.1/sync.profile --- qtconnectivity-opensource-src-5.0~git20130802/sync.profile 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/sync.profile 2014-02-01 20:38:03.000000000 +0000 @@ -14,7 +14,5 @@ %dependencies = ( "qtbase" => "", "qtdeclarative" => "", - "qtjsbackend" => "", - "qtsystems" => "", "qtxmlpatterns" => "", ); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/.tag qtconnectivity-opensource-src-5.2.1/.tag --- qtconnectivity-opensource-src-5.0~git20130802/.tag 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/.tag 2014-02-01 20:38:03.000000000 +0000 @@ -1 +1 @@ -288e64d30585a5da2dafc00d39c803a8c5c541cb +44fd56d22ebc8e49f675e3a05721b04653830775 diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/auto.pro qtconnectivity-opensource-src-5.2.1/tests/auto/auto.pro --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/auto.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/auto.pro 2014-02-01 20:38:03.000000000 +0000 @@ -26,7 +26,6 @@ qndefrecord \ qnearfieldmanager \ qnearfieldtagtype1 \ - qnearfieldtagtype2 + qnearfieldtagtype2 \ + qndefnfcsmartposterrecord } - -qbluetoothservicediscoveryagent.CONFIG += no_check_target # QTBUG-22017 diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/cmake/CMakeLists.txt qtconnectivity-opensource-src-5.2.1/tests/auto/cmake/CMakeLists.txt --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/cmake/CMakeLists.txt 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/cmake/CMakeLists.txt 2014-02-01 20:38:03.000000000 +0000 @@ -9,4 +9,11 @@ include("${_Qt5CTestMacros}") -expect_pass(test_modules) +set(qt_module_includes + Bluetooth QBluetoothAddress + Nfc QNdefRecord +) + +test_module_includes( + ${qt_module_includes} +) diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/cmake/cmake.pro qtconnectivity-opensource-src-5.2.1/tests/auto/cmake/cmake.pro --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/cmake/cmake.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/cmake/cmake.pro 2014-02-01 20:38:03.000000000 +0000 @@ -2,4 +2,6 @@ # Cause make to do nothing. TEMPLATE = subdirs +CMAKE_QT_MODULES_UNDER_TEST = bluetooth nfc + CONFIG += ctest_testcase diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/cmake/test_modules/CMakeLists.txt qtconnectivity-opensource-src-5.2.1/tests/auto/cmake/test_modules/CMakeLists.txt --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/cmake/test_modules/CMakeLists.txt 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/cmake/test_modules/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ - -cmake_minimum_required(VERSION 2.8) - -project(test_modules) - -find_package(Qt5Core REQUIRED) - -find_package(Qt5Bluetooth REQUIRED) - -include_directories( - ${Qt5Bluetooth_INCLUDE_DIRS} -) - -add_definitions( - ${Qt5Bluetooth_DEFINITIONS} -) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") - -add_executable(mainapp main.cpp) -target_link_libraries(mainapp - ${Qt5Bluetooth_LIBRARIES} -) diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/cmake/test_modules/main.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/cmake/test_modules/main.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/cmake/test_modules/main.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/cmake/test_modules/main.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly -** Contact: http://www.qt-project.org/legal -** -** This file is part of the test suite 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 - -int main(int argc, char **argv) -{ - QtBluetooth::QBluetoothAddress bluetoothAddress; - - return 0; -} diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothaddress/tst_qbluetoothaddress.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothaddress/tst_qbluetoothaddress.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothaddress/tst_qbluetoothaddress.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothaddress/tst_qbluetoothaddress.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -45,7 +45,7 @@ #include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE class tst_QBluetoothAddress : public QObject { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothdevicediscoveryagent/qbluetoothdevicediscoveryagent.pro qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothdevicediscoveryagent/qbluetoothdevicediscoveryagent.pro --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothdevicediscoveryagent/qbluetoothdevicediscoveryagent.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothdevicediscoveryagent/qbluetoothdevicediscoveryagent.pro 2014-02-01 20:38:03.000000000 +0000 @@ -4,5 +4,4 @@ QT = core concurrent bluetooth testlib -CONFIG += insignificant_test # QTBUG-22017 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,12 +43,13 @@ #include #include +#include #include #include #include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QBluetoothDeviceInfo) Q_DECLARE_METATYPE(QBluetoothDeviceDiscoveryAgent::InquiryType) @@ -303,7 +304,21 @@ { QFETCH(QBluetoothDeviceDiscoveryAgent::InquiryType, inquiryType); - QBluetoothDeviceDiscoveryAgent discoveryAgent; + //Run test in case of multiple Bluetooth adapters + QBluetoothLocalDevice localDevice; + //We will use default adapter if there is no other adapter + QBluetoothAddress address = localDevice.address(); + int numberOfAdapters = (localDevice.allDevices()).size(); + QList addresses; + if (numberOfAdapters > 1) { + + for (int i=0; i < numberOfAdapters; i++) { + addresses.append(((QBluetoothHostInfo)localDevice.allDevices().at(i)).address()); + } + address = (QBluetoothAddress)addresses.at(0); + } + + QBluetoothDeviceDiscoveryAgent discoveryAgent(address); QVERIFY(discoveryAgent.error() == discoveryAgent.NoError); QVERIFY(discoveryAgent.errorString().isEmpty()); QVERIFY(!discoveryAgent.isActive()); @@ -361,7 +376,7 @@ if (!remoteDevice.isNull()) QVERIFY(discoveredSpy.count() > 0); - + int counter = 0; // All returned QBluetoothDeviceInfo should be valid. while (!discoveredSpy.isEmpty()) { const QBluetoothDeviceInfo info = @@ -369,7 +384,16 @@ QVERIFY(info.isValid()); qDebug() << "Discovered device:" << info.address().toString() << info.name(); + if (numberOfAdapters > 1) { + for (int i= 1; i < numberOfAdapters; i++) { + if (info.address().toString() == addresses[i].toString()) + counter++; + } + } } + //For multiple Bluetooth adapter do the check only for GeneralUnlimitedInquiry + if (!(inquiryType == QBluetoothDeviceDiscoveryAgent::LimitedInquiry)) + QVERIFY((numberOfAdapters-1) == counter); } } diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothdeviceinfo/tst_qbluetoothdeviceinfo.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothdeviceinfo/tst_qbluetoothdeviceinfo.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothdeviceinfo/tst_qbluetoothdeviceinfo.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothdeviceinfo/tst_qbluetoothdeviceinfo.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include #include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QBluetoothDeviceInfo::ServiceClasses) Q_DECLARE_METATYPE(QBluetoothDeviceInfo::MajorDeviceClass) @@ -73,8 +73,6 @@ void tst_serviceUuids(); void tst_cached(); - - void tst_manufacturerSpecificData(); }; tst_QBluetoothDeviceInfo::tst_QBluetoothDeviceInfo() @@ -375,16 +373,6 @@ QVERIFY(!(deviceInfo.isCached())); } -void tst_QBluetoothDeviceInfo::tst_manufacturerSpecificData() -{ - QBluetoothDeviceInfo deviceInfo; - QByteArray data; - bool available; - data = deviceInfo.manufacturerSpecificData(&available); - // Current API implementation returns only empty QByteArray() - QCOMPARE(data, QByteArray()); -} - QTEST_MAIN(tst_QBluetoothDeviceInfo) #include "tst_qbluetoothdeviceinfo.moc" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothhostinfo/tst_qbluetoothhostinfo.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothhostinfo/tst_qbluetoothhostinfo.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothhostinfo/tst_qbluetoothhostinfo.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothhostinfo/tst_qbluetoothhostinfo.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -46,7 +46,7 @@ #include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE class tst_QBluetoothHostInfo : public QObject { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothlocaldevice/tst_qbluetoothlocaldevice.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothlocaldevice/tst_qbluetoothlocaldevice.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothlocaldevice/tst_qbluetoothlocaldevice.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothlocaldevice/tst_qbluetoothlocaldevice.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -47,7 +47,7 @@ #include #include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE /* * Running the manual tests requires another Bluetooth device in the vincinity. diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro 2014-02-01 20:38:03.000000000 +0000 @@ -4,5 +4,4 @@ QT = core concurrent bluetooth testlib -CONFIG += insignificant_test # QTBUG-22017 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,14 +43,16 @@ #include #include -#include +#include #include #include #include #include +#include +#include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QBluetoothDeviceInfo) Q_DECLARE_METATYPE(QBluetoothServiceDiscoveryAgent::Error) @@ -76,19 +78,25 @@ void tst_serviceDiscovery_data(); void tst_serviceDiscovery(); + void tst_serviceDiscoveryAdapters(); private: QList devices; + bool localDeviceAvailable; }; tst_QBluetoothServiceDiscoveryAgent::tst_QBluetoothServiceDiscoveryAgent() { // start Bluetooth if not started QBluetoothLocalDevice *device = new QBluetoothLocalDevice(); - device->powerOn(); + localDeviceAvailable = device->isValid(); + if (localDeviceAvailable) { + device->powerOn(); + // wait for the device to switch bluetooth mode. + QTest::qWait(1000); + } delete device; - // wait for the device to switch bluetooth mode. - QTest::qWait(1000); + qRegisterMetaType("QBluetoothDeviceInfo"); qRegisterMetaType("QBluetoothServiceInfo"); qRegisterMetaType >("QList"); @@ -114,33 +122,31 @@ void tst_QBluetoothServiceDiscoveryAgent::initTestCase() { -#if 1 - QBluetoothDeviceDiscoveryAgent discoveryAgent; + if (localDeviceAvailable) { + QBluetoothDeviceDiscoveryAgent discoveryAgent; - QSignalSpy finishedSpy(&discoveryAgent, SIGNAL(finished())); - QSignalSpy errorSpy(&discoveryAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error))); - QSignalSpy discoveredSpy(&discoveryAgent, SIGNAL(deviceDiscovered(const QBluetoothDeviceInfo&))); -// connect(&discoveryAgent, SIGNAL(deviceDiscovered(const QBluetoothDeviceInfo&)), -// this, SLOT(deviceDiscoveryDebug(const QBluetoothDeviceInfo&))); + QSignalSpy finishedSpy(&discoveryAgent, SIGNAL(finished())); + QSignalSpy errorSpy(&discoveryAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error))); + QSignalSpy discoveredSpy(&discoveryAgent, SIGNAL(deviceDiscovered(const QBluetoothDeviceInfo&))); + // connect(&discoveryAgent, SIGNAL(deviceDiscovered(const QBluetoothDeviceInfo&)), + // this, SLOT(deviceDiscoveryDebug(const QBluetoothDeviceInfo&))); + + discoveryAgent.start(); + + // Wait for up to MaxScanTime for the scan to finish + int scanTime = MaxScanTime; + while (finishedSpy.count() == 0 && scanTime > 0) { + QTest::qWait(1000); + scanTime -= 1000; + } + // qDebug() << "Scan time left:" << scanTime; - discoveryAgent.start(); + // Expect finished signal with no error + QVERIFY(finishedSpy.count() == 1); + QVERIFY(errorSpy.isEmpty()); - // Wait for up to MaxScanTime for the scan to finish - int scanTime = MaxScanTime; - while (finishedSpy.count() == 0 && scanTime > 0) { - QTest::qWait(1000); - scanTime -= 1000; + devices = discoveryAgent.discoveredDevices(); } -// qDebug() << "Scan time left:" << scanTime; - - // Expect finished signal with no error - QVERIFY(finishedSpy.count() == 1); - QVERIFY(errorSpy.isEmpty()); - - devices = discoveryAgent.discoveredDevices(); -#else - devices.append(QBluetoothDeviceInfo(QBluetoothAddress(Q_UINT64_C(0x001e3a81ba69)), "Yuna", 0)); -#endif } void tst_QBluetoothServiceDiscoveryAgent::serviceDiscoveryDebug(const QBluetoothServiceInfo &info) @@ -247,6 +253,84 @@ << QBluetoothServiceDiscoveryAgent::NoError; } +void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscoveryAdapters() +{ + QBluetoothLocalDevice localDevice; + int numberOfAdapters = (localDevice.allDevices()).size(); + if (numberOfAdapters>1) { + if (devices.isEmpty()) + QSKIP("This test requires an in-range bluetooth device"); + + QList addresses; + + for (int i=0; i 0) { + QTest::qWait(1000); + scanTime -= 1000; + } + + QList discServices = discoveryAgent.discoveredServices(); + QVERIFY(!discServices.empty()); + + int counter = 0; + for (int i = 0; i, uuidFilter); QFETCH(QBluetoothServiceDiscoveryAgent::Error, serviceDiscoveryError); - qDebug() << "Doing address" << deviceInfo.address().toString(); - QBluetoothServiceDiscoveryAgent discoveryAgent(deviceInfo.address()); + QBluetoothLocalDevice localDevice; + + qDebug() << "Scanning address" << deviceInfo.address().toString(); + QBluetoothServiceDiscoveryAgent discoveryAgent(localDevice.address()); + bool setAddress = discoveryAgent.setRemoteAddress(deviceInfo.address()); + + QVERIFY(setAddress); QVERIFY(!discoveryAgent.isActive()); @@ -313,15 +402,16 @@ // All returned QBluetoothServiceInfo should be valid. while (!discoveredSpy.isEmpty()) { const QVariant v = discoveredSpy.takeFirst().at(0); - // Work around limitation in QMetaType and moc. // QBluetoothServiceInfo is registered with metatype as QBluetoothServiceInfo // moc sees it as the unqualified QBluetoothServiceInfo. - if (qstrcmp(v.typeName(), "QBluetoothServiceInfo") == 0) { + if (v.userType() == qMetaTypeId()) + { const QBluetoothServiceInfo info = *reinterpret_cast(v.constData()); QVERIFY(info.isValid()); + QVERIFY(!info.isRegistered()); #if 0 qDebug() << info.device().name() << info.device().address().toString(); @@ -332,7 +422,10 @@ qDebug() << "\tRFCOMM server channel:" << info.serverChannel(); //dumpServiceInfoAttributes(info); #endif + } else { + QFAIL("Unknown type returned by service discovery"); } + } QVERIFY(discoveryAgent.discoveredServices().count() != 0); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothserviceinfo/tst_qbluetoothserviceinfo.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothserviceinfo/tst_qbluetoothserviceinfo.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothserviceinfo/tst_qbluetoothserviceinfo.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothserviceinfo/tst_qbluetoothserviceinfo.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -50,7 +50,7 @@ #include #include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QBluetoothUuid::ProtocolUuid) Q_DECLARE_METATYPE(QUuid) @@ -95,13 +95,55 @@ void tst_QBluetoothServiceInfo::tst_construction() { const QString serviceName("My Service"); + const QString alternateServiceName("Another ServiceName"); const QBluetoothDeviceInfo deviceInfo(QBluetoothAddress("001122334455"), "Test Device", 0); + const QBluetoothDeviceInfo alternatedeviceInfo(QBluetoothAddress("554433221100"), "Test Device2", 0); + + QList protUuids; + //list taken from qbluetoothuuid.h + protUuids << QBluetoothUuid::Sdp; + protUuids << QBluetoothUuid::Udp; + protUuids << QBluetoothUuid::Rfcomm; + protUuids << QBluetoothUuid::Tcp; + protUuids << QBluetoothUuid::TcsBin; + protUuids << QBluetoothUuid::TcsAt; + protUuids << QBluetoothUuid::Att; + protUuids << QBluetoothUuid::Obex; + protUuids << QBluetoothUuid::Ip; + protUuids << QBluetoothUuid::Ftp; + protUuids << QBluetoothUuid::Http; + protUuids << QBluetoothUuid::Wsp; + protUuids << QBluetoothUuid::Bnep; + protUuids << QBluetoothUuid::Upnp; + protUuids << QBluetoothUuid::Hidp; + protUuids << QBluetoothUuid::HardcopyControlChannel; + protUuids << QBluetoothUuid::HardcopyDataChannel; + protUuids << QBluetoothUuid::HardcopyNotification; + protUuids << QBluetoothUuid::Avctp; + protUuids << QBluetoothUuid::Avdtp; + protUuids << QBluetoothUuid::Cmtp; + protUuids << QBluetoothUuid::UdiCPlain; + protUuids << QBluetoothUuid::McapControlChannel; + protUuids << QBluetoothUuid::McapDataChannel; + protUuids << QBluetoothUuid::L2cap; { QBluetoothServiceInfo serviceInfo; QVERIFY(!serviceInfo.isValid()); QVERIFY(!serviceInfo.isComplete()); + QVERIFY(!serviceInfo.isRegistered()); + QCOMPARE(serviceInfo.serviceName(), QString()); + QCOMPARE(serviceInfo.serviceDescription(), QString()); + QCOMPARE(serviceInfo.serviceProvider(), QString()); + QCOMPARE(serviceInfo.serviceUuid(), QBluetoothUuid()); + QCOMPARE(serviceInfo.serviceClassUuids().count(), 0); + QCOMPARE(serviceInfo.attributes().count(), 0); + QCOMPARE(serviceInfo.serverChannel(), -1); + QCOMPARE(serviceInfo.protocolServiceMultiplexer(), -1); + + foreach (QBluetoothUuid::ProtocolUuid u, protUuids) + QCOMPARE(serviceInfo.protocolDescriptor(u).count(), 0); } { @@ -110,6 +152,8 @@ serviceInfo.setDevice(deviceInfo); QVERIFY(serviceInfo.isValid()); + QVERIFY(!serviceInfo.isComplete()); + QVERIFY(!serviceInfo.isRegistered()); QCOMPARE(serviceInfo.serviceName(), serviceName); QCOMPARE(serviceInfo.device().address(), deviceInfo.address()); @@ -117,9 +161,25 @@ QBluetoothServiceInfo copyInfo(serviceInfo); QVERIFY(copyInfo.isValid()); + QVERIFY(!copyInfo.isComplete()); + QVERIFY(!copyInfo.isRegistered()); QCOMPARE(copyInfo.serviceName(), serviceName); QCOMPARE(copyInfo.device().address(), deviceInfo.address()); + + + copyInfo.setAttribute(QBluetoothServiceInfo::ServiceName, alternateServiceName); + copyInfo.setDevice(alternatedeviceInfo); + QCOMPARE(copyInfo.serviceName(), alternateServiceName); + QCOMPARE(copyInfo.attribute(QBluetoothServiceInfo::ServiceName).toString(), alternateServiceName); + QCOMPARE(serviceInfo.serviceName(), alternateServiceName); + QCOMPARE(copyInfo.device().address(), alternatedeviceInfo.address()); + QCOMPARE(serviceInfo.device().address(), alternatedeviceInfo.address()); + + foreach (QBluetoothUuid::ProtocolUuid u, protUuids) + QCOMPARE(serviceInfo.protocolDescriptor(u).count(), 0); + foreach (QBluetoothUuid::ProtocolUuid u, protUuids) + QCOMPARE(copyInfo.protocolDescriptor(u).count(), 0); } } @@ -148,11 +208,15 @@ serviceInfo.setDevice(deviceInfo); QVERIFY(serviceInfo.isValid()); + QVERIFY(!serviceInfo.isRegistered()); + QVERIFY(!serviceInfo.isComplete()); { QBluetoothServiceInfo copyInfo = serviceInfo; QVERIFY(copyInfo.isValid()); + QVERIFY(!copyInfo.isRegistered()); + QVERIFY(!copyInfo.isComplete()); QCOMPARE(copyInfo.serviceName(), serviceName); QCOMPARE(copyInfo.device().address(), deviceInfo.address()); @@ -162,10 +226,14 @@ QBluetoothServiceInfo copyInfo; QVERIFY(!copyInfo.isValid()); + QVERIFY(!copyInfo.isRegistered()); + QVERIFY(!copyInfo.isComplete()); copyInfo = serviceInfo; QVERIFY(copyInfo.isValid()); + QVERIFY(!copyInfo.isRegistered()); + QVERIFY(!copyInfo.isComplete()); QCOMPARE(copyInfo.serviceName(), serviceName); QCOMPARE(copyInfo.device().address(), deviceInfo.address()); @@ -176,12 +244,20 @@ QBluetoothServiceInfo copyInfo2; QVERIFY(!copyInfo1.isValid()); + QVERIFY(!copyInfo1.isRegistered()); + QVERIFY(!copyInfo1.isComplete()); QVERIFY(!copyInfo2.isValid()); + QVERIFY(!copyInfo2.isRegistered()); + QVERIFY(!copyInfo2.isComplete()); copyInfo1 = copyInfo2 = serviceInfo; QVERIFY(copyInfo1.isValid()); + QVERIFY(!copyInfo1.isRegistered()); + QVERIFY(!copyInfo1.isComplete()); QVERIFY(copyInfo2.isValid()); + QVERIFY(!copyInfo2.isRegistered()); + QVERIFY(!copyInfo2.isComplete()); QCOMPARE(copyInfo1.serviceName(), serviceName); QCOMPARE(copyInfo2.serviceName(), serviceName); @@ -192,7 +268,10 @@ { QBluetoothServiceInfo copyInfo; QVERIFY(!copyInfo.isValid()); + QVERIFY(!copyInfo.isRegistered()); + QVERIFY(!copyInfo.isComplete()); copyInfo = serviceInfo; + QVERIFY(copyInfo.contains(QBluetoothServiceInfo::ServiceName)); copyInfo.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, QBluetoothUuid(uuid)); QVERIFY(copyInfo.contains(QBluetoothServiceInfo::ProtocolDescriptorList)); @@ -237,9 +316,15 @@ } else { QVERIFY(copyInfo.registerService()); QVERIFY(copyInfo.isRegistered()); + QVERIFY(serviceInfo.isRegistered()); + QBluetoothServiceInfo secondCopy; + secondCopy = copyInfo; + QVERIFY(secondCopy.isRegistered()); - QVERIFY(copyInfo.unregisterService()); + QVERIFY(secondCopy.unregisterService()); QVERIFY(!copyInfo.isRegistered()); + QVERIFY(!secondCopy.isRegistered()); + QVERIFY(!serviceInfo.isRegistered()); } } } diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -53,10 +53,10 @@ #include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QBluetoothSocket::SocketState) -Q_DECLARE_METATYPE(QBluetoothSocket::SocketType) +Q_DECLARE_METATYPE(QBluetoothServiceInfo::Protocol) //#define BTADDRESS "00:1A:9F:92:9E:5A" char BTADDRESS[] = "00:00:00:00:00:00"; @@ -189,21 +189,21 @@ void tst_QBluetoothSocket::tst_construction_data() { - QTest::addColumn("socketType"); + QTest::addColumn("socketType"); - QTest::newRow("unknown socket") << QBluetoothSocket::UnknownSocketType; - QTest::newRow("rfcomm socket") << QBluetoothSocket::RfcommSocket; - QTest::newRow("l2cap socket") << QBluetoothSocket::L2capSocket; + QTest::newRow("unknown protocol") << QBluetoothServiceInfo::UnknownProtocol; + QTest::newRow("rfcomm socket") << QBluetoothServiceInfo::RfcommProtocol; + QTest::newRow("l2cap socket") << QBluetoothServiceInfo::L2capProtocol; } void tst_QBluetoothSocket::tst_construction() { - QFETCH(QBluetoothSocket::SocketType, socketType); + QFETCH(QBluetoothServiceInfo::Protocol, socketType); { QBluetoothSocket socket; - QCOMPARE(socket.socketType(), QBluetoothSocket::UnknownSocketType); + QCOMPARE(socket.socketType(), QBluetoothServiceInfo::UnknownProtocol); } { @@ -215,7 +215,7 @@ void tst_QBluetoothSocket::tst_clientConnection_data() { - QTest::addColumn("sockettype"); + QTest::addColumn("socketprotocol"); QTest::addColumn("shutdown"); QTest::addColumn("address"); QTest::addColumn("port"); @@ -225,41 +225,41 @@ QBluetoothAddress address(BTADDRESS); quint16 port = 10; - QTest::newRow("unavailable, error") << QBluetoothSocket::RfcommSocket + QTest::newRow("unavailable, error") << QBluetoothServiceInfo::RfcommProtocol << Error << QBluetoothAddress("112233445566") << quint16(10) << QByteArray(); - QTest::newRow("available, disconnect") << QBluetoothSocket::RfcommSocket + QTest::newRow("available, disconnect") << QBluetoothServiceInfo::RfcommProtocol << Disconnect << address << port << QByteArray(); - QTest::newRow("available, disconnect with data") << QBluetoothSocket::RfcommSocket + QTest::newRow("available, disconnect with data") << QBluetoothServiceInfo::RfcommProtocol << Disconnect << address << port << QByteArray("Test message\n"); - QTest::newRow("available, close") << QBluetoothSocket::RfcommSocket + QTest::newRow("available, close") << QBluetoothServiceInfo::RfcommProtocol << Close << address << port << QByteArray(); - QTest::newRow("available, abort") << QBluetoothSocket::RfcommSocket + QTest::newRow("available, abort") << QBluetoothServiceInfo::RfcommProtocol << Abort << address << port << QByteArray(); - QTest::newRow("available, abort with data") << QBluetoothSocket::RfcommSocket + QTest::newRow("available, abort with data") << QBluetoothServiceInfo::RfcommProtocol << Abort << address << port << QByteArray("Test message\n"); port = 0x1011; - QTest::newRow("unavailable, error") << QBluetoothSocket::L2capSocket + QTest::newRow("unavailable, error") << QBluetoothServiceInfo::L2capProtocol << Error << QBluetoothAddress("112233445566") << quint16(10) << QByteArray(); - QTest::newRow("available, disconnect") << QBluetoothSocket::L2capSocket + QTest::newRow("available, disconnect") << QBluetoothServiceInfo::L2capProtocol << Disconnect << address << port << QByteArray(); - QTest::newRow("available, disconnect with data") << QBluetoothSocket::L2capSocket + QTest::newRow("available, disconnect with data") << QBluetoothServiceInfo::L2capProtocol << Disconnect << address << port << QByteArray("Test message\n"); - QTest::newRow("available, close") << QBluetoothSocket::L2capSocket + QTest::newRow("available, close") << QBluetoothServiceInfo::L2capProtocol << Close << address << port << QByteArray(); - QTest::newRow("available, abort") << QBluetoothSocket::L2capSocket + QTest::newRow("available, abort") << QBluetoothServiceInfo::L2capProtocol << Abort << address << port << QByteArray(); - QTest::newRow("available, abort with data") << QBluetoothSocket::L2capSocket + QTest::newRow("available, abort with data") << QBluetoothServiceInfo::L2capProtocol << Abort << address << port << QByteArray("Test message\n"); } void tst_QBluetoothSocket::tst_clientConnection() { - QFETCH(QBluetoothSocket::SocketType, sockettype); + QFETCH(QBluetoothServiceInfo::Protocol, socketprotocol); QFETCH(ClientConnectionShutdown, shutdown); QFETCH(QBluetoothAddress, address); QFETCH(quint16, port); @@ -268,11 +268,11 @@ tryagain: /* Construction */ - QBluetoothSocket *socket = new QBluetoothSocket(sockettype); + QBluetoothSocket *socket = new QBluetoothSocket(socketprotocol); QSignalSpy stateSpy(socket, SIGNAL(stateChanged(QBluetoothSocket::SocketState))); - QCOMPARE(socket->socketType(), sockettype); + QCOMPARE(socket->socketType(), socketprotocol); QCOMPARE(socket->state(), QBluetoothSocket::UnconnectedState); /* Connection */ @@ -420,7 +420,7 @@ QSignalSpy stateSpy(socket, SIGNAL(stateChanged(QBluetoothSocket::SocketState))); - QCOMPARE(socket->socketType(), QBluetoothSocket::UnknownSocketType); + QCOMPARE(socket->socketType(), QBluetoothServiceInfo::UnknownProtocol); QCOMPARE(socket->state(), QBluetoothSocket::UnconnectedState); /* Connection */ @@ -494,11 +494,11 @@ QFETCH(QStringList, data); /* Construction */ - QBluetoothSocket *socket = new QBluetoothSocket(QBluetoothSocket::RfcommSocket); + QBluetoothSocket *socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol); QSignalSpy stateSpy(socket, SIGNAL(stateChanged(QBluetoothSocket::SocketState))); - QCOMPARE(socket->socketType(), QBluetoothSocket::RfcommSocket); + QCOMPARE(socket->socketType(), QBluetoothServiceInfo::RfcommProtocol); QCOMPARE(socket->state(), QBluetoothSocket::UnconnectedState); /* Connection */ @@ -686,11 +686,11 @@ /* Construction */ - QBluetoothSocket *socket = new QBluetoothSocket(QBluetoothSocket::RfcommSocket); + QBluetoothSocket *socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol); QSignalSpy stateSpy(socket, SIGNAL(stateChanged(QBluetoothSocket::SocketState))); - QCOMPARE(socket->socketType(), QBluetoothSocket::RfcommSocket); + QCOMPARE(socket->socketType(), QBluetoothServiceInfo::RfcommProtocol); QCOMPARE(socket->state(), QBluetoothSocket::UnconnectedState); /* Connection */ @@ -755,10 +755,8 @@ QCOMPARE(errorSpy.count(), 0); const QBluetoothSocket::SocketError e = socket.error(); - QVERIFY(e != QBluetoothSocket::ConnectionRefusedError - && e != QBluetoothSocket::HostNotFoundError + QVERIFY(e != QBluetoothSocket::HostNotFoundError && e != QBluetoothSocket::NetworkError - && e != QBluetoothSocket::RemoteHostClosedError && e != QBluetoothSocket::ServiceNotFoundError && e != QBluetoothSocket::UnknownSocketError); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothtransfermanager/qbluetoothtransfermanager.pro qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothtransfermanager/qbluetoothtransfermanager.pro --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothtransfermanager/qbluetoothtransfermanager.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothtransfermanager/qbluetoothtransfermanager.pro 2014-02-01 20:38:03.000000000 +0000 @@ -7,5 +7,5 @@ INCLUDEPATH += ../../../tests/btclient -CONFIG += insignificant_test # QTBUG-22017 +TESTDATA += *.txt DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothtransfermanager/testfile.txt qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothtransfermanager/testfile.txt --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothtransfermanager/testfile.txt 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothtransfermanager/testfile.txt 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1 @@ +This is a small test file to be transmitted by tst_bluetoothtransfermanager. diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothtransfermanager/tst_qbluetoothtransfermanager.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothtransfermanager/tst_qbluetoothtransfermanager.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothtransfermanager/tst_qbluetoothtransfermanager.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothtransfermanager/tst_qbluetoothtransfermanager.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -56,12 +56,19 @@ #include #include -QT_USE_NAMESPACE_BLUETOOTH +/* + * Some tests require a Bluetooth device within the vincinity of the test + * machine executing this test. The tests require manual interaction + * as pairing and file transfer requests must be accepted. + * The remote device's address must be passed + * via the BT_TEST_DEVICE env variable. The remote device must be + * discoverable and the object push service must be accessible. Any + **/ -typedef QMap tst_QBluetoothTransferManager_QParameterMap; -Q_DECLARE_METATYPE(tst_QBluetoothTransferManager_QParameterMap) +QT_USE_NAMESPACE -char BTADDRESS[] = "00:00:00:00:00:00"; +typedef QMap tst_QBluetoothTransferManager_QParameterMap; +Q_DECLARE_METATYPE(tst_QBluetoothTransferManager_QParameterMap) static const int MaxConnectTime = 60 * 1000; // 1 minute in ms @@ -78,31 +85,21 @@ void tst_construction(); - void tst_put_data(); - void tst_put(); - - void tst_putAbort_data(); - void tst_putAbort(); - - void tst_attribute_data(); - void tst_attribute(); - - void tst_operation_data(); - void tst_operation(); + void tst_request_data(); + void tst_request(); - void tst_manager_data(); - void tst_manager(); + void tst_sendFile_data(); + void tst_sendFile(); -public slots: - void serviceDiscovered(const QBluetoothServiceInfo &info); - void finished(); - void error(QBluetoothServiceDiscoveryAgent::Error error); + void tst_sendBuffer_data(); + void tst_sendBuffer(); private: - bool done_discovery; + QBluetoothAddress remoteAddress; }; tst_QBluetoothTransferManager::tst_QBluetoothTransferManager() { + qRegisterMetaType("QBluetoothTransferReply*"); } tst_QBluetoothTransferManager::~tst_QBluetoothTransferManager() @@ -111,6 +108,16 @@ void tst_QBluetoothTransferManager::initTestCase() { + const QString remote = qgetenv("BT_TEST_DEVICE"); + if (!remote.isEmpty()) { + remoteAddress = QBluetoothAddress(remote); + QVERIFY(!remoteAddress.isNull()); + qWarning() << "Using remote device " << remote << " for testing. Ensure that the device is discoverable for pairing requests"; + } else { + qWarning() << "Not using any remote device for testing. Set BT_TEST_DEVICE env to run manual tests involving a remote device"; + QSKIP("Remote upload test not possible. Set BT_TEST_DEVICE"); + } + if (!QBluetoothLocalDevice::allDevices().count()) QSKIP("Skipping test due to missing Bluetooth device"); @@ -118,47 +125,6 @@ QBluetoothLocalDevice *device = new QBluetoothLocalDevice(); device->powerOn(); delete device; - - // Go find an echo server for BTADDRESS - QBluetoothServiceDiscoveryAgent *sda = new QBluetoothServiceDiscoveryAgent(this); - connect(sda, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)), this, SLOT(serviceDiscovered(QBluetoothServiceInfo))); - connect(sda, SIGNAL(error(QBluetoothServiceDiscoveryAgent::Error)), this, SLOT(error(QBluetoothServiceDiscoveryAgent::Error))); - connect(sda, SIGNAL(finished()), this, SLOT(finished())); - - qDebug() << "Starting discovery"; - done_discovery = false; - memset(BTADDRESS, 0, 18); - - sda->setUuidFilter(QBluetoothUuid(QString(ECHO_SERVICE_UUID))); - sda->start(QBluetoothServiceDiscoveryAgent::MinimalDiscovery); - - for (int connectTime = MaxConnectTime; !done_discovery && connectTime > 0; connectTime -= 1000) - QTest::qWait(1000); - - sda->stop(); - - if (BTADDRESS[0] == 0) { - QFAIL("Unable to find test service"); - } - delete sda; -} -void tst_QBluetoothTransferManager::error(QBluetoothServiceDiscoveryAgent::Error error) -{ - qDebug() << "Received error" << error; -// done_discovery = true; -} - -void tst_QBluetoothTransferManager::finished() -{ - qDebug() << "Finished"; - done_discovery = true; -} - -void tst_QBluetoothTransferManager::serviceDiscovered(const QBluetoothServiceInfo &info) -{ - qDebug() << "Found: " << info.device().name() << info.serviceUuid(); - strcpy(BTADDRESS, info.device().address().toString().toLatin1()); - done_discovery = true; } void tst_QBluetoothTransferManager::tst_construction() @@ -169,115 +135,216 @@ delete manager; } -void tst_QBluetoothTransferManager::tst_put_data() +void tst_QBluetoothTransferManager::tst_request_data() { QTest::addColumn("address"); - QTest::addColumn >("parameters"); + QTest::addColumn >("parameters"); - QMap inparameters; - inparameters.insert((int)QBluetoothTransferRequest::DescriptionAttribute, "Desciption"); - inparameters.insert((int)QBluetoothTransferRequest::LengthAttribute, QVariant(1024)); - inparameters.insert((int)QBluetoothTransferRequest::TypeAttribute, "OPP"); + QMap inparameters; + inparameters.insert(QBluetoothTransferRequest::DescriptionAttribute, "Description"); + inparameters.insert(QBluetoothTransferRequest::LengthAttribute, QVariant(1024)); + inparameters.insert(QBluetoothTransferRequest::TypeAttribute, "OPP"); + inparameters.insert(QBluetoothTransferRequest::NameAttribute, "name"); + inparameters.insert(QBluetoothTransferRequest::TimeAttribute, QDateTime::currentDateTime()); - QTest::newRow("0x000000 COD") << QBluetoothAddress(BTADDRESS) << inparameters; + QTest::newRow("TESTDATA") << QBluetoothAddress("00:11:22:33:44:55:66") << inparameters; } -void tst_QBluetoothTransferManager::tst_put() +void tst_QBluetoothTransferManager::tst_request() { QFETCH(QBluetoothAddress, address); QFETCH(tst_QBluetoothTransferManager_QParameterMap, parameters); QBluetoothTransferRequest transferRequest(address); + foreach (QBluetoothTransferRequest::Attribute key, parameters.keys()) + QCOMPARE(transferRequest.attribute(key), QVariant()); - foreach (int key, parameters.keys()) { + foreach (QBluetoothTransferRequest::Attribute key, parameters.keys()) transferRequest.setAttribute((QBluetoothTransferRequest::Attribute)key, parameters[key]); - } - QBluetoothTransferManager manager; + QCOMPARE(transferRequest.address(), address); + foreach (QBluetoothTransferRequest::Attribute key, parameters.keys()) + QCOMPARE(transferRequest.attribute(key), parameters[key]); + + //test copy constructor + QBluetoothTransferRequest constructorCopy = transferRequest; + QVERIFY(constructorCopy == transferRequest); + QVERIFY(!(constructorCopy != transferRequest)); + QCOMPARE(constructorCopy.address(), address); + foreach (QBluetoothTransferRequest::Attribute key, parameters.keys()) + QCOMPARE(constructorCopy.attribute(key), parameters[key]); + + //test assignment operator + QBluetoothTransferRequest request; + QVERIFY(request.address().isNull()); + foreach (QBluetoothTransferRequest::Attribute key, parameters.keys()) + QCOMPARE(request.attribute(key), QVariant()); + request = transferRequest; + QCOMPARE(request.address(), address); + foreach (QBluetoothTransferRequest::Attribute key, parameters.keys()) + QCOMPARE(request.attribute(key), parameters[key]); + + //test that it's a true and independent copy + constructorCopy.setAttribute(QBluetoothTransferRequest::DescriptionAttribute, "newDescription"); + request.setAttribute(QBluetoothTransferRequest::TypeAttribute, "FTP"); + + QCOMPARE(constructorCopy.attribute(QBluetoothTransferRequest::DescriptionAttribute).toString(),QString("newDescription")); + QCOMPARE(request.attribute(QBluetoothTransferRequest::DescriptionAttribute).toString(),QString("Description")); + QCOMPARE(transferRequest.attribute(QBluetoothTransferRequest::DescriptionAttribute).toString(),QString("Description")); + + QCOMPARE(constructorCopy.attribute(QBluetoothTransferRequest::TypeAttribute).toString(),QString("OPP")); + QCOMPARE(request.attribute(QBluetoothTransferRequest::TypeAttribute).toString(),QString("FTP")); + QCOMPARE(transferRequest.attribute(QBluetoothTransferRequest::TypeAttribute).toString(),QString("OPP")); +} + +void tst_QBluetoothTransferManager::tst_sendFile_data() +{ + QTest::addColumn("deviceAddress"); + QTest::addColumn("expectSuccess"); + QTest::addColumn("isInvalidFile"); + + QTest::newRow("Push to remote test device") << remoteAddress << true << false; + QTest::newRow("Push of non-existing file") << remoteAddress << false << true; + QTest::newRow("Push to invalid address") << QBluetoothAddress() << false << false; + QTest::newRow("Push to non-existend device") << QBluetoothAddress("11:22:33:44:55:66") << false << false; + } -void tst_QBluetoothTransferManager::tst_putAbort_data() -{ - QTest::addColumn("address"); - QTest::addColumn >("parameters"); +void tst_QBluetoothTransferManager::tst_sendFile() +{ + QFETCH(QBluetoothAddress, deviceAddress); + QFETCH(bool, expectSuccess); + QFETCH(bool, isInvalidFile); + + QBluetoothLocalDevice dev; + if (expectSuccess) { + dev.requestPairing(deviceAddress, QBluetoothLocalDevice::Paired); + QTest::qWait(5000); + QCOMPARE(dev.pairingStatus(deviceAddress), QBluetoothLocalDevice::Paired); + } - QMap inparameters; - inparameters.insert((int)QBluetoothTransferRequest::DescriptionAttribute, "Desciption"); - inparameters.insert((int)QBluetoothTransferRequest::LengthAttribute, QVariant(1024)); - inparameters.insert((int)QBluetoothTransferRequest::TypeAttribute, "OPP"); + QBluetoothTransferRequest request(deviceAddress); + QCOMPARE(request.address(), deviceAddress); - QTest::newRow("0x000000 COD") << QBluetoothAddress(BTADDRESS) << inparameters; -} + QBluetoothTransferManager manager; + QString fileHandle; + if (!isInvalidFile) { + fileHandle = QFINDTESTDATA("testfile.txt"); + QVERIFY(!fileHandle.isEmpty()); + } else { + fileHandle = ("arbitraryFileName.txt"); //file doesn't exist + } + QFile f(fileHandle); + QCOMPARE(f.exists(), !isInvalidFile); -void tst_QBluetoothTransferManager::tst_putAbort() -{ - QFETCH(QBluetoothAddress, address); - QFETCH(tst_QBluetoothTransferManager_QParameterMap, parameters); - QBluetoothTransferRequest transferRequest(address); + qDebug() << "Transferring file to " << deviceAddress.toString(); + if (expectSuccess) + qDebug() << "Please accept Object push request on remote device"; + QBluetoothTransferReply* reply = manager.put(request, &f); + QSignalSpy finishedSpy(reply, SIGNAL(finished(QBluetoothTransferReply*))); + QSignalSpy progressSpy(reply, SIGNAL(transferProgress(qint64,qint64))); + + QCOMPARE(reply->request(), request); + QVERIFY(reply->manager() == &manager); + QVERIFY(!reply->isFinished()); + QVERIFY(reply->isRunning()); + + const int maxWaitTime = 20 * 1000; //20s + for (int time = 0; + time0); + if (expectSuccess) { + QVERIFY(progressSpy.count()>0); + QCOMPARE(reply->error(), QBluetoothTransferReply::NoError); + QCOMPARE(reply->errorString(), QString()); + } else { + QVERIFY(progressSpy.count() == 0); + if (isInvalidFile) + QVERIFY(reply->error() == QBluetoothTransferReply::FileNotFoundError); + else + QVERIFY(reply->error() != QBluetoothTransferReply::NoError); + QVERIFY(!reply->errorString().isEmpty()); } - QBluetoothTransferManager manager; + QVERIFY(reply->isFinished()); + QVERIFY(!reply->isRunning()); } -void tst_QBluetoothTransferManager::tst_attribute_data() +void tst_QBluetoothTransferManager::tst_sendBuffer_data() { - QTest::addColumn("address"); - QTest::addColumn >("parameters"); - QMap inparameters; - inparameters.insert((int)QBluetoothTransferRequest::DescriptionAttribute, "Desciption"); - inparameters.insert((int)QBluetoothTransferRequest::LengthAttribute, QVariant(1024)); - inparameters.insert((int)QBluetoothTransferRequest::TypeAttribute, "OPP"); + QTest::addColumn("deviceAddress"); + QTest::addColumn("expectSuccess"); + QTest::addColumn("data"); - QTest::newRow("0x000000 COD") << QBluetoothAddress(BTADDRESS) << inparameters; + QTest::newRow("Push to remote test device") << remoteAddress << true << + QByteArray("This is a very long byte arry which we are going to access via a QBuffer"); ; + QTest::newRow("Push to invalid address") << QBluetoothAddress() << false << QByteArray("test"); + QTest::newRow("Push to non-existend device") << QBluetoothAddress("11:22:33:44:55:66") << false << QByteArray("test"); } -void tst_QBluetoothTransferManager::tst_attribute() -{ - QFETCH(QBluetoothAddress, address); - QFETCH(tst_QBluetoothTransferManager_QParameterMap, parameters); - QBluetoothTransferRequest transferRequest(address); - foreach (int key, parameters.keys()) { - transferRequest.setAttribute((QBluetoothTransferRequest::Attribute)key, parameters[key]); - } - - QBluetoothTransferManager manager; -} - -void tst_QBluetoothTransferManager::tst_operation_data() +void tst_QBluetoothTransferManager::tst_sendBuffer() { - QTest::addColumn("address"); + QFETCH(QBluetoothAddress, deviceAddress); + QFETCH(bool, expectSuccess); + QFETCH(QByteArray, data); - QTest::newRow("0x000000 COD") << QBluetoothAddress(BTADDRESS); -} + QBuffer buffer; + buffer.setData(data); + buffer.open(QIODevice::ReadOnly); + buffer.seek(0); -void tst_QBluetoothTransferManager::tst_operation() -{ - QFETCH(QBluetoothAddress, address); + QBluetoothLocalDevice dev; + if (expectSuccess) { + dev.requestPairing(deviceAddress, QBluetoothLocalDevice::Paired); + QTest::qWait(2000); + QCOMPARE(dev.pairingStatus(deviceAddress), QBluetoothLocalDevice::Paired); + } - QBluetoothTransferRequest transferRequest(address); - QBluetoothTransferManager manager; -} + QBluetoothTransferRequest request(deviceAddress); + QCOMPARE(request.address(), deviceAddress); -void tst_QBluetoothTransferManager::tst_manager_data() -{ - QTest::addColumn("address"); + QBluetoothTransferManager manager; - QTest::newRow("0x000000 COD") << QBluetoothAddress(BTADDRESS); -} + qDebug() << "Transferring test buffer to " << deviceAddress.toString(); + if (expectSuccess) + qDebug() << "Please accept Object push request on remote device"; + QBluetoothTransferReply* reply = manager.put(request, &buffer); + QSignalSpy finishedSpy(reply, SIGNAL(finished(QBluetoothTransferReply*))); + QSignalSpy progressSpy(reply, SIGNAL(transferProgress(qint64,qint64))); + + QCOMPARE(reply->request(), request); + QVERIFY(reply->manager() == &manager); + QVERIFY(!reply->isFinished()); + QVERIFY(reply->isRunning()); + + const int maxWaitTime = 20 * 1000; //20s + for (int time = 0; + time0); + if (expectSuccess) { + QVERIFY(progressSpy.count()>0); + QCOMPARE(reply->error(), QBluetoothTransferReply::NoError); + QCOMPARE(reply->errorString(), QString()); + } else { + QVERIFY(progressSpy.count() == 0); + QVERIFY(reply->error() != QBluetoothTransferReply::NoError); + QVERIFY(!reply->errorString().isEmpty()); + } - QBluetoothTransferRequest transferRequest(address); - QBluetoothTransferManager manager; + QVERIFY(reply->isFinished()); + QVERIFY(!reply->isRunning()); } QTEST_MAIN(tst_QBluetoothTransferManager) diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothtransferrequest/tst_qbluetoothtransferrequest.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothtransferrequest/tst_qbluetoothtransferrequest.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothtransferrequest/tst_qbluetoothtransferrequest.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothtransferrequest/tst_qbluetoothtransferrequest.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include #include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE typedef QMap tst_QBluetoothTransferRequest_QParameterMap; Q_DECLARE_METATYPE(tst_QBluetoothTransferRequest_QParameterMap) diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -51,7 +51,7 @@ # include #endif -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE Q_DECLARE_METATYPE(quint128) diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/ql2capserver/tst_ql2capserver.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/ql2capserver/tst_ql2capserver.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/ql2capserver/tst_ql2capserver.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/ql2capserver/tst_ql2capserver.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,10 +43,10 @@ #include -#include +#include #include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QBluetooth::SecurityFlags); @@ -94,7 +94,7 @@ void tst_QL2capServer::tst_construction() { { - QL2capServer server; + QBluetoothServer server(QBluetoothServiceInfo::L2capProtocol); QVERIFY(!server.isListening()); QCOMPARE(server.maxPendingConnections(), 1); @@ -122,7 +122,7 @@ QFETCH(quint16, port); { - QL2capServer server; + QBluetoothServer server(QBluetoothServiceInfo::L2capProtocol); bool result = server.listen(address, port); @@ -169,7 +169,7 @@ QFETCH(int, maxConnections); { - QL2capServer server; + QBluetoothServer server(QBluetoothServiceInfo::L2capProtocol); server.setMaxPendingConnections(maxConnections); @@ -235,7 +235,7 @@ { QFETCH(QByteArray, expected); - QL2capServer server; + QBluetoothServer server(QBluetoothServiceInfo::L2capProtocol); bool result = server.listen(); @@ -273,7 +273,7 @@ void tst_QL2capServer::tst_secureFlags() { - QL2capServer server; + QBluetoothServer server(QBluetoothServiceInfo::L2capProtocol); QCOMPARE(server.securityFlags(), QBluetooth::NoSecurity); server.setSecurityFlags(QBluetooth::Encryption); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qndefmessage/tst_qndefmessage.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qndefmessage/tst_qndefmessage.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qndefmessage/tst_qndefmessage.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qndefmessage/tst_qndefmessage.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -46,7 +46,7 @@ #include #include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QNdefRecord) diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qndefnfcsmartposterrecord/qndefnfcsmartposterrecord.pro qtconnectivity-opensource-src-5.2.1/tests/auto/qndefnfcsmartposterrecord/qndefnfcsmartposterrecord.pro --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qndefnfcsmartposterrecord/qndefnfcsmartposterrecord.pro 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qndefnfcsmartposterrecord/qndefnfcsmartposterrecord.pro 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,6 @@ +SOURCES += tst_qndefnfcsmartposterrecord.cpp +TARGET = tst_qndefnfcsmartposterrecord +CONFIG += testcase + +QT = core nfc testlib +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qndefnfcsmartposterrecord/tst_qndefnfcsmartposterrecord.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qndefnfcsmartposterrecord/tst_qndefnfcsmartposterrecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qndefnfcsmartposterrecord/tst_qndefnfcsmartposterrecord.cpp 1970-01-01 00:00:00.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qndefnfcsmartposterrecord/tst_qndefnfcsmartposterrecord.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -0,0 +1,555 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtNfc 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 + +#include +#include +#include +#include +#include + +QT_USE_NAMESPACE + +static const quint8 payload[] = { + 0xC1, 0x02, 0x00, 0x00, 0x03, 0x0D, 0x53, 0x70, 0x91, 0x01, 0x08, 0x55, 0x01, 0x72, 0x69, 0x6D, 0x2E, 0x63, 0x6F, 0x6D, + 0x11, 0x01, 0x0D, 0x54, 0x02, 0x65, 0x6E, 0x49, 0x63, 0x6F, 0x6E, 0x20, 0x54, 0x69, 0x74, 0x6C, 0x65, 0x11, 0x01, 0x09, + 0x74, 0x74, 0x65, 0x78, 0x74, 0x2F, 0x68, 0x74, 0x6D, 0x6C, 0x11, 0x01, 0x04, 0x73, 0x00, 0x00, 0x04, 0x00, 0x11, 0x03, + 0x01, 0x61, 0x63, 0x74, 0x01, 0x42, 0x09, 0x00, 0x00, 0x02, 0xC5, 0x69, 0x6D, 0x61, 0x67, 0x65, 0x2F, 0x70, 0x6E, 0x67, + 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x1E, + 0x00, 0x00, 0x00, 0x1E, 0x08, 0x02, 0x00, 0x00, 0x00, 0xB4, 0x52, 0x39, 0xF5, 0x00, 0x00, 0x02, 0x8C, 0x49, 0x44, 0x41, + 0x54, 0x78, 0x9C, 0x62, 0x60, 0x68, 0x60, 0xA0, 0x11, 0x02, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA2, 0x99, 0xB9, 0x0D, 0x0C, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA2, 0xA1, 0xD1, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA2, 0xA1, 0xD1, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xA2, 0xA1, 0xD1, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x62, 0x60, 0x60, 0xE8, 0xA6, 0x11, 0x02, + 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA2, 0xA1, 0xD1, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA2, 0xA1, 0xD1, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xA2, 0xA1, 0xD1, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x82, 0x1A, 0x1D, 0x1B, 0xBB, 0x75, 0xE6, 0xCC, + 0x8B, 0x10, 0x34, 0x7F, 0xFE, 0xE5, 0xF2, 0xF2, 0x83, 0x82, 0x82, 0x93, 0x81, 0xE2, 0xF9, 0xF9, 0x7B, 0x81, 0x22, 0x1D, + 0x1D, 0x27, 0xE1, 0x1A, 0x3A, 0x3B, 0x4F, 0x02, 0x45, 0x94, 0x94, 0x66, 0x41, 0xB8, 0x69, 0x69, 0x3B, 0xF7, 0xEF, 0x7F, + 0x74, 0xF7, 0xEE, 0x87, 0xD5, 0xAB, 0x6F, 0x1A, 0x1B, 0x2F, 0x42, 0x36, 0x1A, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x82, 0x1A, + 0x0D, 0x34, 0xEE, 0x3F, 0x06, 0x00, 0x2A, 0x05, 0x6A, 0x83, 0xB3, 0x21, 0x2A, 0xDF, 0xBF, 0xFF, 0x01, 0xE4, 0xBA, 0xB8, + 0xAC, 0x02, 0xB2, 0xD7, 0xAF, 0xBF, 0x8D, 0xA9, 0x05, 0x6E, 0x34, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC2, 0x67, 0x34, 0xD0, + 0x2D, 0x70, 0xA3, 0xE1, 0x0E, 0x87, 0x1B, 0x1D, 0x1A, 0xBA, 0x09, 0xAE, 0xF2, 0xDD, 0xBB, 0xEF, 0x10, 0x06, 0xC4, 0x4A, + 0x08, 0x02, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x42, 0x31, 0x1A, 0xA8, 0x02, 0xE8, 0x53, 0x7B, 0xFB, 0x15, 0x67, 0xCE, 0xBC, + 0x80, 0x28, 0x85, 0x33, 0x80, 0xD6, 0xA0, 0x19, 0x0D, 0x91, 0x82, 0x68, 0x01, 0x8A, 0x4B, 0x4B, 0x4F, 0x5F, 0xB5, 0xEA, + 0x06, 0xB2, 0xD1, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x42, 0x37, 0x1A, 0xC2, 0x05, 0xAA, 0x80, 0x98, 0x78, 0xE5, 0xCA, + 0x1B, 0xB8, 0xD3, 0x20, 0x46, 0x40, 0x8C, 0x8E, 0x8E, 0xDE, 0x02, 0x11, 0x04, 0xBA, 0x1D, 0x57, 0x34, 0x02, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xC2, 0x6E, 0x34, 0x30, 0xC8, 0x90, 0x8D, 0xBE, 0x7F, 0xFF, 0x03, 0x3C, 0x4C, 0x20, 0x46, 0xD7, 0xD5, + 0x1D, 0x81, 0x28, 0xC0, 0x93, 0x42, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC2, 0x6E, 0x34, 0xD0, 0x14, 0x88, 0xCE, 0x0B, + 0x17, 0x5E, 0x01, 0xC9, 0xFE, 0xFE, 0x33, 0xF0, 0x30, 0x81, 0x18, 0xDD, 0xD5, 0x75, 0x0A, 0x59, 0x3D, 0x30, 0x39, 0x41, + 0x10, 0xB2, 0xD1, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x42, 0x8F, 0x46, 0x60, 0x08, 0x42, 0xDC, 0x08, 0x01, 0x90, 0x68, + 0xAC, 0xAF, 0x3F, 0xBA, 0x7B, 0xF7, 0x03, 0x48, 0x98, 0x40, 0x8C, 0x9E, 0x3A, 0xF5, 0x3C, 0x72, 0x04, 0xC0, 0xA3, 0x04, + 0x98, 0x2E, 0xE1, 0x46, 0x03, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC2, 0x97, 0x42, 0x80, 0x6E, 0x87, 0x18, 0x0D, 0x4C, 0xE6, + 0xC0, 0xF4, 0x0B, 0x61, 0x10, 0x6F, 0x34, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC2, 0x62, 0x34, 0x50, 0x33, 0x50, 0x0F, 0xD0, + 0x2C, 0xA0, 0x38, 0xDC, 0x68, 0xA0, 0x67, 0x21, 0x7E, 0x42, 0x0E, 0x10, 0x78, 0x58, 0x03, 0x23, 0x13, 0xA2, 0x12, 0xD9, + 0x68, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC2, 0x1E, 0xD6, 0x70, 0x04, 0x37, 0x1A, 0xCE, 0x86, 0x80, 0xB4, 0xB4, 0x5D, + 0xC8, 0xC9, 0x06, 0x88, 0x80, 0x81, 0x86, 0x66, 0x34, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x22, 0xC1, 0x68, 0x60, 0xA6, 0x87, + 0x1B, 0x0D, 0x4C, 0x9D, 0x90, 0x6C, 0x02, 0x4C, 0xCB, 0xB8, 0x8C, 0x06, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x22, 0xC1, 0x68, + 0x79, 0xF9, 0x99, 0xC8, 0x46, 0xC3, 0x53, 0x11, 0x30, 0xBB, 0x03, 0x15, 0x9C, 0x3F, 0xFF, 0x12, 0xCD, 0x68, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0x22, 0xC1, 0x68, 0xE4, 0xE8, 0x02, 0x1A, 0x0D, 0x0C, 0x7D, 0x48, 0xB8, 0x23, 0x03, 0x64, 0xA3, + 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x22, 0xCD, 0x68, 0x20, 0x03, 0x6E, 0x34, 0x90, 0x0B, 0x2C, 0x12, 0x80, 0x11, 0x0E, + 0x37, 0x17, 0x18, 0x38, 0xC8, 0x49, 0x1B, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA2, 0x42, 0x79, 0x0D, 0xCC, 0xBA, 0x40, 0x84, + 0x91, 0x5F, 0xBA, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA2, 0x61, 0xB5, 0x0B, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA2, 0xA1, + 0xD1, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA2, 0xA1, 0xD1, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA2, 0xA1, 0xD1, 0x00, + 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA3, 0xA1, 0xD1, 0x00, 0x27, 0x58, 0x04, 0x5A, 0x28, 0x87, 0x48, 0xD1, 0x00, 0x00, 0x00, + 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 +}; + +class tst_QNdefNfcSmartPosterRecord : public QObject +{ + Q_OBJECT + +public: + tst_QNdefNfcSmartPosterRecord(); + ~tst_QNdefNfcSmartPosterRecord(); + +private: + QNdefNfcTextRecord getTextRecord(const QString& locale); + QString getTitle(const QString& locale); + void checkLocale(const QNdefNfcSmartPosterRecord& record, const QStringList& localeList); + + QMap _textRecords; + +private slots: + void tst_emptyRecord(); + void tst_titles(); + void tst_uri(); + void tst_action(); + void tst_icon(); + void tst_size(); + void tst_typeInfo(); + void tst_construct(); + void tst_downcast(); +}; + +tst_QNdefNfcSmartPosterRecord::tst_QNdefNfcSmartPosterRecord() +{ + _textRecords["en"] = "test"; + _textRecords["fr"] = "essai"; + _textRecords["es"] = "prueba"; + _textRecords["de"] = "pruefung"; + _textRecords["nl"] = "proef"; + _textRecords["en-US"] = "trial"; +} + +tst_QNdefNfcSmartPosterRecord::~tst_QNdefNfcSmartPosterRecord() +{ +} + +QNdefNfcTextRecord tst_QNdefNfcSmartPosterRecord::getTextRecord(const QString& locale) +{ + QNdefNfcTextRecord record; + record.setLocale(locale); + record.setEncoding(QNdefNfcTextRecord::Utf8); + record.setText(_textRecords[locale]); + return record; +} + +QString tst_QNdefNfcSmartPosterRecord::getTitle(const QString& locale) +{ + return _textRecords[locale]; +} + +void tst_QNdefNfcSmartPosterRecord::checkLocale(const QNdefNfcSmartPosterRecord& record, const QStringList& localeList) +{ + QList locales = _textRecords.keys(); + + for (int i = 0; i < locales.size(); i++) { + if (localeList.contains(locales[i])) { + QVERIFY(record.hasTitle(locales[i])); + } + + else { + QVERIFY(!record.hasTitle(locales[i])); + } + } + + if (localeList.empty()) { + QVERIFY(record.hasTitle()); + } +} + +void tst_QNdefNfcSmartPosterRecord::tst_emptyRecord() +{ + QNdefNfcSmartPosterRecord record; + + QCOMPARE(record.typeNameFormat(), QNdefRecord::NfcRtd); + QCOMPARE(record.type(), QByteArray("Sp")); + QVERIFY(record.id().isEmpty()); + QVERIFY(record.payload().isEmpty()); + + QVERIFY(!record.hasTitle()); + QVERIFY(!record.hasAction()); + QVERIFY(!record.hasIcon()); + QVERIFY(!record.hasSize()); + QVERIFY(!record.hasTypeInfo()); + + QCOMPARE(record.titleCount(), 0); + QCOMPARE(record.titleRecord(0), QNdefNfcTextRecord()); + QCOMPARE(record.title(), QString()); + + QList emptyTitleList; + QCOMPARE(record.titleRecords(), emptyTitleList); + + QCOMPARE(record.uri(), QUrl()); + QCOMPARE(record.uriRecord(), QNdefNfcUriRecord()); + QCOMPARE(record.action(), QNdefNfcSmartPosterRecord::UnspecifiedAction); + QCOMPARE(record.iconCount(), 0); + QCOMPARE(record.iconRecord(0), QNdefNfcIconRecord()); + QCOMPARE(record.icon(), QByteArray()); + + QList emptyIconList; + QCOMPARE(record.iconRecords(), emptyIconList); + + quint32 size = 0; + QCOMPARE(record.size(), size); + QCOMPARE(record.typeInfo(), QByteArray()); + + QVERIFY(record.isRecordType()); + QVERIFY(!record.isRecordType()); + QVERIFY(!record.isRecordType()); + + QCOMPARE(record, QNdefNfcSmartPosterRecord()); + QVERIFY(!(record != QNdefNfcSmartPosterRecord())); +} + +void tst_QNdefNfcSmartPosterRecord::tst_titles() +{ + QNdefNfcSmartPosterRecord record; + + // Set "en" locale + QNdefNfcTextRecord enRecord = getTextRecord("en"); + QVERIFY(record.addTitle(enRecord)); + + QCOMPARE(record.titleCount(), 1); + { + QStringList locales; + locales << "en"; + checkLocale(record, locales); + } + + // Get "en" locale + QCOMPARE(record.titleRecord(0), enRecord); + QCOMPARE(record.title(), getTitle("en")); + QCOMPARE(record.title("fr"), QString()); + + QList titleRecords = record.titleRecords(); + QCOMPARE(titleRecords.size(), 1); + QCOMPARE(titleRecords[0], enRecord); + + QVERIFY(!record.addTitle(enRecord)); + QCOMPARE(record.titleCount(), 1); + + // Add "de" locale + QNdefNfcTextRecord deRecord = getTextRecord("de"); + QVERIFY(record.addTitle(deRecord)); + + QCOMPARE(record.titleCount(), 2); + { + QStringList locales; + locales << "en" << "de"; + checkLocale(record, locales); + } + + // Add "fr" locale + QNdefNfcTextRecord frRecord = getTextRecord("fr"); + QVERIFY(record.addTitle(frRecord)); + + QCOMPARE(record.titleCount(), 3); + { + QStringList locales; + locales << "en" << "de" << "fr"; + checkLocale(record, locales); + } + + QVERIFY(record.removeTitle(frRecord)); + + QCOMPARE(record.titleCount(), 2); + { + QStringList locales; + locales << "en" << "de"; + checkLocale(record, locales); + } + + QVERIFY(!record.removeTitle(frRecord)); + QCOMPARE(record.titleCount(), 2); + + QVERIFY(record.removeTitle("en")); + QCOMPARE(record.titleCount(), 1); + { + QStringList locales; + locales << "de"; + checkLocale(record, locales); + } + + titleRecords = record.titleRecords(); + QCOMPARE(titleRecords.size(), 1); + QCOMPARE(titleRecords[0], deRecord); + + QCOMPARE(record.title(), getTitle("de")); + + QVERIFY(record.removeTitle(deRecord)); + QCOMPARE(record.titleCount(), 0); + + // Test setTitles + QNdefNfcTextRecord nlRecord = getTextRecord("nl"); + QNdefNfcTextRecord esRecord = getTextRecord("es"); + + QVERIFY(record.addTitle(enRecord)); + QVERIFY(record.addTitle(deRecord)); + QVERIFY(record.addTitle(frRecord)); + QCOMPARE(record.titleCount(), 3); + + QList titles; + titles << nlRecord << esRecord; + record.setTitles(titles); + + QCOMPARE(record.titleCount(), 2); + QCOMPARE(record.title("en"), QString()); + QCOMPARE(record.title("de"), QString()); + QCOMPARE(record.title("fr"), QString()); + + QCOMPARE(record.title("nl"), getTitle("nl")); + QCOMPARE(record.title("es"), getTitle("es")); +} + +void tst_QNdefNfcSmartPosterRecord::tst_uri() +{ + QNdefNfcSmartPosterRecord record; + QString qtString = "http://www.qt-project.org"; + QString bbString = "http://www.blackberry.com"; + + QCOMPARE(record.uri(), QUrl()); + QCOMPARE(record.uriRecord(), QNdefNfcUriRecord()); + + QUrl qtUrl(qtString); + record.setUri(qtUrl); + QCOMPARE(record.uri(), qtUrl); + + QNdefNfcUriRecord qtRecord; + qtRecord.setUri(qtString); + QCOMPARE(record.uriRecord(), qtRecord); + + QNdefNfcUriRecord bbRecord; + bbRecord.setUri(bbString); + record.setUri(bbRecord); + QCOMPARE(record.uri(), QUrl(bbString)); + QCOMPARE(record.uriRecord(), bbRecord); +} + +void tst_QNdefNfcSmartPosterRecord::tst_action() +{ + QNdefNfcSmartPosterRecord record; + + record.setAction(QNdefNfcSmartPosterRecord::DoAction); + QVERIFY(record.hasAction()); + QCOMPARE(record.action(), QNdefNfcSmartPosterRecord::DoAction); + + record.setAction(QNdefNfcSmartPosterRecord::SaveAction); + QVERIFY(record.hasAction()); + QCOMPARE(record.action(), QNdefNfcSmartPosterRecord::SaveAction); + + record.setAction(QNdefNfcSmartPosterRecord::UnspecifiedAction); + QVERIFY(record.hasAction()); + QCOMPARE(record.action(), QNdefNfcSmartPosterRecord::UnspecifiedAction); +} + +void tst_QNdefNfcSmartPosterRecord::tst_icon() +{ + QNdefNfcSmartPosterRecord record; + + QNdefNfcIconRecord icon; + record.addIcon(icon); + QVERIFY(record.hasIcon()); + QCOMPARE(record.iconCount(), 1); + QCOMPARE(record.iconRecord(0), icon); + QCOMPARE(record.icon(), QByteArray()); + + QList iconRecords = record.iconRecords(); + QCOMPARE(iconRecords.size(), 1); + QCOMPARE(iconRecords[0], icon); + + QVERIFY(record.removeIcon(QByteArray())); + QVERIFY(!record.hasIcon()); + QCOMPARE(record.iconCount(), 0); + + QByteArray mimeType = "test/data"; + record.addIcon(mimeType, "icondata"); + QVERIFY(record.hasIcon()); + QVERIFY(record.hasIcon(mimeType)); + QVERIFY(!record.hasIcon(QByteArray("mime"))); + + QCOMPARE(record.iconCount(), 1); + QCOMPARE(record.icon(), QByteArray("icondata")); + QCOMPARE(record.icon(mimeType), QByteArray("icondata")); + + QNdefNfcIconRecord icon2; + icon2.setData("iconrecorddata"); + icon2.setType("test/icon"); + record.addIcon(icon2); + QVERIFY(record.hasIcon(QByteArray("test/icon"))); + + QCOMPARE(record.iconCount(), 2); + QCOMPARE(record.icon("test/icon"), QByteArray("iconrecorddata")); + + iconRecords = record.iconRecords(); + QCOMPARE(iconRecords.size(), 2); + + QNdefNfcIconRecord icon3; + icon3.setData("icondata"); + icon3.setType("test/data"); + + QCOMPARE(iconRecords[0], icon3); + QCOMPARE(iconRecords[1], icon2); + + QVERIFY(record.removeIcon(mimeType)); + QCOMPARE(record.iconCount(), 1); + iconRecords = record.iconRecords(); + QCOMPARE(iconRecords.size(), 1); + QCOMPARE(iconRecords[0], icon2); + + QList iconList; + + QNdefNfcIconRecord testIcon; + testIcon.setData("testicondata"); + testIcon.setType("test/data"); + + iconList << testIcon; + record.setIcons(iconList); + + QCOMPARE(record.iconCount(), 1); + iconRecords = record.iconRecords(); + QCOMPARE(iconRecords.size(), 1); + + QCOMPARE(iconRecords[0], testIcon); +} + +void tst_QNdefNfcSmartPosterRecord::tst_size() +{ + QNdefNfcSmartPosterRecord record; + + quint32 size = 1024; + record.setSize(size); + QCOMPARE(record.size(), size); + QVERIFY(record.hasSize()); + + size = 0; + record.setSize(size); + QCOMPARE(record.size(), size); + QVERIFY(record.hasSize()); +} + +void tst_QNdefNfcSmartPosterRecord::tst_typeInfo() +{ + QNdefNfcSmartPosterRecord record; + + QByteArray typeInfo("typeinfo"); + record.setTypeInfo(typeInfo); + QCOMPARE(record.typeInfo(), typeInfo); + QVERIFY(record.hasTypeInfo()); + + typeInfo = "moreinfo"; + record.setTypeInfo(typeInfo); + QCOMPARE(record.typeInfo(), typeInfo); + QVERIFY(record.hasTypeInfo()); +} + +void tst_QNdefNfcSmartPosterRecord::tst_construct() +{ + QByteArray data((char *)payload, sizeof(payload)); + QNdefMessage ndefMessage = QNdefMessage::fromByteArray(data); + QCOMPARE(ndefMessage.size(), 1); + QNdefRecord record = ndefMessage[0]; + + QVERIFY(record.isRecordType()); + + // Construct a SP record from a standard QNdefRecord + QNdefNfcSmartPosterRecord sprecord(record); + + QCOMPARE(sprecord.typeNameFormat(), record.typeNameFormat()); + QCOMPARE(sprecord.type(), record.type()); + QCOMPARE(sprecord.payload(), record.payload()); + + QVERIFY(sprecord.hasTitle("en")); + QCOMPARE(sprecord.title("en"), QString("Icon Title")); + + QCOMPARE(sprecord.titleCount(), 1); + QList titleRecords = sprecord.titleRecords(); + + QCOMPARE(titleRecords[0].text(), QString("Icon Title")); + QCOMPARE(titleRecords[0].locale(), QString("en")); + QCOMPARE(sprecord.uri(), QUrl("http://www.rim.com")); + + QVERIFY(sprecord.hasAction()); + QCOMPARE(sprecord.action(), QNdefNfcSmartPosterRecord::SaveAction); + + QByteArray mimeType = "image/png"; + QVERIFY(sprecord.hasIcon()); + QVERIFY(sprecord.hasIcon(mimeType)); + QCOMPARE(sprecord.iconCount(), 1); + + QList iconRecords = sprecord.iconRecords(); + QCOMPARE(iconRecords.size(), 1); + QCOMPARE(iconRecords[0].type(), mimeType); + QVERIFY(!iconRecords[0].data().isEmpty()); + QVERIFY(iconRecords.value(1).type().isEmpty()); + QVERIFY(iconRecords.value(1).data().isEmpty()); + + QVERIFY(sprecord.hasSize()); + quint32 size = 1024; + QCOMPARE(sprecord.size(), size); + + QVERIFY(sprecord.hasTypeInfo()); + QCOMPARE(sprecord.typeInfo(), QByteArray("text/html")); + + QVERIFY(record == sprecord); + QVERIFY(!(record != sprecord)); +} + +void tst_QNdefNfcSmartPosterRecord::tst_downcast() +{ + QByteArray data((char *)payload, sizeof(payload)); + QNdefMessage ndefMessage = QNdefMessage::fromByteArray(data); + QCOMPARE(ndefMessage.size(), 1); + QNdefRecord record = ndefMessage[0]; + + QVERIFY(record.isRecordType()); + + // Trying to downcast a QNdefRecord to a QNdefNfcSmartPosterRecord causes + // an exception because a QNdefRecord does not contain the shared private data. + // So first need to create a real QNdefNfcSmartPosterRecord and refer to it via its base + QNdefNfcSmartPosterRecord sprecord(record); + QNdefRecord *pRecord = (QNdefRecord *)&sprecord; + + QVERIFY(pRecord->isRecordType()); + + QCOMPARE(pRecord->typeNameFormat(), sprecord.typeNameFormat()); + QCOMPARE(pRecord->type(), sprecord.type()); + QCOMPARE(pRecord->payload(), sprecord.payload()); + + QCOMPARE(pRecord->typeNameFormat(), record.typeNameFormat()); + QCOMPARE(pRecord->type(), record.type()); + QCOMPARE(pRecord->payload(), record.payload()); + + // Add another title + QNdefNfcTextRecord esRecord = getTextRecord("es"); + QVERIFY(sprecord.addTitle(esRecord)); + + QCOMPARE(sprecord.titleCount(), 2); + { + QStringList locales; + locales << "en" << "es"; + checkLocale(sprecord, locales); + } + + // Now make sure the base and SP record's payloads are the same + QByteArray basePayload = pRecord->payload(); + QByteArray spPayload = sprecord.payload(); + + // Check length is longer on the base + QVERIFY(basePayload.length() > record.payload().length()); + + // Check the payloads are the same + QCOMPARE(basePayload, spPayload); +} + +QTEST_MAIN(tst_QNdefNfcSmartPosterRecord) + +#include "tst_qndefnfcsmartposterrecord.moc" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qndefrecord/tst_qndefrecord.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qndefrecord/tst_qndefrecord.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qndefrecord/tst_qndefrecord.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qndefrecord/tst_qndefrecord.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -44,9 +44,9 @@ #include #include #include -#include +#include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QNdefRecord::TypeNameFormat) @@ -99,9 +99,10 @@ QCOMPARE(record, QNdefRecord()); QVERIFY(!(record != QNdefRecord())); - QDeclarativeNdefRecord declRecord; + QQmlNdefRecord declRecord; QCOMPARE(declRecord.record(), record); - QCOMPARE(declRecord.recordType(), QString()); + QCOMPARE(declRecord.type(), QString()); + QCOMPARE(declRecord.typeNameFormat(), QQmlNdefRecord::Empty); } // test type name format @@ -255,9 +256,10 @@ QVERIFY(record != QNdefRecord()); - QDeclarativeNdefRecord declRecord(record); + QQmlNdefRecord declRecord(record); QCOMPARE(declRecord.record(), QNdefRecord(record)); - QCOMPARE(declRecord.recordType(), QString("urn:nfc:wkt:T")); + QCOMPARE(declRecord.type(), QString("T")); + QCOMPARE(declRecord.typeNameFormat(), QQmlNdefRecord::NfcRtd); } // test getters @@ -323,9 +325,10 @@ QVERIFY(record != QNdefRecord()); - QDeclarativeNdefRecord declRecord(record); + QQmlNdefRecord declRecord(record); QCOMPARE(declRecord.record(), QNdefRecord(record)); - QCOMPARE(declRecord.recordType(), QString("urn:nfc:wkt:U")); + QCOMPARE(declRecord.type(), QString("U")); + QCOMPARE(declRecord.typeNameFormat(), QQmlNdefRecord::NfcRtd); } // test getters @@ -360,27 +363,21 @@ void tst_QNdefRecord::tst_declarative_record_data() { QTest::addColumn("typeNameFormat"); - QTest::addColumn("typeNameFormatOut"); QTest::addColumn("type"); - QTest::addColumn("typeOut"); - QTest::addColumn("recordType"); - QTest::newRow("NfcRtd:U") << QNdefRecord::NfcRtd << QNdefRecord::NfcRtd << QByteArray("U") << QByteArray("U") << QString("urn:nfc:wkt:U"); - QTest::newRow("NfcRtd:T") << QNdefRecord::NfcRtd << QNdefRecord::NfcRtd << QByteArray("T") << QByteArray("T") << QString("urn:nfc:wkt:T"); - QTest::newRow("Empty:BLAH") << QNdefRecord::Empty << QNdefRecord::Empty << QByteArray("BLAH") << QByteArray("") << QString(""); - QTest::newRow("Empty") << QNdefRecord::Empty << QNdefRecord::Empty << QByteArray("") << QByteArray("") << QString(""); - QTest::newRow("Unknown") << QNdefRecord::Unknown << QNdefRecord::Empty << QByteArray("BLAHfoo") << QByteArray("") << QString(""); - QTest::newRow("Mime") << QNdefRecord::Mime << QNdefRecord::Mime << QByteArray("foobar") << QByteArray("foobar") << QString("urn:nfc:mime:foobar"); - QTest::newRow("ExternalRtd") << QNdefRecord::ExternalRtd << QNdefRecord::ExternalRtd << QByteArray("") << QByteArray("") << QString("urn:nfc:ext:"); + QTest::newRow("NfcRtd:U") << QNdefRecord::NfcRtd << QByteArray("U"); + QTest::newRow("NfcRtd:T") << QNdefRecord::NfcRtd << QByteArray("T"); + QTest::newRow("Empty:BLAH") << QNdefRecord::Empty << QByteArray("BLAH"); + QTest::newRow("Empty") << QNdefRecord::Empty << QByteArray(""); + QTest::newRow("Unknown") << QNdefRecord::Unknown << QByteArray("BLAHfoo"); + QTest::newRow("Mime") << QNdefRecord::Mime << QByteArray("foobar"); + QTest::newRow("ExternalRtd") << QNdefRecord::ExternalRtd << QByteArray(""); } void tst_QNdefRecord::tst_declarative_record() { QFETCH(QNdefRecord::TypeNameFormat, typeNameFormat); - QFETCH(QNdefRecord::TypeNameFormat, typeNameFormatOut); QFETCH(QByteArray, type); - QFETCH(QByteArray, typeOut); - QFETCH(QString, recordType); { QNdefRecord record; @@ -389,78 +386,98 @@ QCOMPARE(record.typeNameFormat(), typeNameFormat); QCOMPARE(record.type(), type); - QDeclarativeNdefRecord declRecord(record); + QQmlNdefRecord declRecord(record); QCOMPARE(declRecord.record(), record); QCOMPARE(declRecord.record().typeNameFormat(), typeNameFormat); QCOMPARE(declRecord.record().type(), type); - QCOMPARE(declRecord.recordType(), recordType); + QCOMPARE(declRecord.type(), QString(type)); + QCOMPARE(declRecord.typeNameFormat(), static_cast(typeNameFormat)); - QDeclarativeNdefRecord declRecord2; + QQmlNdefRecord declRecord2; declRecord2.setRecord(record); QCOMPARE(declRecord2.record(), record); QCOMPARE(declRecord2.record().typeNameFormat(), typeNameFormat); QCOMPARE(declRecord2.record().type(), type); - QCOMPARE(declRecord2.recordType(), recordType); + QCOMPARE(declRecord2.type(), QString(type)); + QCOMPARE(declRecord2.typeNameFormat(), static_cast(typeNameFormat)); - QDeclarativeNdefRecord declRecord3; - declRecord3.setRecordType(recordType); - QCOMPARE(declRecord3.recordType(), recordType); - QCOMPARE(declRecord3.record().typeNameFormat(), typeNameFormatOut); - QCOMPARE(declRecord3.record().type(), typeOut); + QQmlNdefRecord declRecord3; + declRecord3.setTypeNameFormat((QQmlNdefRecord::TypeNameFormat)typeNameFormat); + declRecord3.setType(type); + QCOMPARE(declRecord3.type(), QString(type)); + QCOMPARE(declRecord3.record().typeNameFormat(), typeNameFormat); + QCOMPARE(declRecord3.record().type(), type); + QCOMPARE(declRecord3.typeNameFormat(), static_cast(typeNameFormat)); } } void tst_QNdefRecord::tst_declarativeChangedSignals() { - QDeclarativeNdefRecord record; - QSignalSpy typeSpy(&record, SIGNAL(recordTypeChanged())); + QQmlNdefRecord record; + QSignalSpy typeSpy(&record, SIGNAL(typeChanged())); + QSignalSpy tnfSpy(&record, SIGNAL(typeNameFormatChanged())); QSignalSpy recordSpy(&record, SIGNAL(recordChanged())); QCOMPARE(typeSpy.count(), 0); QCOMPARE(recordSpy.count(), 0); - record.setRecordType("urn:nfc:wkt:U"); + record.setType("U"); + record.setTypeNameFormat(QQmlNdefRecord::NfcRtd); QCOMPARE(typeSpy.count(), 1); + QCOMPARE(tnfSpy.count(), 1); QCOMPARE(recordSpy.count(), 0); - QCOMPARE(record.recordType(), QString("urn:nfc:wkt:U")); + QCOMPARE(record.type(), QString("U")); QCOMPARE(record.record().type(), QByteArray("U")); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::NfcRtd); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::NfcRtd); - record.setRecordType("urn:nfc:wkt:U"); //same value, no signal + record.setType("U"); //same value, no signal QCOMPARE(typeSpy.count(), 1); + QCOMPARE(tnfSpy.count(), 1); QCOMPARE(recordSpy.count(), 0); - QCOMPARE(record.recordType(), QString("urn:nfc:wkt:U")); + QCOMPARE(record.type(), QString("U")); QCOMPARE(record.record().type(), QByteArray("U")); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::NfcRtd); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::NfcRtd); - record.setRecordType("urn:nfc:ext:blah"); - record.setRecordType("urn:nfc:ext:blah2"); + record.setType("blah"); + record.setType("blah2"); + record.setTypeNameFormat(QQmlNdefRecord::ExternalRtd); QCOMPARE(typeSpy.count(), 3); + QCOMPARE(tnfSpy.count(), 2); QCOMPARE(recordSpy.count(), 0); - QCOMPARE(record.recordType(), QString("urn:nfc:ext:blah2")); + QCOMPARE(record.type(), QString("blah2")); QCOMPARE(record.record().type(), QByteArray("blah2")); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::ExternalRtd); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::ExternalRtd); - record.setRecordType("Rubbish"); + record.setType("Rubbish"); QCOMPARE(typeSpy.count(), 4); + QCOMPARE(tnfSpy.count(), 2); QCOMPARE(recordSpy.count(), 0); - QCOMPARE(record.recordType(), QString("urn:nfc:ext:blah2")); - QCOMPARE(record.record().type(), QByteArray("blah2")); + QCOMPARE(record.type(), QString("Rubbish")); + QCOMPARE(record.record().type(), QByteArray("Rubbish")); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::ExternalRtd); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::ExternalRtd); - record.setRecordType("urn:nfc:mime:QQQQ"); + record.setType("QQQQ"); + record.setTypeNameFormat(QQmlNdefRecord::Mime); QCOMPARE(typeSpy.count(), 5); + QCOMPARE(tnfSpy.count(), 3); QCOMPARE(recordSpy.count(), 0); - QCOMPARE(record.recordType(), QString("urn:nfc:mime:QQQQ")); + QCOMPARE(record.type(), QString("QQQQ")); QCOMPARE(record.record().type(), QByteArray("QQQQ")); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::Mime); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::Mime); record.setRecord(QNdefRecord()); QCOMPARE(typeSpy.count(), 5); //setting record -> no recordChanged signal + QCOMPARE(tnfSpy.count(), 3); QCOMPARE(recordSpy.count(), 1); - QCOMPARE(record.recordType(), QString("")); + QCOMPARE(record.type(), QString("")); QCOMPARE(record.record().type(), QByteArray()); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::Empty); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::Empty); } QTEST_MAIN(tst_QNdefRecord) diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qnearfieldmanager/tst_qnearfieldmanager.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qnearfieldmanager/tst_qnearfieldmanager.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qnearfieldmanager/tst_qnearfieldmanager.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qnearfieldmanager/tst_qnearfieldmanager.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include #include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QNearFieldTarget*) Q_DECLARE_METATYPE(QNearFieldTarget::Type) @@ -97,17 +97,15 @@ void tst_QNearFieldManager::targetDetected_data() { - QTest::addColumn("type"); QTest::addColumn("deleteTarget"); - QTest::newRow("AnyTarget") << QNearFieldTarget::AnyTarget << false; - QTest::newRow("NfcTagType1") << QNearFieldTarget::NfcTagType1 << false; - QTest::newRow("Delete Target") << QNearFieldTarget::AnyTarget << true; + QTest::newRow("AnyTarget") << false; + QTest::newRow("NfcTagType1") << false; + QTest::newRow("Delete Target") << true; } void tst_QNearFieldManager::targetDetected() { - QFETCH(QNearFieldTarget::Type, type); QFETCH(bool, deleteTarget); QNearFieldManagerPrivateImpl *emulatorBackend = new QNearFieldManagerPrivateImpl; @@ -116,7 +114,7 @@ QSignalSpy targetDetectedSpy(&manager, SIGNAL(targetDetected(QNearFieldTarget*))); QSignalSpy targetLostSpy(&manager, SIGNAL(targetLost(QNearFieldTarget*))); - manager.startTargetDetection(type); + manager.startTargetDetection(); QTRY_VERIFY(!targetDetectedSpy.isEmpty()); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -47,7 +47,7 @@ #include #include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QNearFieldTarget*) @@ -104,7 +104,7 @@ { QSignalSpy targetDetectedSpy(manager, SIGNAL(targetDetected(QNearFieldTarget*))); - manager->startTargetDetection(QNearFieldTarget::NfcTagType1); + manager->startTargetDetection(); QTRY_VERIFY(!targetDetectedSpy.isEmpty()); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qnearfieldtagtype2/tst_qnearfieldtagtype2.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qnearfieldtagtype2/tst_qnearfieldtagtype2.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qnearfieldtagtype2/tst_qnearfieldtagtype2.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qnearfieldtagtype2/tst_qnearfieldtagtype2.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -47,7 +47,7 @@ #include #include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QNearFieldTarget*) @@ -106,7 +106,7 @@ { QSignalSpy targetDetectedSpy(manager, SIGNAL(targetDetected(QNearFieldTarget*))); - manager->startTargetDetection(QNearFieldTarget::NfcTagType2); + manager->startTargetDetection(); QTRY_VERIFY(!targetDetectedSpy.isEmpty()); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qrfcommserver/rfcommclient/rfcommclient.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qrfcommserver/rfcommclient/rfcommclient.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qrfcommserver/rfcommclient/rfcommclient.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qrfcommserver/rfcommclient/rfcommclient.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -106,7 +106,7 @@ // Connect to service if (state == listening) state = pendingConnections; - socket = new QBluetoothSocket(QBluetoothSocket::RfcommSocket); + socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol); qDebug() << "Create socket"; socket->connectToService(remoteService); qDebug() << "ConnecttoService done"; diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qrfcommserver/rfcommclient/rfcommclient.h qtconnectivity-opensource-src-5.2.1/tests/auto/qrfcommserver/rfcommclient/rfcommclient.h --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qrfcommserver/rfcommclient/rfcommclient.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qrfcommserver/rfcommclient/rfcommclient.h 2014-02-01 20:38:03.000000000 +0000 @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include static const QLatin1String serviceUuid("e8e10f95-1a70-4b27-9ccf-02010264e9c9"); diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qrfcommserver/rfcommclient/rfcommclient.pro qtconnectivity-opensource-src-5.2.1/tests/auto/qrfcommserver/rfcommclient/rfcommclient.pro --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qrfcommserver/rfcommclient/rfcommclient.pro 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qrfcommserver/rfcommclient/rfcommclient.pro 2014-02-01 20:38:03.000000000 +0000 @@ -2,5 +2,5 @@ SOURCES += main.cpp rfcommclient.cpp HEADERS += rfcommclient.h -QT = core +QT = core bluetooth DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qrfcommserver/tst_qrfcommserver.cpp qtconnectivity-opensource-src-5.2.1/tests/auto/qrfcommserver/tst_qrfcommserver.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/auto/qrfcommserver/tst_qrfcommserver.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/auto/qrfcommserver/tst_qrfcommserver.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -43,11 +43,11 @@ #include -#include +#include #include #include -QT_USE_NAMESPACE_BLUETOOTH +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QBluetooth::SecurityFlags); @@ -78,6 +78,8 @@ void tst_receive_data(); void tst_receive(); + void tst_error(); + private: QBluetoothLocalDevice localDevice; }; @@ -118,7 +120,7 @@ void tst_QRfcommServer::tst_construction() { { - QRfcommServer server; + QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol); QVERIFY(!server.isListening()); QCOMPARE(server.maxPendingConnections(), 1); @@ -146,7 +148,7 @@ QFETCH(quint16, port); { - QRfcommServer server; + QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol); qDebug() << "tst_listen() address=" << address.toString() << "port=" << port; bool result = server.listen(address, port); QTest::qWait(1000); @@ -193,7 +195,7 @@ { QFETCH(int, maxConnections); - QRfcommServer server; + QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol); QBluetoothLocalDevice localDev; QBluetoothAddress address = localDev.address(); @@ -258,7 +260,7 @@ { QFETCH(QByteArray, expected); - QRfcommServer server; + QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol); QBluetoothLocalDevice localDev; QBluetoothAddress address = localDev.address(); @@ -302,7 +304,7 @@ void tst_QRfcommServer::tst_secureFlags() { - QRfcommServer server; + QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol); server.setSecurityFlags(QBluetooth::NoSecurity); QCOMPARE(server.securityFlags(), QBluetooth::NoSecurity); @@ -311,6 +313,21 @@ QCOMPARE(server.securityFlags(), QBluetooth::Encryption); } + +void tst_QRfcommServer::tst_error() +{ + QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol); + QSignalSpy errorSpy(&server, SIGNAL(error(QBluetoothServer::Error))); + QCOMPARE(errorSpy.count(), 0); + const QBluetoothServer::Error e = server.error(); + + QVERIFY(e != QBluetoothServer::UnknownError + && e != QBluetoothServer::PoweredOffError + && e != QBluetoothServer::InputOutputError + && e != QBluetoothServer::ServiceAlreadyRegisteredError + && e != QBluetoothServer::UnsupportedProtocolError); +} + QTEST_MAIN(tst_QRfcommServer) #include "tst_qrfcommserver.moc" diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/nfctestserver/servercontroller.h qtconnectivity-opensource-src-5.2.1/tests/nfctestserver/servercontroller.h --- qtconnectivity-opensource-src-5.0~git20130802/tests/nfctestserver/servercontroller.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/nfctestserver/servercontroller.h 2014-02-01 20:38:03.000000000 +0000 @@ -44,9 +44,9 @@ #include -#include +#include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE class ServerController : public QObject { diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/nfctestserver/socketcontroller.cpp qtconnectivity-opensource-src-5.2.1/tests/nfctestserver/socketcontroller.cpp --- qtconnectivity-opensource-src-5.0~git20130802/tests/nfctestserver/socketcontroller.cpp 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/nfctestserver/socketcontroller.cpp 2014-02-01 20:38:03.000000000 +0000 @@ -81,7 +81,7 @@ this, SLOT(targetDetected(QNearFieldTarget*))); connect(m_manager, SIGNAL(targetLost(QNearFieldTarget*)), this, SLOT(targetLost(QNearFieldTarget*))); - m_manager->startTargetDetection(QNearFieldTarget::NfcForumDevice); + m_manager->startTargetDetection(); } break; default: diff -Nru qtconnectivity-opensource-src-5.0~git20130802/tests/nfctestserver/socketcontroller.h qtconnectivity-opensource-src-5.2.1/tests/nfctestserver/socketcontroller.h --- qtconnectivity-opensource-src-5.0~git20130802/tests/nfctestserver/socketcontroller.h 2013-08-01 13:13:04.000000000 +0000 +++ qtconnectivity-opensource-src-5.2.1/tests/nfctestserver/socketcontroller.h 2014-02-01 20:38:03.000000000 +0000 @@ -45,9 +45,9 @@ #include #include -#include +#include -QT_USE_NAMESPACE_NFC +QT_USE_NAMESPACE class SocketController : public QObject {