Sophie

Sophie

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

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" />
<!-- qdeclarativebluetoothsocket.cpp -->
  <title>BluetoothSocket QML Type | 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 ><a href="qtbluetooth-qmlmodule.html">QML Types</a></td><td >BluetoothSocket QML Type</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="#properties">Properties</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">BluetoothSocket QML Type</h1>
<span class="subtitle"></span>
<!-- $$$BluetoothSocket-brief -->
<p>Enables connecting and communicating with a Bluetooth service or device. <a href="#details">More...</a></p>
<!-- @@@BluetoothSocket -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtBluetooth 5.12</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 5.2</td></tr></table></div><ul>
<li><a href="qml-qtbluetooth-bluetoothsocket-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtbluetooth-bluetoothsocket.html#connected-prop">connected</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtbluetooth-bluetoothsocket.html#error-prop">error</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtbluetooth-bluetoothsocket.html#service-prop">service</a></b></b> : BluetoothService</li>
<li class="fn"><b><b><a href="qml-qtbluetooth-bluetoothsocket.html#state-prop">state</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtbluetooth-bluetoothsocket.html#stringData-prop">stringData</a></b></b> : string</li>
</ul>
<!-- $$$BluetoothSocket-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p>It allows a QML class connect to another Bluetooth device and exchange strings with it. Data is sent and received using a QDataStream object allowing type safe transfers of QStrings. QDataStream is a well known format and can be decoded by non-Qt applications. Note that for the ease of use, <a href="qml-qtbluetooth-bluetoothsocket.html">BluetoothSocket</a> is only well suited for use with strings. If you want to use a binary protocol for your application's communication you should consider using its C++ counterpart <a href="qbluetoothsocket.html">QBluetoothSocket</a>.</p>
<p>Connections to remote devices can be over RFCOMM or L2CAP. Either the remote port or service UUID is required. This is specified by creating a <a href="qml-qtbluetooth-bluetoothservice.html">BluetoothService</a>, or passing in the service return from <a href="qml-qtbluetooth-bluetoothdiscoverymodel.html">BluetoothDiscoveryModel</a>.</p>
<p><b>See also </b><a href="qbluetoothsocket.html">QBluetoothSocket</a> and QDataStream.</p>
<!-- @@@BluetoothSocket -->
<h2>Property Documentation</h2>
<!-- $$$connected -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="connected-prop">
<td class="tblQmlPropNode"><p>
<a name="connected-prop"></a><span class="name">connected</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the connection state of the socket. If the socket is connected to peer, it returns true. It can be set true or false to control the connection. When set to true, the property will not return true until the connection is established.</p>
</div></div><!-- @@@connected -->
<br/>
<!-- $$$error -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="error-prop">
<td class="tblQmlPropNode"><p>
<a name="error-prop"></a><span class="name">error</span> : <span class="type">enumeration</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the last error that happened.</p>
<ul>
<li><code>NoError</code></li>
<li><code>UnknownSocketError</code></li>
<li><code>HostNotFoundError</code></li>
<li><code>ServiceNotFoundError</code></li>
<li><code>NetworkError</code></li>
<li><code>UnsupportedProtocolError</code></li>
<li><code>RemoteHostClosedError</code></li>
</ul>
<p>The errors are derived from <a href="qbluetoothsocket.html#SocketError-enum">QBluetoothSocket::SocketError</a>. This property is read-only.</p>
</div></div><!-- @@@error -->
<br/>
<!-- $$$service -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="service-prop">
<td class="tblQmlPropNode"><p>
<a name="service-prop"></a><span class="name">service</span> : <span class="type"><a href="qml-qtbluetooth-bluetoothservice.html">BluetoothService</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the details of the remote service to connect to. It can be set to a static <a href="qml-qtbluetooth-bluetoothservice.html">BluetoothService</a> with a fixed description, or a service returned by service discovery.</p>
</div></div><!-- @@@service -->
<br/>
<!-- $$$state -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="state-prop">
<td class="tblQmlPropNode"><p>
<a name="state-prop"></a><span class="name">state</span> : <span class="type">enumeration</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the current state of the socket.</p>
<ul>
<li><code>NoServiceSet</code></li>
<li><code>Unconnected</code></li>
<li><code>ServiceLookup</code></li>
<li><code>Connecting</code></li>
<li><code>Connected</code></li>
<li><code>Closing</code></li>
<li><code>Listening</code></li>
<li><code>Bound</code></li>
</ul>
<p>The states (except <code>NoServiceSet</code>) are derived from <a href="qbluetoothsocket.html#SocketState-enum">QBluetoothSocket::SocketState</a>. This property is read-only. <code>NoServiceSet</code> indicates that the socket state is not yet available due to the <a href="qml-qtbluetooth-bluetoothsocket.html#service-prop">service</a> not being set yet.</p>
</div></div><!-- @@@state -->
<br/>
<!-- $$$stringData -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="stringData-prop">
<td class="tblQmlPropNode"><p>
<a name="stringData-prop"></a><span class="name">stringData</span> : <span class="type">string</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property receives or sends data to a remote Bluetooth device. Arrival of data can be detected by connecting to this properties changed signal and can be read via stringData. Setting stringData will transmit the string. If excessive amounts of data are sent, the function may block sending. Reading will never block.</p>
</div></div><!-- @@@stringData -->
<br/>
        </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>