Sophie

Sophie

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

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" />
<!-- bluetooth-index.qdoc -->
  <title>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 >Qt Bluetooth</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.12.6 Reference Documentation</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="#overview">Overview</a></li>
<li class="level1"><a href="#getting-started">Getting Started</a></li>
<li class="level1"><a href="#related-information">Related Information</a></li>
<li class="level2"><a href="#building-qt-bluetooth">Building Qt Bluetooth</a></li>
<li class="level2"><a href="#guides">Guides</a></li>
<li class="level2"><a href="#reference">Reference</a></li>
<li class="level2"><a href="#logging-categories">Logging Categories</a></li>
<li class="level2"><a href="#examples">Examples</a></li>
<li class="level1"><a href="#licenses-and-attributions">Licenses and Attributions</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Qt Bluetooth</h1>
<span class="subtitle"></span>
<!-- $$$qtbluetooth-index.html-description -->
<div class="descr"> <a name="details"></a>
<p>The Bluetooth API provides connectivity between Bluetooth enabled devices.</p>
<p>Currently, the API is supported on the following platforms:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >API Feature</th><th >Android</th><th >iOS</th><th >Linux (BlueZ 4.x/5.x)</th><th >macOS</th><th >WinRT</th><th >Win32</th></tr></thead>
<tr valign="top" class="odd"><td >Classic Bluetooth</td><td >x</td><td ></td><td >x</td><td >x</td><td >x</td><td ></td></tr>
<tr valign="top" class="even"><td >Bluetooth LE Central</td><td >x</td><td >x</td><td >x</td><td >x</td><td >x</td><td ></td></tr>
<tr valign="top" class="odd"><td >Bluetooth LE Peripheral</td><td >x</td><td >x</td><td >x</td><td >x</td><td ></td><td ></td></tr>
<tr valign="top" class="even"><td >Bluetooth LE Advertisement &amp; Scanning</td><td ></td><td ></td><td ></td><td ></td><td ></td><td ></td></tr>
</table></div>
<p>Despite there not being a Win32 port yet, the WinRT backend is automatically used if the win32 target platform supports the required WinRT APIs. Minimal requirement is Windows 10 version 1507 with slightly improved service discovery since Windows 10 version 1607. Therefore Windows 7 and 8.x targets are excluded.</p>
<a name="overview"></a>
<h2 id="overview">Overview</h2>
<p>Bluetooth is a short-range (less than 100 meters) wireless technology. It has a reasonably high data transfer rate of 2.1 Mbit/s, which makes it ideal for transferring data between devices. Bluetooth connectivity is based on basic device management, such as scanning for devices, gathering information about them, and exchanging data between them.</p>
<p>Qt Bluetooth supports Bluetooth Low Energy development for client/central role use cases. Further details can be found in the <a href="qtbluetooth-le-overview.html">Bluetooth Low Energy Overview</a> section.</p>
<p>A new addition since the Qt Bluetooth 5.7 release covers support for Bluetooth Low Energy applications performing the peripheral/server role. This new API remains in Technology Preview.</p>
<a name="getting-started"></a>
<h2 id="getting-started">Getting Started</h2>
<p>To use the C++ library in your application, add the following configuration option to your <code>.pro</code> file:</p>
<pre class="cpp">

  QT += bluetooth

</pre>
<p>To use the classes of the module in your application you need the following import statement in your <code>.qml</code> file:</p>
<pre class="qml">

  import QtBluetooth 5.12

</pre>
<a name="related-information"></a>
<h2 id="related-information">Related Information</h2>
<a name="building-qt-bluetooth"></a>
<h3 id="building-qt-bluetooth">Building Qt Bluetooth</h3>
<p>Despite the fact that the module can be built for all Qt platforms, the module is not ported to all of them. Not supported platforms such as Windows desktop employ a fake or dummy backend which is automatically selected when the platform is not supported. The dummy backend reports appropriate error messages and values which allow the Qt Bluetooth developer to detect at runtime that the current platform is not supported. The dummy backend is also selected on Linux if <a href="qtbluetooth-attribution-bluez.html">BlueZ</a> development headers are not found during build time or Qt was built without Qt D-Bus support.</p>
<p>The usage of the dummy backend is highlighted via an appropriate warning while building and running.</p>
<a name="guides"></a>
<h3 id="guides">Guides</h3>
<ul>
<li><a href="qtbluetooth-overview.html">Classic Bluetooth Overview</a></li>
<li><a href="qtbluetooth-le-overview.html">Bluetooth Low Energy Overview</a></li>
</ul>
<a name="reference"></a>
<h3 id="reference">Reference</h3>
<ul>
<li><a href="qtbluetooth-qmlmodule.html">QML Types</a></li>
<li><a href="qtbluetooth-module.html">C++ Classes</a></li>
</ul>
<a name="logging-categories"></a>
<h3 id="logging-categories">Logging Categories</h3>
<p>The <a href="qtbluetooth-qmlmodule.html">QtBluetooth</a> module exports the following logging categories:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Logging Category</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td >qt.bluetooth</td><td >Enables logging of cross platform code path in <a href="qtbluetooth-qmlmodule.html">QtBluetooth</a></td></tr>
<tr valign="top" class="even"><td >qt.bluetooth.android</td><td >Enables logging of the Android implementation</td></tr>
<tr valign="top" class="odd"><td >qt.bluetooth.bluez</td><td >Enables logging of the <a href="qtbluetooth-attribution-bluez.html#bluez">BLuez</a>/Linux implementation</td></tr>
<tr valign="top" class="even"><td >qt.bluetooth.ios</td><td >Enables logging of the iOS implementation</td></tr>
<tr valign="top" class="odd"><td >qt.bluetooth.osx</td><td >Enables logging of the macOS implementation</td></tr>
<tr valign="top" class="even"><td >qt.bluetooth.qml</td><td >Enables logging of the <a href="qtbluetooth-qmlmodule.html">QtBluetooth</a> QML implementation</td></tr>
<tr valign="top" class="odd"><td >qt.bluetooth.winrt</td><td >Enables logging of the WinRT implementation</td></tr>
</table></div>
<p>Logging categories can be used to enable additional warning and debug output for <a href="qtbluetooth-qmlmodule.html">QtBluetooth</a>. More detailed information about logging can be found in QLoggingCategory. A quick way to enable all <a href="qtbluetooth-qmlmodule.html">QtBluetooth</a> logging is to add the following line to the <code>main()</code> function:</p>
<pre class="cpp">

  <span class="type">QLoggingCategory</span><span class="operator">::</span>setFilterRules(<span class="type">QStringLiteral</span>(<span class="string">&quot;qt.bluetooth* = true&quot;</span>));

</pre>
<a name="examples"></a>
<h3 id="examples">Examples</h3>
<ul>
<li>QML<ul>
<li><a href="qtbluetooth-scanner-example.html">QML Bluetooth Scanner</a></li>
<li><a href="qtbluetooth-picturetransfer-example.html">QML Bluetooth Picture Push</a></li>
<li><a href="qtbluetooth-pingpong-example.html">QML Bluetooth PingPong</a></li>
<li><a href="qtbluetooth-chat-example.html">QML Bluetooth Chat</a></li>
<li><a href="qtbluetooth-heartrate-game-example.html">Bluetooth Low Energy Heart Rate Game</a></li>
<li><a href="qtbluetooth-heartrate-server-example.html">Bluetooth Low Energy Heart Rate Server</a></li>
<li><a href="qtbluetooth-lowenergyscanner-example.html">Bluetooth Low Energy Scanner</a></li>
</ul>
</li>
<li>C++<ul>
<li><a href="qtbluetooth-btchat-example.html">Bluetooth Chat</a></li>
<li><a href="qtbluetooth-btscanner-example.html">Bluetooth Scanner</a></li>
<li><a href="qtbluetooth-btfiletransfer-example.html">Bluetooth File Transfer</a></li>
</ul>
</li>
</ul>
<a name="licenses-and-attributions"></a>
<h2 id="licenses-and-attributions">Licenses and Attributions</h2>
<p>Qt Bluetooth is available under commercial licenses from The Qt Company. In addition, it is available under the GNU Lesser General Public License, version 3, or the GNU General Public License, version 2. See Qt Licensing for further details.</p>
<p>On Linux, Qt Bluetooth uses a separate executable, <code>sdpscanner</code>, to integrate with the official Linux bluetooth protocol stack <a href="qtbluetooth-attribution-bluez.html">BlueZ</a>. <a href="qtbluetooth-attribution-bluez.html">BlueZ</a> is available under the GNU General Public License, version 2.</p>
<div class="table"><table class="annotated">
<tr class="odd topAlign"><td class="tblName"><p><a href="qtbluetooth-attribution-bluez.html">BlueZ</a></p></td><td class="tblDescr"><p>GNU General Public License v2.0 only (This does not force user code to be GPL'ed. For more info see details.)</p></td></tr>
</table></div>
</div>
<!-- @@@qtbluetooth-index.html -->
        </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>