summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Merge remote-tracking branch 'gerrit/5.5' into 5.6Alex Blasche2015-10-131-0/+2
|\ | | | | | | Change-Id: I9d78ba7ad02848e3166a29c9f2d4876dd1bc1e96
| * Bluetooth device discovery agent (bluez): Prevent null pointer access.Christian Kandeler2015-10-081-0/+2
| | | | | | | | | | | | | | | | | | We would potentially access a null adapter if stop() was called from a user slot connected to the deviceDiscovered() signal. Task-number: QTBUG-48481 Change-Id: I784120dcd7a9f71d9532fac9538ae98e1a329db2 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | [Bluetooth] Optimize loopsKonstantin Ritt2015-09-161-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | Decrease complexity from O(N+N*logN) to just O(N) for cases like foreach (Key key, map.keys()) Value value = map.value(key); , by rewriting with use of iterators. Change-Id: I81f1334797f16b624293fcebdee885b2be3c89f1 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Stop device discovery session before retrieving service records.Robin Burchell2015-08-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Each org.bluez.Adapter.StartDiscovery should be paired with a corresponding StopDiscovery; it is not enough to merely observe that an adapter's Discovering property momentarily changes from true to false. Change-Id: Iee4ea4119cb4b6cd78982385bf18970d5b48d2de Task-number: MER#1230 Done-by: Hannu Mallat <hannu.mallat@jollamobile.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | To check for errors when starting discovery, wait for the call.Hannu Mallat2015-08-201-0/+1
|/ | | | | | | | Errors can't be known until the call runs. Change-Id: I68687ba8c813da922ca2c0906f9d33414333d87d Task-number: MER#1231 Reviewed-by: Alex Blasche <alexander.blasche@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>
* 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>
* Improve consistency of device discovery.Alex Blasche2014-08-131-13/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Device discovery of BTLE devices fails once the second device discovery is performed in the current process. The first discovery always succeeds. BTLE devices are advertised right after the start of the device discovery session. However the discovery session never seems to stop once it is done for the first time. This can be seen by the fact that the Discovering property of the adapter constantly toggles between true and false. As a consequence the second device discovery won't find a BTLE device in 99% of all cases. The odds that the API user initiates the second discovery right between two continues adapter searches is rather slim. The fix is to extend the device discovery process beyond a toggle of a single device discovery cycle. We ignore the end signal of the first cycle and continue to the end of the second cycle. At the same time we rely on the perceived bug which restarts the second cycle automatically. Just for the case that the second cycle doesn't start automatically we utilize a timer to manually force an end of the device discovery. The problem is likely to be a bug in Bluez4. A negative side effect of this workaround is a longer device discovery process. Change-Id: I986c8d6498b2cc9ed51f4457267c53813132cf8e Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Ensure Bluez5 device discovery sets the new core configuration flagAlex Blasche2014-07-171-1/+7
| | | | | Change-Id: Idc04620c3941ec92c7ea81e1ba4ec521cf000720 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Merge branch 'dev' into btleAlex Blasche2014-07-031-49/+26
|\ | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp Change-Id: Ib960b9e8d8800af84d2094bdf26c2652d4c81dba
| * Bluez5: Simplify lookup of default adapterAlex Blasche2014-06-021-49/+26
| | | | | | | | | | | | Change-Id: I59aa5241d33191a8ca8cc167263b63b024f52754 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | QBluetoothDeviceInfo::coreConfiguration() should return the QFlagAlex Blasche2014-06-041-2/+2
| | | | | | | | | | | | | | | | | | Function name was slightly adjusted to reflect the fact that it's a flag. Change-Id: I9c1a2fe64b93c7ae7bd826d856f8b87f985d7473 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Merge branch 'dev' into btleAlex Blasche2014-05-261-39/+313
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Use Alias as Device/Adapter name on Bluez 5Alex Blasche2014-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | Bluez5 docs recommend to use the Alias rather than the Name property. This ensures that a potentially user chosen device name is used rather than the actual device name. If no Alias is set the property automatically reverts back to the Name value. Change-Id: If2b397cf49df6dc78bb205c1136b8d1dd5e7c02f Reviewed-by: Bea Lam <bea.lam@jollamobile.com> Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
| * Bluez5: Ensure device discovery returns meaningfull RSSI dataAlex Blasche2014-05-221-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the discovery process was started by QBluetoothDeviceDiscoveryAgent and Bluez wasn't already in discovery mode then the RSSI values are 0. The retrieval of RSSI data takes a bit more time. To find a compromise between speedy return of device scan information and the delayed RSSI information we continue to monitor the device scan and update RSSI information as the values are propagated by Bluez. However the deviceDiscovered() signal is not emitted again after an update. Only re-calling discoveredDevices() will return the most up-to-date RSSI values. Task-number: QTBUG-32085 Change-Id: Icb6566d51503a6004fa3f25c499fc7f941bd7fee Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
| * Utilize QStringLiteral where possibleAlex Blasche2014-05-151-10/+10
| | | | | | | | | | | | | | | | 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>
| * Bluez5 support for QBluetoothDeviceDiscoveryAlex Blasche2014-05-091-9/+245
| | | | | | | | | | | | | | Task-number: QTBUG-32085 Change-Id: I31ae0dc9f0d09f3979797eb95eb87ed7bd181ae3 Reviewed-by: Oleg Shparber <trollixx@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * Fix coding style in QBluetoothOleg Shparber2014-04-231-27/+27
| | | | | | | | | | | | | | | | Affected: QBluetooth, QBluetoothAddress, QBluetoothDeviceDiscoveryAgent, QBluetoothDeviceInfo, QBluetoothHostInfo, QBluetoothLocalDevice Change-Id: Ia5af61f87eafecfba56b75fa61b81014cdd38960 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Merge branch 'dev' into btleAlex Blasche2014-02-171-31/+29
|\| | | | | | | | | | | | | | | | | | | | | | | 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
| * Adjust strings for translationAlex Blasche2014-02-131-1/+1
| | | | | | | | | | | | | | | | This includes unification of error messages, fixes for spelling mistakes, hints for translators and other forms of simplifications. Change-Id: Idd0e01614b24ff2d19133f0d19d49649d59e3f57 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
| * Merge remote-tracking branch 'gerrit/stable' into devAlex Blasche2014-02-031-0/+3
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothservicediscoveryagent.cpp Change-Id: I52831fc8c69062e90c003836fd9402f19d6a0ba5
| | * Fix memory leaks in Bluez specific device and SDP discovery classes.Alex Blasche2014-01-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtBluetooth][Platform Specific Changes] Memory leaks fixed in Bluez device and service discovery implementations. Change-Id: Ibc7c883d42d81a97310ff44ba40ffa94c71f611f Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * | whitespace fixesOswald Buddenhagen2014-01-201-2/+2
| | | | | | | | | | | | | | | | | | | | | remove trailing whitespace, expand tab Change-Id: I3361c6c431231c7463bb1dc9b53268935b22a72b Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * | Emit PoweredOffError if required during device discovery start on BluezAlex Blasche2014-01-161-0/+12
| |/ | | | | | | | | | | Change-Id: I12406b2a0fef831ed2e96340fac73156dfa71848 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * Use QLoggingCategory to categorize the various debug output streamsAlex Blasche2013-12-201-29/+12
| | | | | | | | | | | | | | Task-number: QTBUG-32253 Change-Id: I193162407d0fc7eca83689e31f03e1641a494ab0 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Implemented Bluetooth Low Energy gatt service and characteristics discoveryNedim Hadzic2013-11-041-0/+10
|/ | | | | | | | | 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>
* Refactor device and service discovery errorsFabian Bumberger2013-09-201-4/+4
| | | | | | | | - Make them more consistent with other Qt modules - Propagate the error during device discovery to the QBluetoothServiceDiscoveryAgent Change-Id: Idcd3e0e6061b85e8b6adad248625740f3b91289a 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>
* Make Bluetooth adapter choosable for device and service searchNedim Hadzic2013-09-051-5/+5
| | | | | | | | | | | | | | | | | In case there are more Bluetooth adapter, device and service search might give different results. Addition to Change-Id: Ideddb39460985c18547baec986b15e43946c85de - added option for setting the device adapter for service search. QBluetoothLocalDevice was used in both classes (device and service search) for passing an argument for setting adapter. The reason for this to keep the same approach, because in QBluetoothServiceDiscoveryAgent class there is already a constructor with QBluetoothAddress argument. Auto tests and examples updated. Change-Id: Ib5d7ff23e4846d9d42dae68d8d424031748811e5 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Make Bluetooth adapter choosable for device searchNedim Hadzic2013-08-291-3/+9
| | | | | | | | In case there are more Bluetooth adapter, device search might give different results. Change-Id: Ideddb39460985c18547baec986b15e43946c85de 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>
* 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>
* 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>
* 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>
* 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>
* re-added autotestsMichael Zanetti2011-10-071-10/+10
| | | | | | | 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>
* Initial commit.Michael Zanetti2011-08-241-0/+222
From qt5connectivity.tar.gz, md5 317c149d6f8c07d09632353188582834