Commit Graph

35 Commits

Author SHA1 Message Date
Andreas Buhr 1617f94cfc Change QBluetooth::Security and AttAcc. to be a scoped enums
This patch changes QBluetooth::Security and
QBluetooth::AttAccessConstraint to be scoped
enums for improved type safety.

Fixes: QTBUG-91906
Change-Id: Ife4797aa8e106690a10e4fcb7f623877023fbb3c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-03-30 14:38:51 +02:00
Andreas Buhr 75c3a3ee9f rename error signals to errorOccurred
Currently, there is a name clash between the error getter and
the error signal. This leads to extensive use of qOverload or
similar. This patch renames all error signals to errorOccurred
to resolve this.

Task-number: QTBUG-62877
Change-Id: I615e2405f855433b6e142d820072c4d3f35ae28f
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-03-22 13:51:28 +01:00
Andreas Buhr e009d67f4b Decouple QBluetoothSocket and QAbstractSocket, introduce scoped enums
QBluetoothSocket enum values were tied to QAbstractSocket enum values.
But there is no dependency, the coupling is not required. This patch
removes the coupling and changes to scoped enums for improved type
safety.

Task-number: QTBUG-62877
Change-Id: I206b1d438d74b976d3e0d32da5713d22b597dd90
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-03-12 09:05:35 +01:00
Oliver Wolff 0a9f68ef4d tst_qbluetoothsocket: Fix one ORed preprocessor condition
Change-Id: I4ef69cd51cfa975d60de1d2c817f3827737d03c4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-07-03 09:44:44 +02:00
Oliver Wolff a0ade06800 Replace foreach with for loop and set QT_NO_FOREACH
To avoid unnecessary copies, const is used wherever possible.

Change-Id: Ic743716512751cfd24fad5bd37c244b115dd26fe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2018-08-15 07:56:46 +00:00
Alex Blasche ba56814fa4 Replace custom QT_BLUEZ_BLUETOOTH against the related feature define
Change-Id: I4fbb948841a610640acaf87364e2157e31782836
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2017-04-06 07:31:45 +00:00
Liang Qi aabce3a08d Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I3eec9a22565585d4fc40831d609a3083ce99a52c
2016-09-16 23:24:43 +02:00
Timur Pocheptsov 21e7cb1baf QBluetoothSocket::connectToService - check a socket type first
Attempt to connect to a service using a socket with UnknownProtocol
socket type will fail, but can result in an incorrect UnknownSocketError
reported and also can start a device discovery (then finally failing to
connect after all). Check this condition early before trying to actually
connect/do device discovery and report error properly
as UnsupportedProtocolError.

Task-number: QTBUG-55073
Change-Id: Ib39e1ca7ad401e07d6387201a4664a1185d38d39
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2016-08-26 13:41:27 +00:00
Antti Kokko 3821f105a8 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I37338c968d8cb5a056cd42e1130cfa077b12d164
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 20:14:38 +00:00
Alex Blasche fc5738fe8f Add test for QBluetoothSocket::preferredSecurityFlags() and setter
Task-number: QTBUG-46377
Change-Id: I12de86befe60c7d4167a6b630e3fddaf55863039
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-07-06 06:49:25 +00:00
Jani Heikkinen 7354c6d393 Update copyright headers
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>
2015-02-16 11:48:42 +00:00
Alex Blasche fd88da6bf1 Convert qRegisterMetaType<T>(const char*) to qRegisterMetaType<T>()
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>
2015-01-28 07:48:13 +00:00
Alex Blasche 9b6d7408bc Fix QBluetoothSocket unit test failures on Android
Change-Id: Ib8800fa30c74678c74df9ed943b143ea4cf49bb2
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-10-13 09:31:38 +02:00
Alex Blasche fa7615b4e9 Fix QBluetoothSocket::isReadable()/isOpen()/isWritable()
Change-Id: Ifd6b5ed8176aa7959ed8da0edc762266aa2bd6fa
Task-number: QTBUG-32704
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-10-13 09:31:28 +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
Alex Blasche 10cd7743aa Utilize QStringLiteral where possible
The only exception are generated files and cases where
QLatin1String based overloads are used (e.g. during QString comparisons)

Change-Id: I6f36789fb8acb3b30c1dc1f8a920b118a979d74f
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-05-15 10:10:05 +02:00
Alex Blasche 10e636b4e5 Fix qbluetoothsocket unit test
Task-number: QTBUG-22017
Change-Id: I876b8a052873d198e8991b7eab3ca70714eb0dcc
Reviewed-by: Nedim Hadzic <nedimhadzija@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-02-27 16:14:01 +01: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 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
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
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
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
alex 2cf4fc7c63 Fix various Bluetooth tests such that they run via CI
The CI system doesn't have any Bluetooth devices attached to it.

Task-number: QTBUG-22017
Change-Id: I136d8f1295f3e770eb8c66557343ede7fa438a06
Reviewed-by: Michael Zanetti <michael.zanetti@nokia.com>
Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
2012-06-27 02:36:18 +02:00
Thiago Macieira 938fbcbb74 Change uses of {to,from}Ascii to {to,from}Latin1
This operation should be a no-op anyway, since at this point in time,
the fromAscii and toAscii functions simply call their fromLatin1 and
toLatin1 counterparts.

Task-number: QTBUG-21872
Change-Id: Ia2fed44c5db997b6fc13a243f5e312d35f8625ad
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-05-30 20:06:38 +02:00
alex 09defae552 No more Bluetooth on Symbian
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>
2012-02-08 14:01:13 +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
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 554a19264b Update copyright year in Nokia copyright headers.
Update copyright headers from before 2011.

Change-Id: Ic34da6aa9bf8ba63d4e41c2135b4fdaf7c437360
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-11 04:20:22 +01:00
Friedemann Kleint 91371ffd3d QtConnectivity: Fix test crashes/asserts/hangs.
- Fix crash caused by uninitialized d-ptr in local device
  default implementation (Windows).
- Fix crash caused by uninitialized d-ptr in local device
  bluez implementation (Linux) if connection fails.
- Verify local device validity before d-ptr is accessed in
  test
- Fix crash in QNdefNfcUriRecord::uri() in case
  abbreviations[0] (==0) is accessed.
- Terminate wait loops
- Check signal spy before accessing first element.
- Fix compiler warnings.

Change-Id: I92d54b4dfcc05e8befb49f2bd72b60251641aa48
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
2012-01-03 23:45:06 +01:00
Friedemann Kleint 7287bd2c3a tst_qbluetoothsocket: Fix warnings about operators.
Change expression to what was most likely intended.

Change-Id: Ifd1e6ef2a41cab020cfd9a3f341a74f1b169448e
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
2011-11-30 03:39:01 +01:00
Friedemann Kleint d9cab185a8 QtConnectivity: Fix compilation on Windows.
- 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>
2011-11-30 03:37:49 +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
Jason McDonald ae1cbc39bf Remove SkipMode parameter from QSKIP.
The SkipMode parameter has been removed from the API in qtbase, so it
must be in all calls to QSKIP.

Task-number: QTBUG-21851, QTBUG-21652
Change-Id: Iae4432e57a12064b86f9a56cad73fecb56bdaaa9
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
2011-11-09 02:33:53 +01:00
Michael Zanetti bd4df1e8e1 re-added autotests
Change-Id: Ic2be21fd11e2fdb96185fe9269cebbe08b6de87a
Reviewed-on: http://codereview.qt-project.org/4783
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
2011-10-07 03:31:39 +02:00