summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothsocket.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix compilation with gcc 4.8Ville Voutilainen2018-12-031-1/+0
| | | | | | | GCC 4.8 doesn't like duplicate friend declarations. Change-Id: I2ec48ca7415b9fd7fe1c24f390519833b7d1f0aa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Ensure that QBluetoothServer works with new DBus based socketsAlex Blasche2018-08-161-0/+7
| | | | | | | | | | | | | | | | | | | or better ensure that the DBus based socket is not used for QBluetoothServer. The server implementation will continue to use the raw socket implementation for the foreseeable future. The reason being the DBus version not yet working. convertAddress() in the server cpp was removed because it was a duplicate implementation. Including qbluetoothsocket_bluez_p.h pulls in the qbluetoothsocketbase_p.h which provides the official convertAddress() implementations. Unfortunately this requires a new ctor for QBluetoothSocket which is only specified for BlueZ builds. It is used to permit QBluetoothServer to set the correct dptr for QBluetoothSocket. Task-number: QTBUG-68550 Change-Id: I19298f75e9bc2ab93322d9f34e1816ad733ac6d9 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Rename the final interface for the QBluetoothSocketPrivate dummyAlex Blasche2018-07-251-0/+1
| | | | | | | | | | At the same time we reshuffle the inclusion of qbluetoothsocket_p.h in bluetooth.pro based on usage pattern. Task-number: QTBUG-68550 Change-Id: I3ae3f61c65e71a57d238f5c67289720ff63a1b0f Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Add QBluetoothSocketPrivate interface for WinRTAlex Blasche2018-07-251-0/+1
| | | | | | Task-number: QTBUG-68550 Change-Id: I14fe43fcbbbdd6950f05feda900643f6899daa24 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Add QBluetoothSocketPrivate interface for AndroidAlex Blasche2018-07-251-0/+1
| | | | | | | Task-number: QTBUG-68550 Change-Id: Iac05cccd4f6e1b44a30568fb9b6c9171204b53fd Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Add separate interfaces for QBluetoothSocketPrivate on LinuxAlex Blasche2018-07-251-0/+2
| | | | | | | | | | | | | | | | Uses the new QBluetoothSocketBasePrivate interface to separate the Linux implementations from other platforms. On Linux, there will be the existing raw socket implementation and a BlueZ5 DBus implementation. The DBus implementation is required for very recent Bluez5 deployments (v5.4x+) which restrict access to traditional SDP discovery means like sdptool. For now the DBus implementation is non-existing/dysfunctional. Task-number: QTBUG-68550 Change-Id: Idd248ecdb2a443a95cde521ced929218d40df3fe Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Add runtime polymorphism for QBluetoothSocketPrivateAlex Blasche2018-07-251-0/+14
| | | | | | | | | | | | | | | | | | | | | | This patch introduces a generic interface towards QBluetoothSocketPrivate. Later on, the QBluetoothSocketPrivate class will be split into platform specific overloads/interfaces. Ultimately, this will be needed to support runtime selection of the QBluetootSocket d-pointer on Linux. The Linux Bluez5 implementation is significantly different from the Bluez4 (raw socket) implementation. Since recent Bluez5 releases the raw socket implementation is no longer functional and/or the user has to have root permission and enable bluetooth --compat mode. Therefore a second QBluetoothSocket for the dbus socket API is needed. QBLuetoothSocket has to choose at runtime (during its instanciation) which implementation to use. Task-number: QTBUG-68550 Change-Id: I5d0b8e24b8acd1b149b897f52f0d82eade7f3823 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com>
* Fix shadow warningAlex Blasche2018-03-211-2/+2
| | | | | | | | | qbluetoothsocket.h: In member function 'void QBluetoothSocket::connectToService( const QBluetoothAddress&, QBluetoothUuid::ServiceClassUuid, QIODevice::OpenMode)': qbluetoothsocket.h:111:5: error: declaration of 'openMode' shadows a member of 'this' [-Werror=shadow] Change-Id: Ib9478027799b287430721d99bebee4002a1e5896 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Avoid wrong implicit cast leading to wrong connectToService() callAlex Blasche2018-01-251-0/+5
| | | | | | | | | | | | | | | | Prior to this change passing a QBluetoothUuid::ServiceClassUuid to connectToService() caused the port overload to be called rather than the QBluetoothUuid version. This patch introduces a ServiceClassUuid overload that avoids relying on implicit type conversion. There is a remote chance that this patch breaks existing code if the remote port was in the same range as the ServiceClassUuid range. In general the Bluetooth ports are below 100 though. Task-number: QTBUG-65831 Change-Id: I6574291ae6fee284466d84ecb91f21e3be89f6b2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Provide own header for QLowEnergyControllerPrivate instance on BluezAlex Blasche2017-11-031-1/+1
| | | | | | | | | | | This utilizes the new QLowEnergyController interface and separates the existing Bluez implementation more clearly from other platforms. The existing addServiceHelper() class is moved out into the individual backends to avoid compiling the class into the new dbus backend. Change-Id: I1eea99e493958c61cb1fae830c08a3eb26bda9c3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Rename various QLEControllerPrivate classesAlex Blasche2017-11-031-1/+1
| | | | | | | | | | | | | | | | | The base class is renamed to QLEControllerPrivate and the existing QLEControllerPrivate becomes QLEControllerPrivateCommon. This is necessary to re-enable Q_DECLARE_PRIVATE. The macro uses by convention the "Private" class prefix which is currently broken because not every implementation uses QLEControllerPrivate as d-pointer type. This also avoids a SC/BC break in qlowenergycontroller.h as the d-pointer remains the same and the functions declared via Q_DECLARE_PRIVATE still return the same type. Change-Id: I84890b06280b2c473a4d370606d3bbc58a258eea Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Replace Q_NULLPTR with nullptrKevin Funk2017-09-291-2/+2
| | | | | Change-Id: Ica194c2568465a94d851ddeaf62ca71b33fe4464 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rename qbluetoothglobal.h to qtbluetoothglobal.hOliver Wolff2017-08-301-1/+1
| | | | | | | | | | | | | ... and deprecate the former. By doing so we get the header file in line with other modules - see qtnetworkglobal.h for example. The include is not used in the examples so it is removed there. Change-Id: Ie6267738d4a45e45a0350d458a40654d8a952f4a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add error flag for use case when the remote peer closes the connectionAlex Blasche2017-07-101-0/+1
| | | | | | | | | | [ChangeLog][QtBluetooth][QBluetoothSocket] Added QBluetoothSocket::RemoteHostClosedError. Change-Id: Ic9d27f9188f66be0fad309e55f2904eaed2cf61a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-211-2/+2
|\ | | | | | | | | | | | | Conflicts: src/bluetooth/qlowenergycontroller.h Change-Id: I15571e47fbf06545d46d1b9a9b2b47bf815ae293
| * Add explicit and make public headers compile with ↵Marc Mutz2016-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Wzero-as-null-pointer-constant ... or equivalent. QtBase 5.6 headers already compile that way, so let the other modules follow suit. Added explicit where it was missing. This is not a source- incompatible change, because code that breaks by this is a bug. Let's not have this sitting around in an LTS. Task-number: QTBUG-45291 Change-Id: I375361699615d0fc874e0b96a84543e233eff5f0 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Updated license headersAntti Kokko2016-01-201-14/+20
|/ | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I856c13e2a6d4d12c46e1286b0ca1c092ee4608f8 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add preferredSecurityFlags to QBluetoothSocketAlex Blasche2015-07-031-5/+9
| | | | | | | | | This permits the API user to determine the security parameters for the connect attempt to the remote SPP service. Task-number: QTBUG-46377 Change-Id: I1ed5ea0f5a32aa08dcedc46a34b0377654e420b2 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Port from Q_ENUMS to new macro Q_ENUMKonstantin Ritt2015-06-231-3/+2
| | | | | | | | | | | Remove Q_ENUMS in favor of the new Q_ENUM macro which provides registration as meta enum and a debug stream operator. Register some enums via Q_ENUM to improve debug output and types auto-registration. Change-Id: I31c9535a2de7da1783b4ec967612c02a57cb62ff Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/devFrederik Gladhorn2015-02-161-1/+1
|\
| * Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-161-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothdeviceinfo.h Change-Id: I2ad566b9ca8fb001fa91a74501e83e8a2121ef3a
| | * Add the QtCore/ library prefix in public headersSergio Ahumada2015-02-121-1/+1
| | | | | | | | | | | | | | | Change-Id: I01f01575a03d95f558b1f1994e0c76b22b3c19e0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | Update copyright headersJani Heikkinen2015-02-161-7/+7
|/ / | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I3822a6484e8f7a420330de1cb1aeb0c3d1cf41b7 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | Convert qRegisterMetaType<T>(const char*) to qRegisterMetaType<T>()Alex Blasche2015-01-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is much safer and cleaner. [ChangeLog][QtBluetooth][Important Behavior Changes] Q_DECLARE_METATYPE added for QBluetoothServiceDiscoveryAgent::Error, QBluetoothSocket::SocketState, QBluetoothSocket::SocketError and QBluetoothDeviceInfo. This breaks source compatibility if application code has defined the above metatypes already. The applications Q_DECLARE_METATYPE must be removed to fix the compile error. Change-Id: I1c7cb1ee25832b7e5337c9aca6f36b21e8caf22e Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Port QBluetoothSocket to OS X.Timur Pocheptsov2014-09-261-1/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement QBluetoothSocket using IOBluetooth framework on OS X (will implement Qt's API as close as possible with a given Apple's API). Update 0: add (empty for now) delegate classes (L2CAP/RFCOMM). Update 1: add service discovery (called doDeviceDiscovery though). Update 2: implement the public class' logic (QBluetoothSocket, connectToService). Update 3: more public logic implemented (since it's easy :) ) Update 4: L2CAP delegate - initial logic. Update 5: connectToService - L2CAP "socket". Update 6: fix pivate header files. Update 7: fix dependency after the previous patch was merged. Update 8: writeData - initial version for L2CAP. Update 9: since RFCOM/L2CAP delegates have the same interface, no need in duplicating the same class - add a "generic" ChannelDelegate instead. Update 10: more RFCOMM logic. Update 11: function to build a service description from QBluetoothServiceInfo (to be registered on SDP server). Update 12: QBluetoothSocket::close/abort. Update 13: Create a dictioinary out of QBluetoothServiceInfo to register a service. Update 14: Add service registration. Update 15: Convert attributes (sequences and 'scalars') from QBluetoothServiceInfor into NSDictionary. Update 16: Update QBluetoothServiceInfo with a real PSM/ChannelID after a service was registered. Update 17: Move a private class (bluetooth socket) into the separate private header file (to make it visible for bluetooth_server_osx) Update 18: Add an interface to create a bluetooth socket (private class) from a channel, reported by a notification (found by a listening server). Update 19: Fix an invalid assert - any state (Inactive/ServiceDiscovery/DeviceDiscovery) is possible, not only Inactive. Implement the missing 'readData' and 'writeData' for RFCOMM. Set SDP query as non-active after query finished. Temporary (!) workaround - can not invokeMethod on a private socket (d_ptr). Update 20: When creating a socket wrapper from an incoming notification/channel, set: socket type + channel's delegate. Change-Id: Idd6d5478597206ed759f49e282baed948d105ddf Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Make QBluetoothSocket's _q_writeNotify & _q_readNotify privateAlex Blasche2014-08-251-2/+0
| | | | | | | | | These two functions are really only needed by Linux style socket code. There is no need for other platforms to implement them as dummy too. It simplifies the code somewhat. Change-Id: I3e0aced8d9f7b590d1c6aaa60f97bd060ee8f4b4 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
* Update license headers and add new licensesJani Heikkinen2014-08-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I7a8b8b787fcae9a178794364efdefe1021d10b1b Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Rename QLowEnergyControllerNew -> QLowEnergyControllerAlex Blasche2014-07-231-1/+1
| | | | | | | | Moves the new API into its place and completes the removal of the old API. Change-Id: I10a285e24e288aeb747cb1606574e27a4bf57308 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Merge branch 'dev' into btleAlex Blasche2014-07-031-0/+1
|\ | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp Change-Id: Ib960b9e8d8800af84d2094bdf26c2652d4c81dba
| * Add a few Qt 6 TODO entriesAlex Blasche2014-05-151-0/+1
| | | | | | | | | | Change-Id: Ic169d907b872fd277df4f32be1270d7bceabac32 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | Connect to BTLE deviceAlex Blasche2014-06-161-0/+1
|/ | | | | | Change-Id: Iaae61b6a872124d17855d80d106f2b10996501de Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Port QtBluetooth to AndroidAlex Blasche2014-02-131-5/+7
| | | | | | | | | | | | | | | | | | | | | | This is a feature merge to dev targeting Qt 5.3. Known issues: -QTBUG-36754: QBluetoothServer::close() crashes -QTBUG-36763: QBluetothTransferManager port to Android not possible -QTBUG-36764: Improve QBluetoothLocalDevice::connectedDevices() -QTBUG-36810: Remove direct use of Android action strings The above issues and some other minor TODO's will be addressed until final release time. Task-number: QTBUG-33792 [ChangeLog][QtBluetooth][Android] QtBluetooth has been ported to Android. Change-Id: I31ba83e3b7d6aa68e7258b7e43235de7d1a6e68a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* whitespace fixesOswald Buddenhagen2014-01-201-1/+1
| | | | | | | remove trailing whitespace, expand tab Change-Id: I3361c6c431231c7463bb1dc9b53268935b22a72b Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Error handling for QBluetoothServerFabian Bumberger2013-09-201-2/+0
| | | | | | Task-number: QTBUG-32669 Change-Id: I0f12b19f7989972b7c8305f6e11a95f7f25a281d Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Unify QBluetoothSoket, QBluetoothServer and QBluetoothServiceInfo protocol enumFabian Bumberger2013-09-201-9/+5
| | | | | Change-Id: I6e66196a599e2cceabc7d93d728ba97361d8999f Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* QNX: Take socketType and serverType into accountFabian Bumberger2013-09-191-1/+2
| | | | | | | Also add a serverType member function in QBluetoothServer Change-Id: I107f73b3943dc84f5c4d2afcb00e303567a67b5d Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Remove QtBluetooth and QtNfc namespace.Alex Blasche2013-09-091-2/+2
| | | | | | | | This is based on namespace discussions on the Qt project dev mailing list. We continue to use the Qt namespace. Change-Id: I6119d06662f7682c11f42d759f3218be1f5a7d6c Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Merge QRfcommServer and QL2capServer to QBluetoothServerFabian Bumberger2013-08-291-4/+2
| | | | | | | Task-number: QTBUG-32722 Change-Id: Ia75ad5af2f81b737a8cca09dba919a7dc0fa0f8a Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Update Copyright headersAlex Blasche2013-06-251-1/+1
| | | | | | | | | - Update Digia's copyright year - Add copyright to files without it - Convert old BSD to new LGPL license for auto test code Change-Id: I47f5c871c436f9c2731b235026434448719cc671 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix qmake warnings about incorrect header includes in public headers.Alex Blasche2013-06-211-3/+3
| | | | | Change-Id: I4b6ff895a021665b18b007c8bd8a7059cbba3ab1 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
* Rename NFC and Bluetooth namespace macros.Aaron McCarthy2013-02-141-2/+2
| | | | | | | | Renamed to the namespace macros to follow what syncqt expects. This fixes missing namespace macro warnings printed by syncqt. Change-Id: I7be5a700e8435a559cb4c2e74938851233095887 Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
* Remove use of QT_{BEGIN,END}_HEADER macros.Aaron McCarthy2013-02-031-4/+0
| | | | | | | | These macros were removed from Qt Core and they are no longer defined causing qtconnectivity to fail to build. Change-Id: I7971cca9d51e7eb1e395e348efb471982e355527 Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I4f07028d0bf0b3ba4c4649897b80687ea5e51abc Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* No more Bluetooth on Symbianalex2012-02-081-3/+0
| | | | | | | | This change cleans the code base significantly. Change-Id: I668d05d72cf5aa896818139e2daba51909c0b9dd Reviewed-by: Michael Zanetti <michael.zanetti@nokia.com> Reviewed-by: Alex <alex.blasche@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I84f8c423bd7748bbae495fedae696990414cee83 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-201-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I1c6ba5c87f0eca30b6f01f4245a032262d30f8ce Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | | Change-Id: I76920b22a5b386a0f85ec28076da20505c022b6f Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QtConnectivity: Fix compilation on Windows.Friedemann Kleint2011-11-301-2/+2
| | | | | | | | | | - Fix imports - Fix includes - Remove trailing comma from enumerations (error in clang) Change-Id: I9627fe613e59accffc788def9e44a068ed02109f Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Alex <alex.blasche@nokia.com>
* added Connectivity namespaces (QtBluetooth and QtNfc)Michael Zanetti2011-11-111-1/+5
| | | | | | Change-Id: I5f3062c857e657a6d05ab29edfa2f1b48cb173f8 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Alex <alex.blasche@nokia.com>
* Split qconnectivityglobal.hMichael Zanetti2011-09-151-4/+4
| | | | | | | | | Split qconnectivityflobal into qbluetoothglobal.h and qnfcglobal.h like the other qt5 modules have it Change-Id: I16cfdd84411ac6da200872b3023c1c98778bb022 Reviewed-on: http://codereview.qt-project.org/4686 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Alex <alex.blasche@nokia.com>