summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth
Commit message (Collapse)AuthorAgeFilesLines
* "Fix" heartrate-server on AndroidOliver Wolff2020-02-112-0/+9
| | | | | | | | | | This is a workaround for QTBUG-80533. Command line applications are no longer supported on Android. As we use the heartrate examples as test cases for bluetooth, we work around this problem by instanciating a gui application which fixes the compile error on Android. Change-Id: If06767eb6ff534077f193163991d9d506c17e50e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Modify point when lowenergyscanner remembers found BTLE devicesAlex Blasche2019-08-071-5/+7
| | | | | | | | | | | | | | | Technically speaking, nothing really changes in the application. However devices found, when QBluetoothDeviceInfo::deviceDiscovered() is emitted, may not have the complete set of data for a given device. In particular, rssi and manufacturer data changes happen later. Later changes to the example may want to display these transient types of information at which point this change becomes essential. It makes the app simpler to adopt for testing purposes too. Change-Id: I119b6e80a9a92b16de2d3e6792132ceb06b577a4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Eradicate Java-style iterators and mark the module free of themMarc Mutz2019-06-183-22/+15
| | | | | | | | | Java-style iterators are scheduled for deprecation, or at the very least banned from use in Qt code. Change-Id: If50aade7e5a57f247ec8c0e77103dfd2d2160c3c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Update Bluetooth examples for high-DPI displays and nullptrAndre de la Rocha2019-06-0616-12/+21
| | | | | | | | | This change sets the Qt::AA_EnableHighDpiScaling application attribute. It also uses nullptr to initialize pointers and adds a trivial optimization to the low energy scanner example. Change-Id: Ia923573ad78108a2a6a72be4c0948ea97a7ec094 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Convert uses of QTime as a timer to QElapsedTimerEdward Welbourne2019-06-121-2/+2
| | | | | Change-Id: I9d59d4bbf5d17c7b45fb04d5cb131c7f44e4c3ae Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* btscanner example: Fix deprecation warningFriedemann Kleint2019-02-111-4/+4
| | | | | | | | | | device.cpp:112:49: warning: ‘void QListWidgetItem::setTextColor(const QColor&)’ is deprecated: Use QListWidgetItem::setForeground() instead [-Wdeprecated-declarations] device.cpp:114:49: warning: ‘void QListWidgetItem::setTextColor(const QColor&)’ is deprecated: Use QListWidgetItem::setForeground() instead [-Wdeprecated-declarations] device.cpp:221:49: warning: ‘void QListWidgetItem::setTextColor(const QColor&)’ is deprecated: Use QListWidgetItem::setForeground() instead [-Wdeprecated-declarations] device.cpp:226:47: warning: ‘void QListWidgetItem::setTextColor(const QColor&)’ is deprecated: Use QListWidgetItem::setForeground() instead [-Wdeprecated-declarations] Change-Id: I673b786d2d7b76ca4a51ba8eaad231592f4ad4fd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix the BluetoothProfileDescriptorStructureAlex Blasche2018-10-151-3/+7
| | | | | | | | | | | As per spec this is meant to be a list/sequence within a sequence and the version was missing too. For simplicity version 1.0 is used. Fixes: QTBUG-58529 Change-Id: I57090148aadf60ea1fbbb207ff0a4ae61e06caf2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Remove unused snippet section markersAlex Blasche2018-10-151-3/+0
| | | | | | | This section is not used by any part of the documentation. Change-Id: I3cfc5ff187bfe43bbd75302b45b7dcc6eddb113c Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Fix a few clazy/clang warnings in HeartRate Game exampleAlex Blasche2018-09-058-29/+29
| | | | | Change-Id: I2a7b8c403ca466998ddcbd8496c31feb9856f0ad Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix failing restart of HeartRateServer exampleAlex Blasche2018-08-311-4/+7
| | | | | | | | Disconnecting from central devices invalidates the peripheral's service. The change ensures that the service is recreated upon disconnection. Change-Id: I2defc6ffb4c9f23d70b6f181c25f47746b3859a4 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-08-301-2/+6
|\ | | | | | | Change-Id: I20db491b185972148ad3fbe6953e5d6ce2889a7f
| * Provide more informative error messages in the BLE Scanner exampleShawn Rutledge2018-08-211-2/+6
| | | | | | | | | | | | | | | | | | QMetaEnum helps us avoid writing separate strings for each error description; it's not very verbose but it's way better than saying that most of the errors are "unknown". Change-Id: I61aaf3be6982a2987aabfa6be3192e1afb7df17a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Cleanup lowenergyscanner example with clang tidy and clazy helpAlex Blasche2018-08-249-45/+37
| | | | | | | | | | Change-Id: Iaaf169b1ac9b3d4c348d9cabf737b395198a921f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Remove direct usage of QLowEnergyController::ctorAlex Blasche2018-08-212-2/+2
| | | | | | | | | | | | | | | | QLowEnergyController::createCentral() is the official API to do the same. Change-Id: Idbd26d201b24add6697f6f9cdf1194511c160273 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Clean up btchat exampleOliver Wolff2018-08-169-70/+90
| | | | | | | | | | | | | | | | | | | | | | - Replace old connect syntax - Clean up includes - Replace 0 with nullptr - Add socket error handling Change-Id: Id4c7634db29a23184d3ce2d92ffa39c71505de12 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Replace foreach with for loop and set QT_NO_FOREACHOliver Wolff2018-08-153-4/+5
|/ | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.9' into 5.11Liang Qi2018-02-181-1/+1
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I5dcafa278c0c51bc3d540ab46320e5a21ef51115
| * Fix stalling at characteristics updating in Low Energy Scanner exampleDenis Shienkov2018-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The method device.connectToService() can be finished quickly and Device::characteristicsUpdated() can be triggered before than the Characteristics.qml page will be loaded. Therefore we will get stuck in "Scanning for characteristics..." state. So, we need to call the device.connectToService() after loading of the Characteristics.qml page. Change-Id: Ic5c790f6f8dbeeae1e368c8a1c8ad8fb12a57087 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-182-2/+3
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I6d2140aa8692bc7ce56f4366275fd02d008900f0
| * QtBluetooth: Fix heartrate-game for QT_PLATFORM_UIKITTimur Pocheptsov2018-01-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | QBluetoothLocalDevice::isValid() returns false for iOS/tvOS/watchOS (because Apple does not provide any public API/Framework to implement QBluetoothLocalDevice correctly). Make ConnectionHandler::alive return true for QT_PLATFORM_UIKIT. Task-number: QTBUG-65547 Change-Id: I219fbeadc752b815f8369d332c10a24e70150abb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Example heartrate-server needs only core and bluetooth modulePeter Seiderer2017-11-201-1/+1
| | | | | | | | | | | | | | | | Fixes compile with disabled gui module. Task-number: QTBUG-64597 Change-Id: I376dede3db987e524f97070344cc119e0ee1d187 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | qtlite: Skip building examples when configured with no-feature-itemviewsRainer Keller2018-01-123-0/+3
| | | | | | | | | | | | Task-number: QTBUG-53141 Change-Id: Id256f00349d8bee8e4176005eea3bcba595899a2 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>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-3086-217/+1077
|\| | | | | | | Change-Id: Iaa053dcb125490ee1e83d7e27cb75d4171297b9f
| * Fix outdated BSD license headerKai Koehne2017-10-1786-217/+1077
| | | | | | | | | | Change-Id: I28f5936913a6127806325df34af4bf71a142e72e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'gerrit/5.9' into 5.10v5.10.0-beta3Alex Blasche2017-10-1710-49/+49
|\| | | | | | | Change-Id: I84bfe86751c27eabb4e75912ae3c0b4d3781faf1
| * Fix outdated FDL license headerKai Koehne2017-10-1610-49/+49
| | | | | | | | | | Change-Id: Ia26b0bf499f8a0b6040e82bc1d460bee688bfbf6 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Rename qbluetoothglobal.h to qtbluetoothglobal.hOliver Wolff2017-08-305-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | ... and deprecate the former. By doing so we get the header file in line with other modules - see qtnetworkglobal.h for example. The include is not used in the examples so it is removed there. Change-Id: Ie6267738d4a45e45a0350d458a40654d8a952f4a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-0615-45/+127
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I7a55929aefa1f7a4dc96f841317b78b248899f67
| * lowenergyscanner: Use new connect syntaxOliver Wolff2017-07-041-18/+18
| | | | | | | | | | | | Change-Id: I87047bbc8b777f597ac4843c0c5466489d764f46 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Btchat example should be fullscreen on mobileAlex Blasche2017-06-291-0/+4
| | | | | | | | | | Change-Id: Ib311037a4ccf147dcd083ff13c327e29e0dc08f4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Adjust btchat example to Android UUID SDP discovery bugAlex Blasche2017-06-282-0/+15
| | | | | | | | | | | | Task-number: QTBUG-61392 Change-Id: Ia7d680a40b0fe359dfb5fe69ad9f3e83fe9ccb7d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Improve pingpong exampleAlex Blasche2017-06-284-21/+32
| | | | | | | | | | | | | | | | | | | | | | The following adjustments were done: - Use new Qt connect syntax - Add QLoggingCatergory enablers (easy to enable by uncommenting) - Makes the UI more robust to High vs Low DPI issues Change-Id: Iad99a67ac375de828883b4add99d440f7a6994c6 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * Adjust pingpong example to Android UUID SDP discovery bugAlex Blasche2017-06-233-1/+14
| | | | | | | | | | | | | | Task-number: QTBUG-61392 Change-Id: Ie2173b57093db9285e8fc90dbec66f81b002f7c6 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Adjust qml chat example to workaround required to Android SDP bugAlex Blasche2017-06-223-2/+21
| | | | | | | | | | | | | | Task-number: QTBUG-61542 Task-number: QTBUG-61392 Change-Id: Iff5c827d7ebb96dd29bc80f444d03804eddf405b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * Properly handle disconnect socket event in QML chat exampleAlex Blasche2017-06-202-2/+21
| | | | | | | | | | | | | | | | | | Prior to this change the state transtion of the BluetoothSocket instance was not distinguishing between the varios state types. It always assumes any state transtion was a transition to "Connected". Change-Id: I584b6c467dc77ac0602562d6792c16bf357d831c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Fix minor documentation issues in QML chat exampleAlex Blasche2017-06-202-1/+2
| | | | | | | | | | | | Change-Id: Iec4214e7f6d1aab9ea88e3d2fc5025a06b54b8e3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Use QRandomGenerator instead of q?randThiago Macieira2017-06-301-3/+4
|/ | | | | Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix failing heart-rate example on macOSv5.9.0-beta2Milla Pohjanheimo2017-04-131-1/+1
| | | | | | | | Add the missing 'defined' to deviceinfo.cpp to make the example to build on macOS. Change-Id: Ic632dcb1d3c47eb4af2c05324083143c9289f8f9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove heartlistener exampleAlex Blasche2017-04-0725-1895/+1
| | | | | | | | The heartrate game is the replacement example. Change-Id: Ib51be2467c49075d34e6bea003e69453f0801dfc Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Use heartrate-game example for snippets in BTLE overviewAlex Blasche2017-04-072-0/+21
| | | | | | | | | heartlistener example will be removed. Change-Id: Iaa5c5f629cf351b97c18f61b4fab2cbbd8d0744c Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add Logging category provisioning to heartrate-server exampleAlex Blasche2017-04-071-0/+2
| | | | | Change-Id: Id0d50632e27742ff3f0abaf752d109eeba72ad98 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Update heartrate-game against latest heartlistener exampleAlex Blasche2017-04-062-3/+5
| | | | | | | | | | | | | | | | | | This patch incorporates the following two heartlistener patch: 1750983d3f053316c735d602c7f9a1b56dc4462b b01389be13b40833fa3f50a862b164c5d8389d1a The above two patches were applied to the heartlistener example after the fork for the new heartrate-game example was done. This patch applies the missing two patches. The first patch restricts the communication to Low Energy devices The second patch ensures that the device properly disables the heartrate notifications on disconnect events. Change-Id: Ia2904f2ae3d5cef22abcc9815c5e0c342370e83c Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Remove not needed includes from heartrate-gameAlex Blasche2017-04-052-3/+0
| | | | | Change-Id: Ia52e491a26a621f8586c5c708ef5d7ef2191c345 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Permit BlueZ platforms to set the address type in heartrate-gameAlex Blasche2017-04-057-2/+84
| | | | | | | | | | | | | | | | | | BlueZ is the only platform that requires to set the BTLE address type. The patch introduces a new UI button which allows the user to toggle the address type. The UI element is disabled on all platforms but Linux/BlueZ systems. The number of devices returned in simulator mode is reduced to four devices. This was done purely for esthetical reasons as the additional address type button takes screen real estate away and five simulator devices require more screen real estate than the remaining space for device list. This avoid the need for scrolling. Change-Id: I14cf26b3c821db7768b9d018c2d09441cd97679a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add documentation for the HeartRate game exampleAlex Blasche2017-04-045-0/+86
| | | | | | | Change-Id: I0f0a82be359fc49becd1eccc67697d5177d73bb1 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Add means to enable simulator build with one easy defineAlex Blasche2017-04-048-15/+71
| | | | | | | Otherwise it is only enabled on Win32 builds Change-Id: I23ce25411294ebe2dae2272c16789da897b43e82 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Add new heartrate exampleAlex Blasche2017-04-0333-0/+2602
| | | | | | | | The example is a redesign by Lasse Räihä based in the heartrate-listener example. Change-Id: Iec0f48603408b37c7054839d520368eb1e436895 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Remove wrong attribute assignment from btchat exampleOliver Wolff2017-01-301-1/+0
| | | | | Change-Id: If6695194644fa0eceec80808115fd09af895a220 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Restrict the BTLE examples to Low Energy use casesAlex Blasche2016-12-072-2/+4
| | | | | | | | This change vastely descreases the search time. There is no need to perform a traditional SDP scan too. Change-Id: I63d7e16dca77fb1b1db42bb330f91e917a9dd054 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>