summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothservicediscoveryagent.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Service discovery agent - remove the public API implementation (macOS)Timur Pocheptsov2019-07-151-0/+11
| | | | | | | | Instead, use the shared implementation (and the declaration from the *_p.h) Fixes: QTBUG-75348 Change-Id: Icbcbb752df1a9b8865ea4f4ef06f2b59dda577cd Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-111-1/+2
|\ | | | | | | Change-Id: Ieb05b1eb0fa8247726f5f5de771496a9b50b9f55
| * Bluetooth: Compare the server channel when checking for duplicatesAndy Shaw2019-05-101-1/+2
| | | | | | | | | | | | | | | | | | It is possible that the service will appear to be the same but have different server channels. So these services should not be seen as duplicates as a result. Change-Id: I36f9c376fcfd9378f4f18c639e87e1a7aad1815b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-091-0/+5
|\| | | | | | | Change-Id: Ie734d2574c039a7f45d84455811472ea5b8c8e1c
| * Add Android exclamation to QBluetoothServiceDiscoveryAgent ctor docsAlex Blasche2019-02-081-0/+5
| | | | | | | | | | | | | | | | | | Passing the local address does not work because the passed address cannot be matched against the local adapter address. For privacy reasons this is not possible anymore since Android 6.0. Change-Id: Iacc632dda4af83265bdc3a062c0eba6c31cfa596 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Compile-fix (g++ 8): move #include of mocs outside namespaceEdward Welbourne2018-11-301-2/+2
|/ | | | | Change-Id: I9adaa11043c94e0c4d5530fbafa2ef2f15681cac Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Ensure QObject context is retained to avoid crashesv5.12.0-beta4Alex Blasche2018-10-311-3/+3
| | | | | | | | | | | If the public class is deleted pending lambda invocation can cause crashes unless QObject context is provided. This fixes a regression introduced by 819bb06c2cb3372cb1bb9ddd7f3a504f78d3452d. This was discovered while investigating QTBUG-71479. Change-Id: I3a49916ce6d9425c684863bb0b04a10bd3e652b9 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Normalize QObject::connect() statementsAlex Blasche2018-08-291-7/+13
| | | | | | | | | | | | | | Some cases use the Q_PRIVATE_SLOT logic which does not require QObject inheritance. Those cases were converted to lambda logic to avoid need for QObject inheritance. The Q_PRIVATE_SLOT macro was removed from qbluetoothdevicediscoveryagent.h. This is not a BC problem because the macro expands to nothing. Only moc recognizes the pattern. Change-Id: Ic7cb4cde397f9b230b6fd0b4046e59e504583e58 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Code cleanup: Use nullptr wherever possibleAlex Blasche2018-08-241-3/+3
| | | | | Change-Id: I7dd2d055c8d667f049d7cb2c371619137bf76030 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Replace foreach with for loop and set QT_NO_FOREACHOliver Wolff2018-08-151-1/+1
| | | | | | | | 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>
* Improve documentation about missing iOS support in QtBluetoothAlex Blasche2018-01-041-0/+3
| | | | | | Task-number: QTBUG-65547 Change-Id: I472b354621db89a921eec01b1459d46dbaa15ac0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Avoid recursion during QBluetoothDeviceDiscoveryAgent::stop()Alex Blasche2017-08-041-0/+8
| | | | | | | | | | | | | | | | | | QBluetoothDeviceDiscoveryAgent (DDA) is deleted by QBluetoothServiceDiscoveryAgent (SDA) once it receives an error or SDA is instructed to stop() the discovery process. Currently, this triggers at least two calls to the DDA's stop() function. In addition, if stop() generates an error the error call itself will call back to DDA:stop(). Therefore it create an endless loop back. This is at least true for the Android devices mentioned in the related bug report. This patch ensures that the main logic of Android's DDA::stop() is not called more than once. Further more SDA disconnects from DDA's signals to avoid a potential endless loop. Any error in DDA is not of relevance to the surrounding SDA instance anymore. Task-number: QTBUG-60131 Change-Id: I1df16f2b0896928833aa2ced75c43d4642b4fba3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Only do Classic device discovery inside QBluetoothServiceDiscoveryAgentAlex Blasche2017-06-141-1/+1
| | | | | | | | | | | QBluetoothServiceDiscoveryAgent performs SDP based Bluetooth service discovery. There is no need to do a BTLE discovery for the purpose of triggering an SDP service discovery. Change-Id: I16448b603e80e778b71ee397c0db14d0502d3acf Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Replace custom QT_BLUEZ_BLUETOOTH against the related feature defineAlex Blasche2017-04-061-2/+2
| | | | | Change-Id: I4fbb948841a610640acaf87364e2157e31782836 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* winrt: Add service discoveryOliver Wolff2017-01-201-0/+2
| | | | | | | | | | | | | | | In Windows 10 SDK versions < 14393 full service discovery is not supported. While GetRfcommServicesWithCacheModeAsync enables us to specify the lookup mode get_RfcommServices only returns cached services. To be able to offer some functionality for older version we use its results but give a warning about the limited abilites of this API in case of full service discovery. Task-number: QTBUG-37779 Change-Id: I21a15f8bb1d058780c8322ece2c3d9a285ecab25 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Merge remote-tracking branch 'gerrit/5.6' into 5.7Alex Blasche2016-06-091-4/+4
|\ | | | | | | Change-Id: Id8dffff9bb75db396aabf6da2a3acb78505a6476
| * QBluetoothServiceDiscoveryAgent: set q_ptr in d_ptr's constructor.Edward Welbourne2016-06-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | The agent class constructors were initializing the q_ptr member of their d_ptr; it is cleaner to pass this down to the d_ptr's constructor and let it do this itself. This also lets Coverity know that initialization actually does happen (CID 22330). In particular, it makes sure we can't leave it uninitialized, if an agent implementation happens to neglect to do so. Change-Id: Ie01046a5a113b5669e8e63c6a22f692cd3943ac0 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-061-1/+6
|\| | | | | | | | | | | | | Conflicts: examples/nfc/corkboard/corkboard.pro Change-Id: I5d1ea0a8e21a1b55dbf744c2f4b469bc51f05c7a
| * Improve QBluetoothServiceDiscoveryAgent::setUuidFilter() docsAlex Blasche2016-04-271-1/+6
| | | | | | | | | | | | | | | | | | | | Better explains that the uuid filter is applied against two service attributes rather than only one. The ServiceId and the ServiceClassIds are used for matching purposes. Change-Id: Ib301e438c27977288c56a2bb9dfe68e2d3f2a10d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | 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>
* Remove QNX/BlackBerry implementation for QtBluetoothAlex Blasche2015-06-171-2/+3
| | | | | | | | | [ChangeLog][QtBluetooth][Platform Specific Changes] Removed support for Blackberry 10. Change-Id: I431c4f34bb10aa3668542df7a8b3403b61bf4705 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@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>
* Fix crashing btchat example when selecting remote devicev5.4.1Alex Blasche2015-01-291-0/+5
| | | | | | | | | | | | | | | | | The example immidiately destroys the QBluetoothServiceDiscoveryAgent when the user selects a remote chat service from the remote selector dialog. This may happen even when the scheduled QtConcurrent call to runSdpScan() was still pending. The subsequent signal callback into the deleted parent caused a crash. Unfortunately QtConcurrent::run() returns a QFuture which does not permit stopping the pending thread execution. Therefore the runSdpScan() had to be rewritten using QProcess to properly destruct pending calls. Change-Id: I1ed5e147feb94a26240901a02d836056eddabbf6 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Add missing InvalidBluetoothAdapterError to QML discovery modelAlex Blasche2014-11-211-1/+2
| | | | | | | | | | | | QBluetoothServiceDiscoveryAgent::InvalidBluetoothAdapter was introduced by Qt 5.3 but never added to the QML BluetoothDiscoveryModel. This patch fixes the problem. This was noticed due to a crash on Android emulator. Change-Id: I652576929659ca370216133154e36158e8425711 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Extend docs on Minimal SDP discoveryAlex Blasche2014-09-301-4/+10
| | | | | | Change-Id: If1add78a34f4d01313e022bd7af1d53ac2abd535 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Add \since to all Qt Bluetooth classes which didn't have the tag yetAlex Blasche2014-09-261-0/+2
| | | | | | Change-Id: I50d818294cb53962bca2b08edbfdc4558890777c Task-number: QTBUG-36775 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
* Remove QLowEnergyServiceInfoAlex Blasche2014-09-031-9/+18
| | | | | | | | There is no need for this class anymore as QBluetoothServiceInfo covers the same information. Change-Id: I411a8abb68b34a3a4893a67ee9fac096f44bbd62 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-241-18/+10
| | | | | | | | | - 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>
* Fix BTLE related qdoc errorsAlex Blasche2014-06-041-0/+6
| | | | | | Change-Id: Id1a56b0ed050fd9cebee8738351e560b442d748f Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Merge branch 'dev' into btleAlex Blasche2014-05-261-2/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/bluetooth/bluetooth.pro src/bluetooth/bluez/bluez.pri src/bluetooth/doc/src/bluetooth-index.qdoc src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp src/bluetooth/qbluetoothdeviceinfo.cpp src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp src/bluetooth/qbluetoothservicediscoveryagent_p.h src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp Change-Id: I88b22c51a4ee95b067ef8d2b2fddb5cbff4566f8
| * Code cleanup: Avoid repeated service info duplication checkAlex Blasche2014-05-231-0/+15
| | | | | | | | | | Change-Id: I00701e9103a6acfdfc2697949280f8a7de8bcdfe Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
| * Service discovery via Bluez5Alex Blasche2014-05-221-1/+8
| | | | | | | | | | | | | | | | | | At the same time we shift the ServiceClassUUID to service name mapping to QBluetoothUuid. It was used by Android and now Bluez 5 uses it too. Task-number: QTBUG-32085 Change-Id: I9f2d4dc4e2997683485f2ba7aaefb646cb72fb75 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
| * Provide correct code snippet for QBluetoothServiceDiscoveryAgentOleg Shparber2014-04-221-1/+1
| | | | | | | | | | Change-Id: I8b975a2f55833c58479edac5d62809c1e83ea417 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Merge branch 'dev' into btleAlex Blasche2014-02-171-42/+83
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/bluetooth/bluetooth.pro src/bluetooth/doc/src/examples.qdoc src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp src/bluetooth/qbluetoothservicediscoveryagent_p.h src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp Change-Id: Ie1577e4b0f469cd5a6b05a61cbe94f180a64448d
| * Port QtBluetooth to AndroidAlex Blasche2014-02-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Merge remote-tracking branch 'gerrit/stable' into devAlex Blasche2014-02-031-15/+38
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothservicediscoveryagent.cpp Change-Id: I52831fc8c69062e90c003836fd9402f19d6a0ba5
| | * Stop SDP search if QML Model is turned offAlex Blasche2014-01-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | So far, we only ever disabled the device search. If a SDP discovery was running and we changed to device discovery the SDP discovery kept running in the background. Change-Id: I5f2cf88ecf7f9b5cfe2608e0ceda366b552982e5 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
| | * Do not clear result lists while the SDP search is ongoing.Alex Blasche2014-01-201-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Or bad things will happen... Change-Id: I7df3925ff5d15f3f904f4dd38e24b247ec151fd1 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
| | * Improve QBluetoothServiceDiscoveryAgent documentationAlex Blasche2014-01-201-16/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtBluetooth][QBluetoothServiceDiscoveryAgent] The QBluetoothServiceDiscoveryAgent class documentation has been improved. Change-Id: I5472e9ceda45d9bcf0634b5bf2cecf265986bc10 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
| * | Don't stop Bt discoveries while we have InvalidBluetoothAdapterErrorAlex Blasche2014-01-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change complements 23a3863de809a4051ae6db4942145cb0cb624d6c. The discovery process should not stop when the passed local adapter address is invalid. While the first change ensures that start() cannot be called stop() was still callable. The platform specific implementations potentially set lastError to something else und thus would permit a call to start() later on. This may lead to invalid internal states. Change-Id: Ibfd87374bf712614fad90172894ea2e009ba198a Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-171-16/+5
| |\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I7295292bb7d9b5fc7eba8f099f4592b70de80d11
| | * Cleanup more duplicated code in SDP discovery class.Alex Blasche2014-01-171-16/+5
| | | | | | | | | | | | | | | Change-Id: I4b6be592204cc435bfec508725d64cb8f7529a3b Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
| * | Document a somewhat peculiar signal behavior mismatch during Bt discoveryAlex Blasche2014-01-151-3/+7
| | | | | | | | | | | | | | | Change-Id: I8f9ac85e7753a9d6142bbefcd0e4bcda09e0f3d8 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-101-2/+0
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp Change-Id: Ic9e5cb3989426b90f6dad58d53dba366638ff35f
| | * Don't set the internal service discovery state twice to the sameAlex Blasche2014-01-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | The first call is not necessary as nothing has changed in the meantime. Change-Id: I8db51fd725dd210b3d5c7b01d399d24877bf9b2f Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-061-1/+2
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothlocaldevice_qnx.cpp src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp Change-Id: If7dd968047fec5352567e9b67ca5b8e680c7523d
| | * Improve error reporting.Alex Blasche2013-12-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever we emit an error, we should set the human readable error string in the discovery classes. [ChangeLog][QtBluetooth][Documentation] Fix cases where device and service discovery classes emitted an error signal but the human readable error string was not adjusted. Change-Id: I9680853d17d2ee4bc1293826bb7bf56cc999e2ed Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * | Improve and fix documentation for the Bluetooth discovery classes.Alex Blasche2013-12-201-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtBluetooth][Documentation] The documentation for the Bluetooth discovery classes has been improved. Change-Id: Id4366b491e8bbda8cf884b9ad3594dd89cc925e8 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * | Check the local adapter's BluetoothAdress before doing the discoveryFabian Bumberger2013-12-201-2/+18
| |/ | | | | | | | | | | | | | | Task-number: QTBUG-35571 Change-Id: I8f2eea7a8437787d61a238c760e948f45738618a Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* / Implemented Bluetooth Low Energy gatt service and characteristics discoveryNedim Hadzic2013-11-041-1/+0
|/ | | | | | | | | Bluez v4.x does not have total support for LE devices, a new approach, using gatttool command was implemented. Auto-tests and documentation will be in other commits. Change-Id: Iee711cc111199e15956052eebb7593bd3a5e27c8 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>