Sophie

Sophie

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

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" />
<!-- qnearfieldtarget.cpp -->
  <title>QNearFieldTarget Class | Qt NFC 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="qtnfc-index.html">Qt NFC</a></td><td ><a href="qtnfc-module.html">C++ Classes</a></td><td >QNearFieldTarget</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtnfc-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="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</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">QNearFieldTarget Class</h1>
<!-- $$$QNearFieldTarget-brief -->
<p>The <a href="qnearfieldtarget.html">QNearFieldTarget</a> class provides an interface for communicating with a target device. <a href="#details">More...</a></p>
<!-- @@@QNearFieldTarget -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QNearFieldTarget&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += nfc</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="qnearfieldtarget-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget-requestid.html">RequestId</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget-requestidprivate.html">RequestIdPrivate</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#AccessMethod-enum">AccessMethod</a></b> { UnknownAccess, NdefAccess, TagTypeSpecificAccess, LlcpAccess }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#AccessMethod-enum">AccessMethods</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#Error-enum">Error</a></b> { NoError, UnknownError, UnsupportedError, TargetOutOfRangeError, ..., CommandError }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#Type-enum">Type</a></b> { ProprietaryTag, NfcTagType1, NfcTagType2, NfcTagType3, NfcTagType4, MifareTag }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#QNearFieldTarget">QNearFieldTarget</a></b>(QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#dtor.QNearFieldTarget">~QNearFieldTarget</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QNearFieldTarget::AccessMethods </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#accessMethods">accessMethods</a></b>() const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#disconnect">disconnect</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#hasNdefMessage">hasNdefMessage</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#isProcessingCommand">isProcessingCommand</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#keepConnection">keepConnection</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#maxCommandLength">maxCommandLength</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QNearFieldTarget::RequestId </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#readNdefMessages">readNdefMessages</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#requestResponse">requestResponse</a></b>(const QNearFieldTarget::RequestId &amp;<i>id</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QNearFieldTarget::RequestId </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#sendCommand">sendCommand</a></b>(const QByteArray &amp;<i>command</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QNearFieldTarget::RequestId </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#sendCommands">sendCommands</a></b>(const QList&lt;QByteArray&gt; &amp;<i>commands</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#setKeepConnection">setKeepConnection</a></b>(bool <i>isPersistent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#setResponseForRequest">setResponseForRequest</a></b>(const QNearFieldTarget::RequestId &amp;<i>id</i>, const QVariant &amp;<i>response</i>, bool <i>emitRequestCompleted</i> = true)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QNearFieldTarget::Type </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#type">type</a></b>() const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#uid">uid</a></b>() const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QUrl </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#url">url</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#waitForRequestCompleted">waitForRequestCompleted</a></b>(const QNearFieldTarget::RequestId &amp;<i>id</i>, int <i>msecs</i> = 5000)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QNearFieldTarget::RequestId </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#writeNdefMessages">writeNdefMessages</a></b>(const QList&lt;QNdefMessage&gt; &amp;<i>messages</i>)</td></tr>
</table></div>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#disconnected">disconnected</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#error">error</a></b>(QNearFieldTarget::Error <i>error</i>, const QNearFieldTarget::RequestId &amp;<i>id</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#ndefMessageRead">ndefMessageRead</a></b>(const QNdefMessage &amp;<i>message</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#ndefMessagesWritten">ndefMessagesWritten</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#requestCompleted">requestCompleted</a></b>(const QNearFieldTarget::RequestId &amp;<i>id</i>)</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<a name="protected-functions"></a>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#handleResponse">handleResponse</a></b>(const QNearFieldTarget::RequestId &amp;<i>id</i>, const QByteArray &amp;<i>response</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#reportError">reportError</a></b>(QNearFieldTarget::Error <i>error</i>, const QNearFieldTarget::RequestId &amp;<i>id</i>)</td></tr>
</table></div>
<a name="related-non-members"></a>
<h2 id="related-non-members">Related Non-Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> quint16 </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#qNfcChecksum">qNfcChecksum</a></b>(const char *<i>data</i>, uint <i>len</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QNearFieldTarget-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qnearfieldtarget.html">QNearFieldTarget</a> class provides an interface for communicating with a target device.</p>
<p><a href="qnearfieldtarget.html">QNearFieldTarget</a> provides a generic interface for communicating with an NFC target device. Both NFC Forum devices and NFC Forum Tag targets are supported by this class. All target specific classes subclass this class.</p>
<p>The <a href="qnearfieldtarget.html#type">type</a>() function can be used to get the type of the target device. The <a href="qnearfieldtarget.html#uid">uid</a>() function returns the unique identifier of the target. The <a href="qnearfieldtarget.html#AccessMethod-enum">AccessMethods</a> flags returns from the <a href="qnearfieldtarget.html#accessMethods">accessMethods</a>() function can be tested to determine which access methods are supported by the target.</p>
<p>If the target supports <a href="qnearfieldtarget.html#AccessMethod-enum">NdefAccess</a>, <a href="qnearfieldtarget.html#hasNdefMessage">hasNdefMessage</a>() can be called to test if the target has a stored NDEF message, <a href="qnearfieldtarget.html#readNdefMessages">readNdefMessages</a>() and <a href="qnearfieldtarget.html#writeNdefMessages">writeNdefMessages</a>() functions can be used to get and set the NDEF message.</p>
<p>If the target supports <a href="qnearfieldtarget.html#AccessMethod-enum">TagTypeSpecificAccess</a>, <a href="qnearfieldtarget.html#sendCommand">sendCommand</a>() can be used to send a single proprietary command to the target and retrieve the response. <a href="qnearfieldtarget.html#sendCommands">sendCommands</a>() can be used to send multiple proprietary commands to the target and retrieve all of the responses.</p>
<p>If the target supports <a href="qnearfieldtarget.html#AccessMethod-enum">LlcpAccess</a>, the QLlcpSocket class can be used to connected to a service provided by the target.</p>
</div>
<!-- @@@QNearFieldTarget -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$AccessMethod$$$UnknownAccess$$$NdefAccess$$$TagTypeSpecificAccess$$$LlcpAccess -->
<h3 class="flags" id="AccessMethod-enum"><a name="AccessMethod-enum"></a>enum QNearFieldTarget::<span class="name">AccessMethod</span><br/>flags QNearFieldTarget::<span class="name">AccessMethods</span></h3>
<p>This enum describes the access methods a near field target supports.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::UnknownAccess</code></td><td class="topAlign tblval"><code>0x00</code></td><td class="topAlign">The target supports an unknown access type.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::NdefAccess</code></td><td class="topAlign tblval"><code>0x01</code></td><td class="topAlign">The target supports reading and writing NDEF messages using <a href="qnearfieldtarget.html#readNdefMessages">readNdefMessages</a>() and <a href="qnearfieldtarget.html#writeNdefMessages">writeNdefMessages</a>().</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::TagTypeSpecificAccess</code></td><td class="topAlign tblval"><code>0x02</code></td><td class="topAlign">The target supports sending tag type specific commands using <a href="qnearfieldtarget.html#sendCommand">sendCommand</a>() and <a href="qnearfieldtarget.html#sendCommands">sendCommands</a>().</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::LlcpAccess</code></td><td class="topAlign tblval"><code>0x04</code></td><td class="topAlign">The target supports peer-to-peer LLCP communication.</td></tr>
</table></div>
<p>The AccessMethods type is a typedef for <a href="">QFlags</a>&lt;AccessMethod&gt;. It stores an OR combination of AccessMethod values.</p>
<!-- @@@AccessMethod -->
<!-- $$$Error$$$NoError$$$UnknownError$$$UnsupportedError$$$TargetOutOfRangeError$$$NoResponseError$$$ChecksumMismatchError$$$InvalidParametersError$$$NdefReadError$$$NdefWriteError$$$CommandError -->
<h3 class="fn" id="Error-enum"><a name="Error-enum"></a>enum QNearFieldTarget::<span class="name">Error</span></h3>
<p>This enum describes the error codes that a near field target reports.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::NoError</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">No error has occurred.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::UnknownError</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">An unidentified error occurred.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::UnsupportedError</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The requested operation is unsupported by this near field target.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::TargetOutOfRangeError</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The target is no longer within range.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::NoResponseError</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">The target did not respond.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::ChecksumMismatchError</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">The checksum has detected a corrupted response.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::InvalidParametersError</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">Invalid parameters were passed to a tag type specific function.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::NdefReadError</code></td><td class="topAlign tblval"><code>7</code></td><td class="topAlign">Failed to read NDEF messages from the target.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::NdefWriteError</code></td><td class="topAlign tblval"><code>8</code></td><td class="topAlign">Failed to write NDEF messages to the target.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::CommandError</code></td><td class="topAlign tblval"><code>9</code></td><td class="topAlign">Failed to send a command to the target.</td></tr>
</table></div>
<!-- @@@Error -->
<!-- $$$Type$$$ProprietaryTag$$$NfcTagType1$$$NfcTagType2$$$NfcTagType3$$$NfcTagType4$$$MifareTag -->
<h3 class="fn" id="Type-enum"><a name="Type-enum"></a>enum QNearFieldTarget::<span class="name">Type</span></h3>
<p>This enum describes the type of tag the target is detected as.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::ProprietaryTag</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">An unidentified proprietary target tag.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::NfcTagType1</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">An NFC tag type 1 target.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::NfcTagType2</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">An NFC tag type 2 target.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::NfcTagType3</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">An NFC tag type 3 target.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::NfcTagType4</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">An NFC tag type 4 target.</td></tr>
<tr><td class="topAlign"><code>QNearFieldTarget::MifareTag</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">A Mifare target.</td></tr>
</table></div>
<!-- @@@Type -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QNearFieldTarget[overload1]$$$QNearFieldTargetQObject* -->
<h3 class="fn" id="QNearFieldTarget"><a name="QNearFieldTarget"></a>QNearFieldTarget::<span class="name">QNearFieldTarget</span>(<span class="type">QObject</span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a new near field target with <i>parent</i>.</p>
<!-- @@@QNearFieldTarget -->
<!-- $$$~QNearFieldTarget[overload1]$$$~QNearFieldTarget -->
<h3 class="fn" id="dtor.QNearFieldTarget"><a name="dtor.QNearFieldTarget"></a><code>[virtual] </code>QNearFieldTarget::<span class="name">~QNearFieldTarget</span>()</h3>
<p>Destroys the near field target.</p>
<!-- @@@~QNearFieldTarget -->
<!-- $$$accessMethods[overload1]$$$accessMethods -->
<h3 class="fn" id="accessMethods"><a name="accessMethods"></a><code>[pure virtual] </code><span class="type"><a href="qnearfieldtarget.html#AccessMethod-enum">QNearFieldTarget::AccessMethods</a></span> QNearFieldTarget::<span class="name">accessMethods</span>() const</h3>
<p>Returns the access methods support by this near field target.</p>
<!-- @@@accessMethods -->
<!-- $$$disconnect[overload1]$$$disconnect -->
<h3 class="fn" id="disconnect"><a name="disconnect"></a><span class="type">bool</span> QNearFieldTarget::<span class="name">disconnect</span>()</h3>
<p>Closes the connection to the target.</p>
<p>Returns true only if an existing connection was successfully closed.</p>
<p>This function was introduced in  Qt 5.9.</p>
<p><b>See also </b><a href="qnearfieldtarget.html#keepConnection">keepConnection</a>() and <a href="qnearfieldtarget.html#setKeepConnection">setKeepConnection</a>().</p>
<!-- @@@disconnect -->
<!-- $$$disconnected[overload1]$$$disconnected -->
<h3 class="fn" id="disconnected"><a name="disconnected"></a><code>[signal] </code><span class="type">void</span> QNearFieldTarget::<span class="name">disconnected</span>()</h3>
<p>This signal is emitted when the near field target moves out of proximity.</p>
<!-- @@@disconnected -->
<!-- $$$error[overload1]$$$errorQNearFieldTarget::ErrorconstQNearFieldTarget::RequestId& -->
<h3 class="fn" id="error"><a name="error"></a><code>[signal] </code><span class="type">void</span> QNearFieldTarget::<span class="name">error</span>(<span class="type"><a href="qnearfieldtarget.html#Error-enum">QNearFieldTarget::Error</a></span> <i>error</i>, const <span class="type"><a href="qnearfieldtarget-requestid.html">QNearFieldTarget::RequestId</a></span> &amp;<i>id</i>)</h3>
<p>This signal is emitted when an error occurs while processing request <i>id</i>. The <i>error</i> parameter describes the error.</p>
<!-- @@@error -->
<!-- $$$handleResponse[overload1]$$$handleResponseconstQNearFieldTarget::RequestId&constQByteArray& -->
<h3 class="fn" id="handleResponse"><a name="handleResponse"></a><code>[virtual protected] </code><span class="type">bool</span> QNearFieldTarget::<span class="name">handleResponse</span>(const <span class="type"><a href="qnearfieldtarget-requestid.html">QNearFieldTarget::RequestId</a></span> &amp;<i>id</i>, const <span class="type">QByteArray</span> &amp;<i>response</i>)</h3>
<p>Handles the <i>response</i> received for the request <i>id</i>. Returns true if the response is handled; otherwise returns false.</p>
<p>Classes reimplementing this virtual function should call the base class implementation to ensure that requests initiated by those classes are handled correctly.</p>
<p>The default implementation stores the response such that it can be retrieved by <a href="qnearfieldtarget.html#requestResponse">requestResponse</a>().</p>
<p><b>Note: </b>This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.</p>
<!-- @@@handleResponse -->
<!-- $$$hasNdefMessage[overload1]$$$hasNdefMessage -->
<h3 class="fn" id="hasNdefMessage"><a name="hasNdefMessage"></a><code>[virtual] </code><span class="type">bool</span> QNearFieldTarget::<span class="name">hasNdefMessage</span>()</h3>
<p>Returns true if at least one NDEF message is stored on the near field target; otherwise returns false.</p>
<!-- @@@hasNdefMessage -->
<!-- $$$isProcessingCommand[overload1]$$$isProcessingCommand -->
<h3 class="fn" id="isProcessingCommand"><a name="isProcessingCommand"></a><span class="type">bool</span> QNearFieldTarget::<span class="name">isProcessingCommand</span>() const</h3>
<p>Returns true if the target is processing commands; otherwise returns false.</p>
<!-- @@@isProcessingCommand -->
<!-- $$$keepConnection[overload1]$$$keepConnection -->
<h3 class="fn" id="keepConnection"><a name="keepConnection"></a><span class="type">bool</span> QNearFieldTarget::<span class="name">keepConnection</span>() const</h3>
<p>Returns true if this feature is enabled.</p>
<p>This function was introduced in  Qt 5.9.</p>
<p><b>See also </b><a href="qnearfieldtarget.html#setKeepConnection">setKeepConnection</a>() and <a href="qnearfieldtarget.html#disconnect">disconnect</a>().</p>
<!-- @@@keepConnection -->
<!-- $$$maxCommandLength[overload1]$$$maxCommandLength -->
<h3 class="fn" id="maxCommandLength"><a name="maxCommandLength"></a><span class="type">int</span> QNearFieldTarget::<span class="name">maxCommandLength</span>() const</h3>
<p>Returns the maximum number of bytes that can be sent with <a href="qnearfieldtarget.html#sendCommand">sendCommand</a>. 0 will be returned if the target does not support sending tag type specific commands.</p>
<p>This function was introduced in  Qt 5.9.</p>
<p><b>See also </b><a href="qnearfieldtarget.html#sendCommand">sendCommand</a>() and <a href="qnearfieldtarget.html#sendCommands">sendCommands</a>().</p>
<!-- @@@maxCommandLength -->
<!-- $$$ndefMessageRead[overload1]$$$ndefMessageReadconstQNdefMessage& -->
<h3 class="fn" id="ndefMessageRead"><a name="ndefMessageRead"></a><code>[signal] </code><span class="type">void</span> QNearFieldTarget::<span class="name">ndefMessageRead</span>(const <span class="type"><a href="qndefmessage.html">QNdefMessage</a></span> &amp;<i>message</i>)</h3>
<p>This signal is emitted when a complete NDEF <i>message</i> has been read from the target.</p>
<p><b>See also </b><a href="qnearfieldtarget.html#readNdefMessages">readNdefMessages</a>().</p>
<!-- @@@ndefMessageRead -->
<!-- $$$ndefMessagesWritten[overload1]$$$ndefMessagesWritten -->
<h3 class="fn" id="ndefMessagesWritten"><a name="ndefMessagesWritten"></a><code>[signal] </code><span class="type">void</span> QNearFieldTarget::<span class="name">ndefMessagesWritten</span>()</h3>
<p>This signal is emitted when NDEF messages have been successfully written to the target.</p>
<p><b>See also </b><a href="qnearfieldtarget.html#writeNdefMessages">writeNdefMessages</a>().</p>
<!-- @@@ndefMessagesWritten -->
<!-- $$$readNdefMessages[overload1]$$$readNdefMessages -->
<h3 class="fn" id="readNdefMessages"><a name="readNdefMessages"></a><code>[virtual] </code><span class="type"><a href="qnearfieldtarget-requestid.html">QNearFieldTarget::RequestId</a></span> QNearFieldTarget::<span class="name">readNdefMessages</span>()</h3>
<p>Starts reading NDEF messages stored on the near field target. Returns a request id which can be used to track the completion status of the request. An invalid request id will be returned if the target does not support reading NDEF messages.</p>
<p>An <a href="qnearfieldtarget.html#ndefMessageRead">ndefMessageRead</a>() signal will be emitted for each NDEF message. The <a href="qnearfieldtarget.html#requestCompleted">requestCompleted</a>() signal will be emitted was all NDEF messages have been read. The <a href="qnearfieldtarget.html#error">error</a>() signal is emitted if an error occurs.</p>
<!-- @@@readNdefMessages -->
<!-- $$$reportError[overload1]$$$reportErrorQNearFieldTarget::ErrorconstQNearFieldTarget::RequestId& -->
<h3 class="fn" id="reportError"><a name="reportError"></a><code>[protected] </code><span class="type">void</span> QNearFieldTarget::<span class="name">reportError</span>(<span class="type"><a href="qnearfieldtarget.html#Error-enum">QNearFieldTarget::Error</a></span> <i>error</i>, const <span class="type"><a href="qnearfieldtarget-requestid.html">QNearFieldTarget::RequestId</a></span> &amp;<i>id</i>)</h3>
<p>Reports the <i>error</i> for the request <i>id</i> by appending the signal emission to the event queue.</p>
<p>This function was introduced in  Qt 5.12.</p>
<!-- @@@reportError -->
<!-- $$$requestCompleted[overload1]$$$requestCompletedconstQNearFieldTarget::RequestId& -->
<h3 class="fn" id="requestCompleted"><a name="requestCompleted"></a><code>[signal] </code><span class="type">void</span> QNearFieldTarget::<span class="name">requestCompleted</span>(const <span class="type"><a href="qnearfieldtarget-requestid.html">QNearFieldTarget::RequestId</a></span> &amp;<i>id</i>)</h3>
<p>This signal is emitted when a request <i>id</i> completes.</p>
<p><b>See also </b><a href="qnearfieldtarget.html#sendCommand">sendCommand</a>().</p>
<!-- @@@requestCompleted -->
<!-- $$$requestResponse[overload1]$$$requestResponseconstQNearFieldTarget::RequestId& -->
<h3 class="fn" id="requestResponse"><a name="requestResponse"></a><span class="type">QVariant</span> QNearFieldTarget::<span class="name">requestResponse</span>(const <span class="type"><a href="qnearfieldtarget-requestid.html">QNearFieldTarget::RequestId</a></span> &amp;<i>id</i>)</h3>
<p>Returns the decoded response for request <i>id</i>. If the request is unknown or has not yet been completed an invalid QVariant is returned.</p>
<!-- @@@requestResponse -->
<!-- $$$sendCommand[overload1]$$$sendCommandconstQByteArray& -->
<h3 class="fn" id="sendCommand"><a name="sendCommand"></a><code>[virtual] </code><span class="type"><a href="qnearfieldtarget-requestid.html">QNearFieldTarget::RequestId</a></span> QNearFieldTarget::<span class="name">sendCommand</span>(const <span class="type">QByteArray</span> &amp;<i>command</i>)</h3>
<p>Sends <i>command</i> to the near field target. Returns a request id which can be used to track the completion status of the request. An invalid request id will be returned if the target does not support sending tag type specific commands.</p>
<p>The <a href="qnearfieldtarget.html#requestCompleted">requestCompleted</a>() signal will be emitted on successful completion of the request; otherwise the <a href="qnearfieldtarget.html#error">error</a>() signal will be emitted.</p>
<p>Once the request completes successfully the response can be retrieved from the <a href="qnearfieldtarget.html#requestResponse">requestResponse</a>() function. The response of this request will be a QByteArray.</p>
<p><b>See also </b><a href="qnearfieldtarget.html#requestCompleted">requestCompleted</a>() and <a href="qnearfieldtarget.html#waitForRequestCompleted">waitForRequestCompleted</a>().</p>
<!-- @@@sendCommand -->
<!-- $$$sendCommands[overload1]$$$sendCommandsconstQList<QByteArray>& -->
<h3 class="fn" id="sendCommands"><a name="sendCommands"></a><code>[virtual] </code><span class="type"><a href="qnearfieldtarget-requestid.html">QNearFieldTarget::RequestId</a></span> QNearFieldTarget::<span class="name">sendCommands</span>(const <span class="type">QList</span>&lt;<span class="type">QByteArray</span>&gt; &amp;<i>commands</i>)</h3>
<p>Sends multiple <i>commands</i> to the near field target. Returns a request id which can be used to track the completion status of the request. An invalid request id will be returned if the target does not support sending tag type specific commands.</p>
<p>If all commands complete successfully the <a href="qnearfieldtarget.html#requestCompleted">requestCompleted</a>() signal will be emitted; otherwise the <a href="qnearfieldtarget.html#error">error</a>() signal will be emitted. If a command fails succeeding commands from this call will not be processed.</p>
<p>Once the request completes the response for successfully completed requests can be retrieved from the <a href="qnearfieldtarget.html#requestResponse">requestResponse</a>() function. The response of this request will be a QList&lt;QByteArray&gt;.</p>
<p><b>See also </b><a href="qnearfieldtarget.html#requestCompleted">requestCompleted</a>() and <a href="qnearfieldtarget.html#waitForRequestCompleted">waitForRequestCompleted</a>().</p>
<!-- @@@sendCommands -->
<!-- $$$setKeepConnection[overload1]$$$setKeepConnectionbool -->
<h3 class="fn" id="setKeepConnection"><a name="setKeepConnection"></a><span class="type">bool</span> QNearFieldTarget::<span class="name">setKeepConnection</span>(<span class="type">bool</span> <i>isPersistent</i>)</h3>
<p>Preserves the connection to the target device after processing a command or reading/writing NDEF messages if <i>isPersistent</i> is <code>true</code>. By default, this behavior is not enabled.</p>
<p>Returns <code>true</code> if enabling this feature was successful. A possible reason for a failure is the lack of support on the used platform.</p>
<p>Enabling this feature requires to use the <a href="qnearfieldtarget.html#disconnect">disconnect</a>() function too, to close the connection manually and enable communication with the target from a different instance. Disabling this feature will also close an open connection.</p>
<p>This function was introduced in  Qt 5.9.</p>
<p><b>See also </b><a href="qnearfieldtarget.html#keepConnection">keepConnection</a>() and <a href="qnearfieldtarget.html#disconnect">disconnect</a>().</p>
<!-- @@@setKeepConnection -->
<!-- $$$setResponseForRequest[overload1]$$$setResponseForRequestconstQNearFieldTarget::RequestId&constQVariant&bool -->
<h3 class="fn" id="setResponseForRequest"><a name="setResponseForRequest"></a><span class="type">void</span> QNearFieldTarget::<span class="name">setResponseForRequest</span>(const <span class="type"><a href="qnearfieldtarget-requestid.html">QNearFieldTarget::RequestId</a></span> &amp;<i>id</i>, const <span class="type">QVariant</span> &amp;<i>response</i>, <span class="type">bool</span> <i>emitRequestCompleted</i> = true)</h3>
<p>Sets the decoded response for request <i>id</i> to <i>response</i>. If <i>emitRequestCompleted</i> is true the <a href="qnearfieldtarget.html#requestCompleted">requestCompleted</a>() signal will be emitted for <i>id</i>; otherwise no signal will be emitted.</p>
<p><b>See also </b><a href="qnearfieldtarget.html#requestResponse">requestResponse</a>().</p>
<!-- @@@setResponseForRequest -->
<!-- $$$type[overload1]$$$type -->
<h3 class="fn" id="type"><a name="type"></a><code>[pure virtual] </code><span class="type"><a href="qnearfieldtarget.html#Type-enum">QNearFieldTarget::Type</a></span> QNearFieldTarget::<span class="name">type</span>() const</h3>
<p>Returns the type of tag type of this near field target.</p>
<!-- @@@type -->
<!-- $$$uid[overload1]$$$uid -->
<h3 class="fn" id="uid"><a name="uid"></a><code>[pure virtual] </code><span class="type">QByteArray</span> QNearFieldTarget::<span class="name">uid</span>() const</h3>
<p>Returns the UID of the near field target.</p>
<!-- @@@uid -->
<!-- $$$url[overload1]$$$url -->
<h3 class="fn" id="url"><a name="url"></a><code>[virtual] </code><span class="type">QUrl</span> QNearFieldTarget::<span class="name">url</span>() const</h3>
<p>Returns the URL of the near field target.</p>
<!-- @@@url -->
<!-- $$$waitForRequestCompleted[overload1]$$$waitForRequestCompletedconstQNearFieldTarget::RequestId&int -->
<h3 class="fn" id="waitForRequestCompleted"><a name="waitForRequestCompleted"></a><code>[virtual] </code><span class="type">bool</span> QNearFieldTarget::<span class="name">waitForRequestCompleted</span>(const <span class="type"><a href="qnearfieldtarget-requestid.html">QNearFieldTarget::RequestId</a></span> &amp;<i>id</i>, <span class="type">int</span> <i>msecs</i> = 5000)</h3>
<p>Waits up to <i>msecs</i> milliseconds for the request <i>id</i> to complete. Returns true if the request completes successfully and the requestCompeted() signal is emitted; otherwise returns false.</p>
<!-- @@@waitForRequestCompleted -->
<!-- $$$writeNdefMessages[overload1]$$$writeNdefMessagesconstQList<QNdefMessage>& -->
<h3 class="fn" id="writeNdefMessages"><a name="writeNdefMessages"></a><code>[virtual] </code><span class="type"><a href="qnearfieldtarget-requestid.html">QNearFieldTarget::RequestId</a></span> QNearFieldTarget::<span class="name">writeNdefMessages</span>(const <span class="type">QList</span>&lt;<span class="type"><a href="qndefmessage.html">QNdefMessage</a></span>&gt; &amp;<i>messages</i>)</h3>
<p>Writes the NDEF messages in <i>messages</i> to the target. Returns a request id which can be used to track the completion status of the request. An invalid request id will be returned if the target does not support reading NDEF messages.</p>
<p>The <a href="qnearfieldtarget.html#ndefMessagesWritten">ndefMessagesWritten</a>() signal will be emitted when the write operation completes successfully; otherwise the <a href="qnearfieldtarget.html#error">error</a>() signal is emitted.</p>
<!-- @@@writeNdefMessages -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qNfcChecksum[overload1]$$$qNfcChecksumconstchar*uint -->
<h3 class="fn" id="qNfcChecksum"><a name="qNfcChecksum"></a><span class="type">quint16</span> <span class="name">qNfcChecksum</span>(const <span class="type">char</span> *<i>data</i>, <span class="type">uint</span> <i>len</i>)</h3>
<p>Returns the NFC checksum of the first <i>len</i> bytes of <i>data</i>.</p>
<!-- @@@qNfcChecksum -->
</div>
        </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>