Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 50facae208d4a6f280e44a513b104320 > files > 1507

qt-mobility-doc-1.2.0-13.mga5.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qnearfieldtarget.cpp -->
  <title>Qt Mobility 1.2: QNearFieldTarget Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>QtMobility Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtconnectivity.html">QtConnectivity</a></li>
<li>QNearFieldTarget</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<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="#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>
<h1 class="title">QNearFieldTarget Class Reference</h1>
<!-- $$$QNearFieldTarget-brief -->
<p>The QNearFieldTarget class provides an interface for communicating with a target device. <a href="#details">More...</a></p>
<!-- @@@QNearFieldTarget -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QNearFieldTarget&gt;</span></pre><p><b>Inherits: </b><a href="http://qt.nokia.com/doc/4.7/qobject.html">QObject</a>.</p>
<p><b>Inherited by: </b><a href="qnearfieldtagtype1.html">QNearFieldTagType1</a>, <a href="qnearfieldtagtype2.html">QNearFieldTagType2</a>, <a href="qnearfieldtagtype3.html">QNearFieldTagType3</a>, and <a href="qnearfieldtagtype4.html">QNearFieldTagType4</a>.</p>
<p>This class was introduced in Qt Mobility 1.2.</p>
<ul>
<li><a href="qnearfieldtarget-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<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"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#AccessMethod-enum">AccessMethod</a></b> { 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, ..., NdefWriteError }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnearfieldtarget.html#Type-enum">Type</a></b> { AnyTarget, ProprietaryTag, NfcTagType1, NfcTagType2, ..., NfcForumDevice }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<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> = 0 )</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 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"> 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"> virtual 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 RequestId &amp; <i>id</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual 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 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"> 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 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 RequestId &amp; <i>id</i>, int <i>msecs</i> = 5000 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual 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>
<ul>
<li class="fn">29 public functions inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<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>
<ul>
<li class="fn">1 signal inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<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>
</table>
<ul>
<li class="fn">7 protected functions inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<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>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-slots">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-variables">QObject</a></li>
<li class="fn">4 static public members inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#static-public-members">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QNearFieldTarget-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QNearFieldTarget class provides an interface for communicating with a target device.</p>
<p>QNearFieldTarget 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 <a href="qllcpsocket.html">QLlcpSocket</a> 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$$$NdefAccess$$$TagTypeSpecificAccess$$$LlcpAccess -->
<h3 class="flags"><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>
<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"><tt>QNearFieldTarget::NdefAccess</tt></td><td class="topAlign"><tt>0</tt></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"><tt>QNearFieldTarget::TagTypeSpecificAccess</tt></td><td class="topAlign"><tt>1</tt></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"><tt>QNearFieldTarget::LlcpAccess</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The target supports peer-to-peer LLCP communication.</td></tr>
</table>
<p>The AccessMethods type is a typedef for <a href="qflags.html">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 -->
<h3 class="fn"><a name="Error-enum"></a>enum QNearFieldTarget::<span class="name">Error</span></h3>
<p>This enum describes the error codes that that a near field target reports.</p>
<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"><tt>QNearFieldTarget::NoError</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">No error has occurred.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::UnknownError</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">An unidentified error occurred.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::UnsupportedError</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The requested operation is unsupported by this near field target.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::TargetOutOfRangeError</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">The target is no longer within range.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::NoResponseError</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">The target did not respond.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::ChecksumMismatchError</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">The checksum has detected a corrupted response.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::InvalidParametersError</tt></td><td class="topAlign"><tt>6</tt></td><td class="topAlign">Invalid parameters were passed to a tag type specific function.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::NdefReadError</tt></td><td class="topAlign"><tt>7</tt></td><td class="topAlign">Failed to read NDEF messages from the target.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::NdefWriteError</tt></td><td class="topAlign"><tt>8</tt></td><td class="topAlign">Failed to write NDEF messages to the target.</td></tr>
</table>
<!-- @@@Error -->
<!-- $$$Type$$$AnyTarget$$$ProprietaryTag$$$NfcTagType1$$$NfcTagType2$$$NfcTagType3$$$NfcTagType4$$$MifareTag$$$NfcForumDevice -->
<h3 class="fn"><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>
<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"><tt>QNearFieldTarget::AnyTarget</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">This value is only used when registering handlers to indicate that any compatible target can be used.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::ProprietaryTag</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">An unidentified proprietary target tag.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::NfcTagType1</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">An NFC tag type 1 target.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::NfcTagType2</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">An NFC tag type 2 target.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::NfcTagType3</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">An NFC tag type 3 target.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::NfcTagType4</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">An NFC tag type 4 target.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::MifareTag</tt></td><td class="topAlign"><tt>6</tt></td><td class="topAlign">A Mifare target.</td></tr>
<tr><td class="topAlign"><tt>QNearFieldTarget::NfcForumDevice</tt></td><td class="topAlign"><tt>7</tt></td><td class="topAlign">An NFC Forum device target.</td></tr>
</table>
<!-- @@@Type -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QNearFieldTarget[overload1]$$$QNearFieldTargetQObject* -->
<h3 class="fn"><a name="QNearFieldTarget"></a>QNearFieldTarget::<span class="name">QNearFieldTarget</span> ( <span class="type"><a href="http://qt.nokia.com/doc/4.7/qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a new near field target with <i>parent</i>.</p>
<!-- @@@QNearFieldTarget -->
<!-- $$$~QNearFieldTarget[overload1]$$$~QNearFieldTarget -->
<h3 class="fn"><a name="dtor.QNearFieldTarget"></a>QNearFieldTarget::<span class="name">~QNearFieldTarget</span> ()<tt> [virtual]</tt></h3>
<p>Destroys the near field target.</p>
<!-- @@@~QNearFieldTarget -->
<!-- $$$accessMethods[overload1]$$$accessMethods -->
<h3 class="fn"><a name="accessMethods"></a><span class="type"><a href="qnearfieldtarget.html#AccessMethod-enum">AccessMethods</a></span> QNearFieldTarget::<span class="name">accessMethods</span> () const<tt> [pure virtual]</tt></h3>
<p>Returns the access methods support by this near field target.</p>
<!-- @@@accessMethods -->
<!-- $$$disconnected[overload1]$$$disconnected -->
<h3 class="fn"><a name="disconnected"></a><span class="type">void</span> QNearFieldTarget::<span class="name">disconnected</span> ()<tt> [signal]</tt></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"><a name="error"></a><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> )<tt> [signal]</tt></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"><a name="handleResponse"></a><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"><a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a></span> &amp; <i>response</i> )<tt> [virtual protected]</tt></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>
<!-- @@@handleResponse -->
<!-- $$$hasNdefMessage[overload1]$$$hasNdefMessage -->
<h3 class="fn"><a name="hasNdefMessage"></a><span class="type">bool</span> QNearFieldTarget::<span class="name">hasNdefMessage</span> ()<tt> [virtual]</tt></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"><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 -->
<!-- $$$ndefMessageRead[overload1]$$$ndefMessageReadconstQNdefMessage& -->
<h3 class="fn"><a name="ndefMessageRead"></a><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> )<tt> [signal]</tt></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"><a name="ndefMessagesWritten"></a><span class="type">void</span> QNearFieldTarget::<span class="name">ndefMessagesWritten</span> ()<tt> [signal]</tt></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"><a name="readNdefMessages"></a><span class="type"><a href="qnearfieldtarget-requestid.html">RequestId</a></span> QNearFieldTarget::<span class="name">readNdefMessages</span> ()<tt> [virtual]</tt></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>
<p><b>Note:</b> Symbian^3 and Harmattan only support read one NDEF message.</p>
<!-- @@@readNdefMessages -->
<!-- $$$requestCompleted[overload1]$$$requestCompletedconstQNearFieldTarget::RequestId& -->
<h3 class="fn"><a name="requestCompleted"></a><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> )<tt> [signal]</tt></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]$$$requestResponseconstRequestId& -->
<h3 class="fn"><a name="requestResponse"></a><span class="type"><a href="http://qt.nokia.com/doc/4.7/qvariant.html">QVariant</a></span> QNearFieldTarget::<span class="name">requestResponse</span> ( const <span class="type"><a href="qnearfieldtarget-requestid.html">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 <a href="http://qt.nokia.com/doc/4.7/qvariant.html">QVariant</a> is returned.</p>
<!-- @@@requestResponse -->
<!-- $$$sendCommand[overload1]$$$sendCommandconstQByteArray& -->
<h3 class="fn"><a name="sendCommand"></a><span class="type"><a href="qnearfieldtarget-requestid.html">RequestId</a></span> QNearFieldTarget::<span class="name">sendCommand</span> ( const <span class="type"><a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a></span> &amp; <i>command</i> )<tt> [virtual]</tt></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 <a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a>.</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"><a name="sendCommands"></a><span class="type"><a href="qnearfieldtarget-requestid.html">RequestId</a></span> QNearFieldTarget::<span class="name">sendCommands</span> ( const <span class="type"><a href="http://qt.nokia.com/doc/4.7/qlist.html">QList</a></span>&lt;<span class="type"><a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a></span>&gt; &amp; <i>commands</i> )<tt> [virtual]</tt></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 <a href="http://qt.nokia.com/doc/4.7/qlist.html">QList</a>&lt;<a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a>&gt;.</p>
<p><b>See also </b><a href="qnearfieldtarget.html#requestCompleted">requestCompleted</a>() and <a href="qnearfieldtarget.html#waitForRequestCompleted">waitForRequestCompleted</a>().</p>
<!-- @@@sendCommands -->
<!-- $$$setResponseForRequest[overload1]$$$setResponseForRequestconstQNearFieldTarget::RequestId&constQVariant&bool -->
<h3 class="fn"><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"><a href="http://qt.nokia.com/doc/4.7/qvariant.html">QVariant</a></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"><a name="type"></a><span class="type"><a href="qnearfieldtarget.html#Type-enum">Type</a></span> QNearFieldTarget::<span class="name">type</span> () const<tt> [pure virtual]</tt></h3>
<p>Returns the type of tag type of this near field target.</p>
<!-- @@@type -->
<!-- $$$uid[overload1]$$$uid -->
<h3 class="fn"><a name="uid"></a><span class="type"><a href="http://qt.nokia.com/doc/4.7/qbytearray.html">QByteArray</a></span> QNearFieldTarget::<span class="name">uid</span> () const<tt> [pure virtual]</tt></h3>
<p>Returns the UID of the near field target.</p>
<!-- @@@uid -->
<!-- $$$url[overload1]$$$url -->
<h3 class="fn"><a name="url"></a><span class="type"><a href="http://qt.nokia.com/doc/4.7/qurl.html">QUrl</a></span> QNearFieldTarget::<span class="name">url</span> () const<tt> [virtual]</tt></h3>
<p>Returns the URL of the near field target.</p>
<!-- @@@url -->
<!-- $$$waitForRequestCompleted[overload1]$$$waitForRequestCompletedconstRequestId&int -->
<h3 class="fn"><a name="waitForRequestCompleted"></a><span class="type">bool</span> QNearFieldTarget::<span class="name">waitForRequestCompleted</span> ( const <span class="type"><a href="qnearfieldtarget-requestid.html">RequestId</a></span> &amp; <i>id</i>, <span class="type">int</span> <i>msecs</i> = 5000 )<tt> [virtual]</tt></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"><a name="writeNdefMessages"></a><span class="type"><a href="qnearfieldtarget-requestid.html">RequestId</a></span> QNearFieldTarget::<span class="name">writeNdefMessages</span> ( const <span class="type"><a href="http://qt.nokia.com/doc/4.7/qlist.html">QList</a></span>&lt;<span class="type"><a href="qndefmessage.html">QNdefMessage</a></span>&gt; &amp; <i>messages</i> )<tt> [virtual]</tt></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>
<p><b>Note:</b> Symbian^3 and Harmattan only support writing one NDEF message. Only the first NDEF message in the list will be written, others are silently dropped.</p>
<!-- @@@writeNdefMessages -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qNfcChecksum[overload1]$$$qNfcChecksumconstchar*uint -->
<h3 class="fn"><a name="qNfcChecksum"></a><span class="type"><a href="http://qt.nokia.com/doc/4.7/qtglobal.html#quint16-typedef">quint16</a></span> <span class="name">qNfcChecksum</span> ( const <span class="type">char</span> * <i>data</i>, <span class="type"><a href="http://qt.nokia.com/doc/4.7/qtglobal.html#uint-typedef">uint</a></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 class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
  <p>
     <acronym title="Copyright">&copy;</acronym> 2008-2011 Nokia Corporation and/or its
     subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
     in Finland and/or other countries worldwide.</p>
  <p>
     All other trademarks are property of their respective owners. <a title="Privacy Policy"
     href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
  <br />
  <p>
    Licensees holding valid Qt Commercial licenses may use this document in accordance with the    Qt Commercial License Agreement provided with the Software or, alternatively, in accordance    with the terms contained in a written agreement between you and Nokia.</p>
  <p>
    Alternatively, this document may be used 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.</p>
</div>
</body>
</html>