summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothlocaldevice_bluez.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Normalize QObject::connect() statementsAlex Blasche2018-08-291-30/+30
| | | | | | | | | | | | | | 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-25/+16
| | | | | Change-Id: I7dd2d055c8d667f049d7cb2c371619137bf76030 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Replace foreach with for loop and set QT_NO_FOREACHOliver Wolff2018-08-151-4/+7
| | | | | | | | 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>
* Make Adapter1.RemoveDevice() call asyncAlex Blasche2018-05-041-7/+11
| | | | | | | | | | | | | This function is called as part of QBluetoothLocalDevice::requestPairing(..., Unpaired). On heavy I/O systems this may be a rather slow function call. This patch ensures that the function is called asynchronously. Task-number: QTBUG-64735 Change-Id: I7e3b4ab3e9dca26a33af4d13bcc0ea64c44e1540 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Update to new QRandomGenerator APIv5.10.0-beta4Thiago Macieira2017-11-031-3/+3
| | | | | | Change-Id: I69f37f9304f24709a823fffd14e676c097712329 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Use QRandomGenerator instead of q?randThiago Macieira2017-06-301-4/+4
| | | | | Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Ensure the passkey and pincode for pairing are randomAlex Blasche2017-03-141-2/+2
| | | | | | | | | | | | The previous AND operation with 1mio was not random (especially when the hex value was used). Task-number: QTBUG-59392 Change-Id: Id9ba5432c21fa41a9e5af9800a8633ce4f02fba4 Reviewed-by: Tuomas Vaarala <tuomas.vaarala@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Match connected device changes based on local device instanceAlex Blasche2017-02-171-23/+38
| | | | | | | | | | | | A new device connection is only ever for one particular device. Prior to this patch all local device instances (for different adapters) assumed the new connection request would be theirs. Task-number: QTBUG-57417 Change-Id: I0e7ced15cb83df4321284a297ac42b8786f9314b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@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>
* Merge remote-tracking branch 'gerrit/5.5' into 5.6Alex Blasche2015-12-011-0/+2
|\ | | | | | | Change-Id: I4404df69bfdac335e9c1eb63e4ada3ba89b48b6c
| * Don't register meta types during static init time5.5Alex Blasche2015-11-301-0/+2
| | | | | | | | | | | | | | | | | | | | The QMetaType register my not be up and running by the time we attempt these meta type registration. Change-Id: I1a857a936a24b4b00a49574fac311c08c09b3d5a Task-number: QTBUG-49455 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | [Bluetooth] Optimize loopsKonstantin Ritt2015-09-161-15/+33
|/ | | | | | | | | | | | 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>
* 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>
* Avoid potential memory leak on variable 'device'Sergio Ahumada2015-02-101-3/+11
| | | | | Change-Id: I4a3907dc1f8b8608b1c1b34e16d2e987cdc23be3 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.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>
* Merge branch '5.3' into devAlex Blasche2014-06-271-6/+50
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/bluetooth/qbluetoothlocaldevice_bluez.cpp src/bluetooth/qbluetoothlocaldevice_p.h src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp Change-Id: Ifb0c01eb8bffbffcd2416ea8d7bf1d36eb1c70f2
| * Bluez4: Ensure QBluetoothLocalDevice becomes invalid if adapter disappearsAlex Blasche2014-05-271-6/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The DBus object disappears when the dongle is removed. Once a QBluetoothLocalDevice instance is invalid it remains invalid. The patch further ensures that an invalid instance does not initiate pairing activitiy. Last but not least this patch fixes a memory leak in case a DBus error occurs during the adapter initialization. Task-number: QTBUG-38399 Change-Id: I2e13e393060c77fab5f79d5451dd6fe9a2a6e3bb Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
* | Bluez5: Simplify lookup of default adapterAlex Blasche2014-06-021-43/+6
| | | | | | | | | | | | Change-Id: I59aa5241d33191a8ca8cc167263b63b024f52754 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Bluez5: QBluetoothLocalDevice becomes invalid if adapter disappearsAlex Blasche2014-05-281-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bluez5 supports org.freedesktop.DBus.ObjectManager interface which permits monitoring of removal/addition of Bt adapters. This permits the invalidation of the current QBluetoothLocalDevice instance. Once the instance is invalid, it will remain invalid. Otherwise we could have a switch of the adapter without the developer noticing it because the next Bt dongle could get the same interface path. This would violate the sense of identity that is attached to a QBluetoothLocalDevice instance. Task-number: QTBUG-38399 Change-Id: I007278ff1f94c48d6e6902959132088858b0d011 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
* | 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>
* | Utilize Qt global discovery mode session in QBluetootLocalDevice.Alex Blasche2014-05-231-21/+8
| | | | | | | | | | | | | | | | | | | | QtBluezDiscoveryManager manges the global discovery session for all Qt classes. This was introduced when implementing the device discovery. QBluetoothLocalDevice was not using this mechanism yet which could lead to discovery sessions being killed while still required. Change-Id: I4229cb2aa34df35cf4d0650c828c8cfa11040d4a Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Utilize QStringLiteral where possibleAlex Blasche2014-05-151-22/+22
| | | | | | | | | | | | | | | | 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>
* | Merge branch 'stable' into devAlex Blasche2014-05-081-26/+22
|\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/bluetooth/qbluetoothlocaldevice_bluez.cpp src/bluetooth/qbluetoothserver_p.h src/bluetooth/qbluetoothsocket_qnx.cpp Change-Id: I08792f10155f9b4e6af30066b70e24b48985ddd6
| * Bluez4: Fix incorrect list of connected devices in QBluetoothLocalDeviceAlex Blasche2014-04-221-23/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConnectionChange signals were never emitted for remote devices which already existed at class instanciation time. At the same time this patch removes the delayed creation of the connectedDevices set. This simplifies the code and the caching did not save much effort. Task-number: QTBUG-38402 Change-Id: Ic871f919435c0d42ce2d79fd54f0da693816010a Reviewed-by: Oleg Shparber <trollixx@gmail.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Add Bluez5 support for QBluetoothLocalDeviceAlex Blasche2014-05-061-107/+645
| | | | | | | | | | | | | | | | | | The pairing signals are not yet implemented. For details see QTBUG-38401. Task-number: QTBUG-32085 Change-Id: I2b4e9a97b880801ebbffe367a8ab98320dd7ef2f Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* | Fix coding style in QBluetoothOleg Shparber2014-04-231-114/+152
|/ | | | | | | | Affected: QBluetooth, QBluetoothAddress, QBluetoothDeviceDiscoveryAgent, QBluetoothDeviceInfo, QBluetoothHostInfo, QBluetoothLocalDevice Change-Id: Ia5af61f87eafecfba56b75fa61b81014cdd38960 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Fix crash when calling QBluetoothLocalDevice::connectedDevices()Alex Blasche2014-02-261-0/+3
| | | | | | | | The crash happened on Bluez while no local Bt device is connected. Change-Id: I418f73b964edc3c302665d4e3374b49a68cfdc46 Reviewed-by: Nedim Hadzic <nedimhadzija@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Suppress warning from QObject attempting to connect null objectAlex Blasche2014-01-241-3/+5
| | | | | | | | This can happen when QBluetoothLocalDevice(some_invalid_bt_address) was called. Change-Id: I8d547dc802b79ffd5cf8349fec6334177e8c4421 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* whitespace fixesOswald Buddenhagen2014-01-201-1/+1
| | | | | | | remove trailing whitespace, expand tab Change-Id: I3361c6c431231c7463bb1dc9b53268935b22a72b Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Fix remaining uncategorized debug/warning messages (catchup in dev)Alex Blasche2014-01-081-3/+3
| | | | | | | | | | | The initial change was done in stable. After merging it to dev new code paths required a similar treatment. Task-number: QTBUG-32253 Change-Id: I745928f28c35ce9c0e601df6e11eb21c9f17ca7a 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-19/+21
|\ | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothlocaldevice_qnx.cpp src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp Change-Id: If7dd968047fec5352567e9b67ca5b8e680c7523d
| * Use QLoggingCategory to categorize the various debug output streamsAlex Blasche2013-12-201-19/+21
| | | | | | | | | | | | | | Task-number: QTBUG-32253 Change-Id: I193162407d0fc7eca83689e31f03e1641a494ab0 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Added new API for device "connected" statusOleksandr Matasov2013-11-121-1/+117
|/ | | | | | | | | | The feature allows to know whether QBluetoothLocalDevice is currently connected to any other device using connectedDevices() method. Change-Id: I4d1a19ebb0b42efd1fc5d5f0f9e7816aa956fbf4 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Remove compiler warningsAlex Blasche2013-09-201-0/+1
| | | | | | Change-Id: I12058d42678187de262b942cce868ac608387351 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Lower the verbosity of bluetoothFabian Bumberger2013-09-181-16/+27
| | | | | | | | | 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>
* 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>
* BlueZ: Fix setting host modeFabian Bumberger2013-07-301-7/+33
| | | | | Change-Id: Id36f047acfaabf3fdbb4e6c07e88dac50878a641 Reviewed-by: Alex <alexander.blasche@digia.com>
* Don't hardcode the test device's Bt address in the unit test.Alex Blasche2013-07-291-9/+18
| | | | | | | | | | | Ensure that all signals emitted during a pairing request are queued via the event loop. The exact reason for doing this is unknown however such a change was done on purpose in QtMobility. We keep the behavior to be on the safe side. Change-Id: I666c5b2c25a0c80df634f7b6643bd08126812b65 Reviewed-by: Michael Zanetti <michael.zanetti@canonical.com> Reviewed-by: Alex <alexander.blasche@digia.com>
* Improve and fix the qbluetoothlocaldevice testAlex Blasche2013-07-151-17/+33
| | | | | | | | The Bluez code was not passing the test. Task-number: QTBUG-22017 Change-Id: I0bc2fca7ec9d352481eea24c75b902c21b4fc0da Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
* Fix broken QBluetoothLocalDevice::isValid() behaviorAlex Blasche2013-06-281-0/+5
| | | | | | | | | | | | | | | The Bluez and QNX backend always returned true. They should only return true if the local device is truly available or if the passed QBluetoothAddress is indeed one of the local bluetooth devices. The related unit test was extended to ensure common bahvior of invalid QBluetoothLocalDevice instance on all platforms. Task-number: QTBUG-32068 Change-Id: I40ab4db48dc82ba0d1c0bb5275e96a3ee812b01a Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex <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>
* removed Nokia specific stuff not needed any moreMichael Zanetti2012-06-261-250/+0
| | | | | Change-Id: I0b2c41f3c971221c65f77f847129ab38b094c31c Reviewed-by: Alex <alex.blasche@nokia.com>
* only allow apps to temporarily power on BluetoothMichael Zanetti2012-06-131-8/+4
| | | | | | | also disallow powering Bluetooth off while something else is still using it Change-Id: Icb8f5863e618d628dd40e2c2e169328c239eb81f Reviewed-by: Alex <alex.blasche@nokia.com>
* Make use of Nokia bt services for pairing requests.Christian Fetzer2012-05-291-0/+54
| | | | | | Change-Id: I4a4e68c1524b3a83129c20ce7c985fca6c7cc8a5 Reviewed-by: Michael Zanetti <michael.zanetti@nokia.com> Reviewed-by: Alex <alex.blasche@nokia.com>
* Make use of Nokia bt services for powering on/off bluetooth.Christian Fetzer2012-05-291-71/+262
| | | | | | Change-Id: Ie648226fd821403208b21749f624f34fc7abc498 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>