Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 814a2b4c48f3ef6444b2ff5bf854d05a > files > 173

qtconnectivity5-doc-5.12.6-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- heartrate-game.qdoc -->
  <title>Bluetooth Low Energy Heart Rate Game | Qt Bluetooth 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtbluetooth-index.html">Qt Bluetooth</a></td><td >Bluetooth Low Energy Heart Rate Game</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtbluetooth-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#running-the-example">Running the Example</a></li>
<li class="level1"><a href="#visual-tour">Visual Tour</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Bluetooth Low Energy Heart Rate Game</h1>
<span class="subtitle"></span>
<!-- $$$heartrate-game-brief -->
<p>A game demonstrating the interaction with a Bluetooth Low Energy Heart Rate device/service.</p>
<!-- @@@heartrate-game -->
<!-- $$$heartrate-game-description -->
<div class="descr"> <a name="details"></a>
<p>The Bluetooth Low Energy Heart Rate Game shows how to develop a Bluetooth Low Energy application using the Qt Bluetooth API. The application covers the scanning for Bluetooth Low Energy devices, connecting to a Heart Rate service on the device, writing characteristics and descriptors, and receiving updates from the device once the heart rate has changed.</p>
<p class="centerAlign"><img src="images/heartgame-start.png" alt="" /></p><p>The example introduces the following Qt classes:</p>
<ul>
<li><a href="qlowenergycontroller.html">QLowEnergyController</a></li>
<li><a href="qlowenergyservice.html">QLowEnergyService</a></li>
<li><a href="qlowenergycharacteristic.html">QLowEnergyCharacteristic</a></li>
<li><a href="qlowenergydescriptor.html">QLowEnergyDescriptor</a></li>
</ul>
<p>A Bluetooth Low Energy device with a Heart Rate service is required for this application to work. An alternative might be a programmable Bluetooth Low Energy device which might simulate the service. You can also use the <a href="qtbluetooth-heartrate-server-example.html">Heart Rate server</a> example for that purpose. If no such device can be found, the example uses a demo mode which creates and displays random values.</p>
<p>The goal of the game is to increase the measured heart rate as much as possible.</p>
<p>The <a href="qtbluetooth-lowenergyscanner-example.html">Bluetooth Low Energy Scanner</a> example might be more suitable if a heart rate device is not available. The scanner example works with any type of Bluetooth Low Energy peripheral device.</p>
<a name="running-the-example"></a>
<h2 id="running-the-example">Running the Example</h2>
<p>To run the example from Qt Creator, open the <b>Welcome</b> mode and select the example from <b>Examples</b>. For more information, visit Building and Running an Example.</p>
<a name="visual-tour"></a>
<h2 id="visual-tour">Visual Tour</h2>
<p>The application searches for all Bluetooth Low Energy peripheral devices in the vicinity. It is assumed that the remote devices advertise their presence. The found devices are presented in a list. Note that all found Bluetooth Low Energy devices are listed even if they do not offer a Heart Rate service.</p>
<p class="centerAlign"><img src="images/heartgame-search.png" alt="" /></p><p>After the user has selected a target device, the example connects to its Heart Rate service if one is available. It automatically enables notification updates for the Heart Rate value and presents the current value on the screen.</p>
<p class="centerAlign"><img src="images/heartgame-running.png" alt="" /></p><p>Once the monitoring process is canceled, a small graph presents a summary of the received values.</p>
<p class="centerAlign"><img src="images/heartgame-result.png" alt="" /></p><p>Files:</p>
<ul>
<li><a href="qtbluetooth-heartrate-game-bluetoothbaseclass-cpp.html">heartrate-game/bluetoothbaseclass.cpp</a></li>
<li><a href="qtbluetooth-heartrate-game-bluetoothbaseclass-h.html">heartrate-game/bluetoothbaseclass.h</a></li>
<li><a href="qtbluetooth-heartrate-game-connectionhandler-cpp.html">heartrate-game/connectionhandler.cpp</a></li>
<li><a href="qtbluetooth-heartrate-game-connectionhandler-h.html">heartrate-game/connectionhandler.h</a></li>
<li><a href="qtbluetooth-heartrate-game-devicefinder-cpp.html">heartrate-game/devicefinder.cpp</a></li>
<li><a href="qtbluetooth-heartrate-game-devicefinder-h.html">heartrate-game/devicefinder.h</a></li>
<li><a href="qtbluetooth-heartrate-game-devicehandler-cpp.html">heartrate-game/devicehandler.cpp</a></li>
<li><a href="qtbluetooth-heartrate-game-devicehandler-h.html">heartrate-game/devicehandler.h</a></li>
<li><a href="qtbluetooth-heartrate-game-deviceinfo-cpp.html">heartrate-game/deviceinfo.cpp</a></li>
<li><a href="qtbluetooth-heartrate-game-deviceinfo-h.html">heartrate-game/deviceinfo.h</a></li>
<li><a href="qtbluetooth-heartrate-game-heartrate-game-pro.html">heartrate-game/heartrate-game.pro</a></li>
<li><a href="qtbluetooth-heartrate-game-heartrate-global-h.html">heartrate-game/heartrate-global.h</a></li>
<li><a href="qtbluetooth-heartrate-game-images-qrc.html">heartrate-game/images.qrc</a></li>
<li><a href="qtbluetooth-heartrate-game-main-cpp.html">heartrate-game/main.cpp</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-qrc.html">heartrate-game/qml.qrc</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-app-qml.html">heartrate-game/qml/App.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-bluetoothalarmdialog-qml.html">heartrate-game/qml/BluetoothAlarmDialog.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-bottomline-qml.html">heartrate-game/qml/BottomLine.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-connect-qml.html">heartrate-game/qml/Connect.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-gamebutton-qml.html">heartrate-game/qml/GameButton.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-gamepage-qml.html">heartrate-game/qml/GamePage.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-gamesettings-qml.html">heartrate-game/qml/GameSettings.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-measure-qml.html">heartrate-game/qml/Measure.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-splashscreen-qml.html">heartrate-game/qml/SplashScreen.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-stats-qml.html">heartrate-game/qml/Stats.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-statslabel-qml.html">heartrate-game/qml/StatsLabel.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-titlebar-qml.html">heartrate-game/qml/TitleBar.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-main-qml.html">heartrate-game/qml/main.qml</a></li>
<li><a href="qtbluetooth-heartrate-game-qml-qmldir.html">heartrate-game/qml/qmldir</a></li>
</ul>
<p>Images:</p>
<ul>
<li><a href="images/used-in-examples/heartrate-game/qml/images/bt_off_to_on.png">heartrate-game/qml/images/bt_off_to_on.png</a></li>
<li><a href="images/used-in-examples/heartrate-game/qml/images/heart.png">heartrate-game/qml/images/heart.png</a></li>
<li><a href="images/used-in-examples/heartrate-game/qml/images/logo.png">heartrate-game/qml/images/logo.png</a></li>
</ul>
</div>
<!-- @@@heartrate-game -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>