summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/heartrate-server
Commit message (Collapse)AuthorAgeFilesLines
* Correct license for examples filesLucie Gérard2024-04-041-1/+1
| | | | | | | | | | | | | According to QUIP-18 [1], all examples and snippets files should be LicenseRef-Qt-Commercial OR BSD-3-Clause [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9a8fdb5308396e63785486291c4dc41cd59c1fe4 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Examples: Use versioned CMake targets for Qt modulesKai Köhne2024-01-171-3/+3
| | | | | | | | Pick-to: 6.6 6.7 Task-number: QTBUG-113277 Change-Id: I4885e6df894e24c2fdacccc4e58530ee9b190968 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Examples: Use Qt's canonical CamelCase headersKai Köhne2024-01-101-15/+19
| | | | | | | | | These are the names also given in the online documentation, so let's use them in the examples. Pick-to: 6.7 Change-Id: Ia10af880a0f2495094a5eb626b568da670e2848d Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Doc: Tweak Qt Bluetooth example documentationKai Köhne2024-01-091-2/+4
| | | | | | | | | | Linkify Qt Bluetooth, and add tags. QtBluetooth will create a link to https://doc.qt.io/qt-6/qtbluetooth-module.html Pick-to: 6.6 6.7 Change-Id: I9da8bda1591fae26fbe0bde7ac86371af4b9e71c Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Make BlueZ DBus peripheral the default backend on LinuxJuha Vuolle2023-08-231-7/+0
| | | | | | | | | | | | | | | | | The DBus backend was introduced in Qt 6.5, and is intended as the eventual successor of the kernel backend. Users can opt-out and use the older kernel backend by setting the QT_BLUETOOTH_USE_KERNEL_PERIPHERAL environment variable. [ChangeLog][QtBluetooth] The default Linux peripheral implementation was changed from the kernel interface to the BlueZ DBus interface. The old implementation remains available by defining QT_BLUETOOTH_USE_KERNEL_PERIPHERAL as environment variable. Fixes: QTBUG-115925 Change-Id: I27d60e410c02d0435c7dce81e5c06448a89bcc65 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Doc: Use the \examplecategory macro to tag examplesTopi Reinio2023-04-111-1/+1
| | | | | | | | | | | | | | | | The '\meta category' command was used for tagging examples with a specific category, used in Qt Creators Welcome mode. As we want to also generate lists of examples belonging to a category elsewhere in the documentation, replace the command with a macro that expands to the original \meta command and also adds the example to a group using the \ingroup command. This way, the category names can be used as arguments to the \generatelist or \annotatedlist commands. Pick-to: 6.5 Task-number: QTBUG-112731 Change-Id: I1df2d3bd6f2ef904ac7bac4d606b93d3824a802a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix .plist when building an example for iOS with CMakeJuha Vuolle2023-03-303-47/+4
| | | | | | | | | | | | | | | | | | | | When building an example for iOS with qmake (qt-cmake -GXcode) the local Info.plists of three of the examples don't work, because they were using qmake substitutions (${EXECUTABLE_NAME} instead of ${MACOSX_BUNDLE_EXECUTABLE_NAME}), which resulted in "CFBundleExecutable is not specified". Instead use shared plist files, each for CMake and qmake. One of the removed files contained NSBluetoothPeripheralUsageDescription key, which I think can be discarded now; it is intended for iOS < 13, and the minimum for Qt 6 is 13. Pick-to: 6.5 Change-Id: I901dc176c001e25ce88d42b9456b6e16d8f43c20 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* HeartRate Server: revamp the exampleIvan Solovev2023-03-284-29/+44
| | | | | | | | | | | | | | | | | Some code clean-ups: * Use qt_standard_project_setup() and PRIVATE linking in CMake * Port away from QScopedPointer and use std::unique_ptr instead Documentation updates: * Add Connectivity category * Mention the new BlueZ D-Bus backend in the documentation * Small wording improvements * Provide more links to Qt classes and enums Task-number: QTBUG-111972 Pick-to: 6.5 6.5.0 Change-Id: Id2a0ef48d3ce82f1784dd4b51f94236731730432 Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
* Heartrate server: use permissions API to access BluetoothTimur Pocheptsov2023-03-034-9/+47
| | | | | | | | Add Bluetooth permission check/request to the heart-rate server's code. Task-number: QTBUG-109964 Change-Id: I7fc6a4cf6792e1aa223cc5dc4173963f995e305d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I8df2954bb61e0dc2a89f48c056b10a4bab395e0b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Bluetooth heartrate-server: Handle errorsFriedemann Kleint2022-08-173-3/+18
| | | | | | | | | | | | Make it a console application and terminate on errors, printing a message. This prevents it from silently hanging, locking up the libraries, on Windows. Pick-to: 6.4 6.3 Change-Id: Ie7d022a2b193cf2c320cb918d35ce2ad52b2ac48 Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
* Add license headers to cmake filesLucie Gérard2022-07-081-0/+3
| | | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: Ic31d264037cb00d72436d585820e45e4ccac5c60 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-102-75/+4
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Ifc22d8ae24532e9a1093ca613ed6590a1992bc39 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add bluetooth example app Qt::Gui linkage on iOSJuha Vuolle2022-03-181-2/+2
| | | | | | | Fixes: QTBUG-101720 Pick-to: 6.3 Change-Id: I5d6e1e51ef73521390a3903b8ff1f225ea5dfa83 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve examples CMakeLists.txtKai Köhne2022-02-211-9/+6
| | | | | | | | | | | | | | | | - Remove automatic use of CMAKE_AUTORCC - Only opt into CMAKE_AUTOUIC if .ui files are involved - Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR - Combine multiple find_package(Qt6 ... calls) - use REQUIRED COMPONENTS - sort components alphabetically - Fix wrong indentations - Use (only) one empty line after multi-line commands Pick-to: 6.3 Change-Id: If1935beb09edd873c45842ae06d0f41267a9b36a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* macOS specific Info.plist file for Bluetooth ExamplesJuha Vuolle2021-11-112-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | The default generated Info.plist is not enough as the Bluetooth examples require NSBluetoothAlwaysUsageDescription key to work. Without this patch on macOS 12 there are two possible outcomes: 1) If the example is built with qmake, the application will crash and the crash report will indicate that the key is missing 2) If the example is built with CMake, the application will not start as it tries to use iOS specific .plist file The patch uses absolute paths in the example CMakeLists.txt files to work around a Ninja bug: https://gitlab.kitware.com/cmake/cmake/-/issues/20181 Using relative paths resulted in "multiple rules generate" errors if the QtConnectivity module is built with examples. Note that the plist files are only effective if the application is started as an app bundle, ie. not if launching the contained binary directly. Pick-to: 6.2 Task-number: QTBUG-98090 Change-Id: Iedb7eabbb8fde6ad1ba14ada1a7ee87ec1d708ba Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Bluetooth (examples): update CMakeLists.txt to include Info.plistTimur Pocheptsov2021-09-101-0/+7
| | | | | | | | Pick-to: 6.2 Change-Id: I87097dc605ff34db1f8d7fb92d055402693906e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Heart-rate example: add a proper Info.plistTimur Pocheptsov2021-09-072-0/+45
| | | | | | | | | | | Apple (iOS) requires a "proper" Info.plist entries, explaining _why_ we want to use Bluetooth on this particular device. So, let's add it. Both the server and game apps need it. Fixes: QTBUG-93991 Pick-to: 5.15 6.2 Change-Id: I09133c6714f30bc402049cd40969a9b9644a0b4f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-171-1/+1
| | | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I2ae5ba6164cb5ed450c8924d484d30167461c10d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Use scoped enum for constants in QBluetoothUuidAndreas Buhr2021-03-111-5/+5
| | | | | | | | | | | | QBluetoothUuid contains enums for ProtocolUuid, ServiceClassUuid, CharacteristicType and DescriptorType. So far, they all put their constants directly into the QBluetoothUuid namespace, making it easy to mix them up. This patch changes those to scoped enums. That way, each enum has its items in its own namespace. Change-Id: I86ea08ff31009dc8073d84cfe678e27920d693f7 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Unify logging preparation across bluetooth examplesAndreas Buhr2021-02-251-1/+1
| | | | | | | | This patch streamlines all bluetooth examples to have logging prepared, but not activated, in main(). Change-Id: Idbc81e2937c56acdc17c8fb81de2b8afe384608d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix Android build of heartrate-serverAndreas Buhr2021-02-231-0/+3
| | | | | | | | | The heartrate-server example links Qt::Gui on Android. But Qt::Gui was not found using find_package. This patch adds the missing find_package() call Change-Id: I54e98f4959964c8730cdddda6ef8a6d4501ec866 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove all *.pro files and all "special case" markers in CMakeLists.txtAndreas Buhr2021-01-151-2/+0
| | | | | | | | | | | | To use CMake only in the future to build QtConnectivity, all the traces from the qmake->CMake conversion can now be removed. This patch deletes all ".prev_CMakeLists.txt" files, in deletes all "*.pro" files and it removes all "special case" markers in CMakeLists.txt files. "special case" in "*.cmake" files are kept. Change-Id: Ia0f5d4de5d77b9f2e5cc8d97fc8f04077e042a6f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Update CMake scripts in QtConnectivityAndreas Buhr2020-12-211-0/+4
| | | | | | | | | Recreated all CMake files in QtConnectivity using run_pro2cmake.py . --only-existing -- --api-version 3 Furthermore, port bttestui to CMake. Change-Id: Idb55f1b4c1cff30d7824a42e3ee6923c39e698df Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate examples to use qt_add_executableAlexandru Croitor2020-10-201-2/+12
| | | | | | Task-number: QTBUG-87661 Change-Id: Ib6722991251673c6531667cb6b318b0531df5cda Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/wip/cmake' into devOliver Wolff2020-07-031-0/+29
|\ | | | | | | Change-Id: Icb3abdf0b150b5b09c13f4b054b402ba5b6a9684
| * Port qtconnectivity to cmakeOliver Wolff2019-10-241-0/+29
| | | | | | | | | | | | | | | | | | | | Also removed dependencies.yaml at the same time, as the new dependency tracking is not used in wip/cmake at the moment. Task-number: QTBUG-78181 Change-Id: I39c23da8daeedd86b7720d66d48ab0af3762083c Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | "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>
* 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>
* 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>
* Fix outdated BSD license headerKai Koehne2017-10-171-3/+13
| | | | | Change-Id: I28f5936913a6127806325df34af4bf71a142e72e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix outdated FDL license headerKai Koehne2017-10-161-5/+5
| | | | | Change-Id: Ia26b0bf499f8a0b6040e82bc1d460bee688bfbf6 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove heartlistener exampleAlex Blasche2017-04-071-1/+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>
* Add Logging category provisioning to heartrate-server exampleAlex Blasche2017-04-071-0/+2
| | | | | Change-Id: Id0d50632e27742ff3f0abaf752d109eeba72ad98 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Add example for Bluetooth Peripheral functionality.Christian Kandeler2016-01-263-0/+246
Change-Id: I1b48bc0be6265fb033fa2c14c2b7a182966fe2a2 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>