Commit Graph

40 Commits

Author SHA1 Message Date
Alex Blasche 413d98ef93 Improve QBluetoothSocket::close() documentation
The disconnected() and stateChanged() signals are delayed which
may easily overlooked by API users. This change specifically points out
this behavior difference.

Change-Id: I3a9e9c656da50c9efe455cd2dbf903a2849e36da
Task-number: QTBUG-41770
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2014-10-10 11:39:02 +02:00
Alex Blasche 5a6e5dc44b Don't permit write of non-existing or empty data via socket
Change-Id: Ic8387dd411a9784b6163a15d423cdeaa5e63ea30
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-09-26 15:16:36 +02:00
Alex Blasche 4882d6997e Add \since to all Qt Bluetooth classes which didn't have the tag yet
Change-Id: I50d818294cb53962bca2b08edbfdc4558890777c
Task-number: QTBUG-36775
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-09-26 11:06:36 +02:00
Frederik Gladhorn 8146a18be0 Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts:
	src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp

Change-Id: Ie8bf1903f9c7c1ccd5b05a3f97049ae0882b88b8
2014-08-28 16:22:31 +02:00
Alex Blasche 167faeec86 Fix L2CP socket connections
L2CP's psm (the RFCOMM port equivalent) was never published via SDP.
Therefore the service client could not get the required information
to connect to the server. After this patch Qt properly publishes
the psm.

Also, QBluetoothSocket::connect() initiated a service
discovery to obtain the missing psm. Since the published SDP
entry didn't contain one, protocolServiceMultiplexer() always returned
0 and another service discovery was initiated. This caused a crash
inside QBluetoothSocket because the 1st QBluetoothServiceDiscoveryAgent
instance was deleted in favor of the 2nd.

The patch changes the client behavior such that it doesn't crash
if the service discovery didn't turn up a valid psm/port.
It improves the robustness in case of an error and avoids
a second service discovery (which wouldn't turn up more information
anyway).

The bug only affected Bluez as it is the only platform supporting
pure L2CP sockets.

Last but not least a capability to test L2CP sockets was added to
bttestui.

Change-Id: I46c88a67c2baa4782ea908e645dcd4db9422dbba
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-08-27 16:54:57 +02:00
Jani Heikkinen ac0b7ac671 Update license headers and add new licenses
- 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>
2014-08-24 17:23:37 +02:00
Oleg Shparber 99a53598a9 Refactor disconnection signals emittance in QBluetoothSocket
This fixes duplicate switching to the unconnected state in case
the disconnect() signal is used to reconnect.

[ChangeLog][QtBluetooth][QBluetoothSocket] Fixed duplicate emission
of unconnected state in the reconnection case.

Change-Id: If449420d936c96e62518fc408e6a1e35b79988a8
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-04-15 17:31:38 +02:00
Alex Blasche f58cddd97a Remove QBluetoothSocketPrivate::socketDescriptor()
The function is not required as the public accessor function directly
returns the socket descriptor.

Change-Id: I6d64bec7b4f0542ce213dc90dcfe30c3885ed21d
Reviewed-by: Nedim Hadzic <nedimhadzija@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-02-26 17:31:15 +01:00
Alex Blasche ebb35fd588 Don't refuse the connect attempt while in ServiceLookupState.
QBluetoothSocket::connectToService can be called by itself when it
does an SDP discovery. This affects Bluez only but the bug was introduced
by the Android port.

Change-Id: I1c9b0504acaafc7dbf2fc3d94b0c2c20a0cb8c65
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-02-20 16:42:54 +01:00
Alex Blasche bcc26fb35c Merge remote-tracking branch 'gerrit/stable' into dev
Conflicts:
	src/bluetooth/qbluetoothserver.cpp
	src/bluetooth/qbluetoothserver.h

Change-Id: Ia99c341ab6b4fb30d9ceb9e4516c7083eed1c547
2014-02-14 16:07:58 +01:00
Alex Blasche 9902dfdbc4 Fix missing QBluetoothSocket::state update after unsuccessful SDP search
When connectToService() triggers an SDP discovery the search may
fail. At the beginning of the discovery the socket state was set to
ServiceLookupState. This patch ensures that the socket state resets to
Unconnected if the SDP discovery failed.

Currently only Bluez uses this discovery mechanism and therefore is the
only affected platform.

Change-Id: I982dafc1f5466071bbf910ed3cf7cf7abda14fe4
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-02-13 16:26:19 +01:00
Alex Blasche 173d16efb5 Port QtBluetooth to Android
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>
2014-02-13 09:47:27 +01:00
Alex Blasche 039982cfa4 Synchronize setting of QBluetoothSocket's error string, code and signal
This fixes a few cases where errorString, error signal and error code
where out of sync because one was set but not the other. This was
addressed by unifying the usage pattern for error activation to a
pattern where errorString is set and setSocketError() is called
afterwards.

Change-Id: Ibfb04772cf560936aa4ce8ea9643d6a410cc9ee2
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-01-30 14:22:56 +01:00
Alex Blasche d85171d34a Refine documentation for QBluetoothSocket::localXYZ() functions.
Bluez never returns anything until the connection has been established.
BlackBerry and the future Android port are much quicker.

Change-Id: Ic465a9b68176e7fff5f0c88b4fb602f8665f7197
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-01-28 20:46:45 +01:00
Alex Blasche 7644b7184a Fix broken SDP discovery on QBluetoothSocket
ThHis is only used on Bluez at this stage. THe SDP agent was initialized
with the local adapter being the remote address of the remote service.
This could never work. The remote address is now properly set (being the
handed over bt address to QBluetoothSocket::connectToService()).

[ChangeLog][QtBluetooth][QtBluetoothSocket] Fixed incorrect
invocation of QBluetoothDiscoveryAgent where the remote service address
was incorrectly assumed to be the local Bt adapter address. This prevented
the detection of the remote service. This bug only affects the Bluez
backend.

Change-Id: Ice2b9c351bfd42f1f4398b14ac68f76315f01fa8
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-01-28 07:12:40 +01:00
Alex Blasche 94f862e278 Use QLoggingCategory to categorize the various debug output streams
Task-number: QTBUG-32253
Change-Id: I193162407d0fc7eca83689e31f03e1641a494ab0
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-12-20 09:06:10 +01:00
Alex Blasche 85eac47703 Emit ServiceLookup signal in QBluetoothSocket/Bluez when required.
Change-Id: Ide9d2cf7fd469e28c584c557ad9e1307aec37f1d
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-09-25 10:37:10 +02:00
Fabian Bumberger c231e60cd3 Error handling for QBluetoothServer
Task-number: QTBUG-32669
Change-Id: I0f12b19f7989972b7c8305f6e11a95f7f25a281d
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-09-20 17:47:15 +02:00
Fabian Bumberger 559c648e41 QNX: Fix compilation and a compiler warning
Change-Id: Id3de289238013edfc9737f444d3db95be3bd761b
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-09-20 13:36:35 +02:00
Fabian Bumberger ec83763323 Unify QBluetoothSoket, QBluetoothServer and QBluetoothServiceInfo protocol enum
Change-Id: I6e66196a599e2cceabc7d93d728ba97361d8999f
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-09-20 10:09:12 +02:00
Fabian Bumberger 25222f75d0 QNX: Take socketType and serverType into account
Also add a serverType member function in QBluetoothServer

Change-Id: I107f73b3943dc84f5c4d2afcb00e303567a67b5d
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-09-19 15:27:20 +02:00
Fabian Bumberger 9fa7195f0f Lower the verbosity of bluetooth
Remove some qDebug statements and change qDebugs to qWarning in case of an error.

Task-number: QTBUG-32253

Change-Id: Ia647d3f485cae56cc9f9c6725400f5b4617b7bf7
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-09-18 17:24:33 +02:00
Fabian Bumberger 4810f41772 BlackBerry: Add some platform documentation
Change-Id: If2a8d289578f3bc7622cedd9faf35893880a2157
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-09-18 17:24:25 +02:00
Alex Blasche e21b666856 Remove QtBluetooth and QtNfc namespace.
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>
2013-09-09 12:44:29 +02:00
Fabian Bumberger d8d903826d Merge QRfcommServer and QL2capServer to QBluetoothServer
Task-number: QTBUG-32722

Change-Id: Ia75ad5af2f81b737a8cca09dba919a7dc0fa0f8a
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-08-29 14:06:54 +02:00
Fabian Bumberger c79bfde122 QNX: Change name of platform define to QT_QNX_BLUETOOTH
To be aligned with the bluez implementation

Change-Id: I8d3fbd0c23298f984e2c99cbf4131cf8fc0a0a64
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-08-23 15:41:19 +02:00
Fabian Bumberger 7b1622fc3f QNX: Fix compiler warnings
Change-Id: Ia73b3a89464d5913bec4cc528047283475297083
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-07-31 16:33:23 +02:00
Alex Blasche 8dad4698d9 Update Copyright headers
- 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>
2013-06-25 10:08:54 +02:00
Aaron McCarthy 1002efbb0c Rename NFC and Bluetooth namespace macros.
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>
2013-02-14 13:26:02 +01:00
Fabian Bumberger 15507c6b3d QNX: Adding SPP support
This commit adds the SPP server and socket to the QNX Bluetooth port

Change-Id: I0868f4cbc32fc84f0688eafdd2c3350dc8506b65
Reviewed-by: Alex <ablasche@gmail.com>
2012-11-23 09:40:15 +01:00
Jerome Pasion 3f4a920f87 Qt Bluetooth: Created \qmlmodule and \module pages
These pages will list the C++ classes and the QML types in Qt Bluetooth.
Removed extra groups.

Change-Id: I27d7004d804cc0cc29af997f3a11fcc9f9477efb
Reviewed-by: Alex <ablasche@gmail.com>
2012-09-29 12:27:10 +02:00
Iikka Eklund 0521eb5e1b Change copyrights from Nokia to Digia
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>
2012-09-23 08:13:05 +02:00
Venugopal Shivashankar 86f234ad2d Language edits to the QDoc markup
Change-Id: I13206b25dbd87ce0d066cb21842dfbd516bd2bbc
Reviewed-by: Alex <alex.blasche@nokia.com>
2012-02-29 12:39:49 +01:00
veshivas 7622a55810 Modified the \brief text for the Bluetooth C++ classes and the QML elements.
Change-Id: I3c455739afe9d63eb822a0462c7e786bd83259ee
Reviewed-by: Gary Aish <gary.aish@nokia.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
2012-02-28 16:06:32 +01:00
Jason McDonald 78d225a563 Remove "All rights reserved" line from license headers.
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>
2012-01-30 07:07:47 +01:00
Michael Zanetti ebd7a5d293 added documentation and examples
Change-Id: Ia99e5f8f9579c189379bce1a22de3d58b12ce5fc
Reviewed-by: Alex <alex.blasche@nokia.com>
Sanity-Review: Alex <alex.blasche@nokia.com>
2012-01-23 15:57:18 +01:00
Jason McDonald f54bd71301 Update obsolete contact address.
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>
2012-01-20 08:03:44 +01:00
Jason McDonald bd1496d2d2 Update copyright year in license headers.
Change-Id: I76920b22a5b386a0f85ec28076da20505c022b6f
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 08:23:40 +01:00
Michael Zanetti f0daca9ff8 added Connectivity namespaces (QtBluetooth and QtNfc)
Change-Id: I5f3062c857e657a6d05ab29edfa2f1b48cb173f8
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
2011-11-11 07:35:00 +01:00
Michael Zanetti 29ba829744 Initial commit.
From qt5connectivity.tar.gz, md5 317c149d6f8c07d09632353188582834
2011-08-24 14:10:36 +10:00