Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > f831237475ece7d1519c6812064707d4 > files > 87

libnfc-devel-1.4.2-1.fc14.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libnfc: nfc.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libnfc&#160;<span id="projectnumber">1.4.2</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="dir_41028febda0963323f7e6054c1e7205d.html">include</a>      </li>
      <li class="navelem"><a class="el" href="dir_70f07fa48bb0d24326c844d55c4ad9eb.html">nfc</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<h1>nfc.h File Reference</h1>  </div>
</div>
<div class="contents">

<p>libnfc interface  
<a href="#_details">More...</a></p>
<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br/>
<code>#include &lt;stdbool.h&gt;</code><br/>
<code>#include &lt;nfc/nfc-types.h&gt;</code><br/>
</div>
<p><a href="nfc_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT <a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a031b6ed9303b80591710e4ccfac6d323">nfc_connect</a> (<a class="el" href="structnfc__device__desc__t.html">nfc_device_desc_t</a> *pndd)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to a NFC device.  <a href="#a031b6ed9303b80591710e4ccfac6d323"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#ab2e652f3b35ab0c885b7cfdc71c6358f">nfc_disconnect</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disconnect from a NFC device.  <a href="#ab2e652f3b35ab0c885b7cfdc71c6358f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a9f6fe7975de2f224072cd172cc78fc3d">nfc_list_devices</a> (<a class="el" href="structnfc__device__desc__t.html">nfc_device_desc_t</a> pnddDevices[], size_t szDevices, size_t *pszDeviceFound)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Probe for discoverable supported devices (ie. only available for some drivers)  <a href="#a9f6fe7975de2f224072cd172cc78fc3d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a793825dc0fdd1c3c1c5ba683957fbf36">nfc_configure</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, const <a class="el" href="nfc-types_8h.html#ab2cdef5e5ac453e9c60c9fe449cb311e">nfc_device_option_t</a> ndo, const bool bEnable)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure advanced NFC device settings.  <a href="#a793825dc0fdd1c3c1c5ba683957fbf36"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a9dbf9a23e9993437e49c33841c4ebde5">nfc_initiator_init</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize NFC device as initiator (reader)  <a href="#a9dbf9a23e9993437e49c33841c4ebde5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a54b9ccec2cc5fdc4c0f3914230508c4b">nfc_initiator_select_passive_target</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, const <a class="el" href="structnfc__modulation__t.html">nfc_modulation_t</a> nm, const byte_t *pbtInitData, const size_t szInitData, <a class="el" href="structnfc__target__t.html">nfc_target_t</a> *pnt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Select a passive or emulated tag.  <a href="#a54b9ccec2cc5fdc4c0f3914230508c4b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a5617a81572ba89a312be38be9ddbeaad">nfc_initiator_list_passive_targets</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, const <a class="el" href="structnfc__modulation__t.html">nfc_modulation_t</a> nm, <a class="el" href="structnfc__target__t.html">nfc_target_t</a> ant[], const size_t szTargets, size_t *pszTargetFound)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">List passive or emulated tags.  <a href="#a5617a81572ba89a312be38be9ddbeaad"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#ad223381d67671fd223cc3be5a9d0ecab">nfc_initiator_poll_targets</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, const <a class="el" href="structnfc__modulation__t.html">nfc_modulation_t</a> *pnmTargetTypes, const size_t szTargetTypes, const byte_t btPollNr, const byte_t btPeriod, <a class="el" href="structnfc__target__t.html">nfc_target_t</a> *pntTargets, size_t *pszTargetFound)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Polling for NFC targets.  <a href="#ad223381d67671fd223cc3be5a9d0ecab"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a337f8b5bc27c12c31eb84ab8e5d8221c">nfc_initiator_select_dep_target</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, const <a class="el" href="nfc-types_8h.html#a0403437f90b1c17f0177fc26c1f4e0fc">nfc_dep_mode_t</a> ndm, const <a class="el" href="nfc-types_8h.html#ae9d7b01916fb677e7c0ad1de171b1fdd">nfc_baud_rate_t</a> nbr, const <a class="el" href="structnfc__dep__info__t.html">nfc_dep_info_t</a> *pndiInitiator, <a class="el" href="structnfc__target__t.html">nfc_target_t</a> *pnt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Select a target and request active or passive mode for D.E.P. (Data Exchange Protocol)  <a href="#a337f8b5bc27c12c31eb84ab8e5d8221c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a66d39098b4786ae8533db79b1e5f4bd1">nfc_initiator_transceive_bytes</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, const byte_t *pbtTx, const size_t szTx, byte_t *pbtRx, size_t *pszRx)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data to target then retrieve data from target.  <a href="#a66d39098b4786ae8533db79b1e5f4bd1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#ae4a101a28da85b68c1d5cc000a53e428">nfc_initiator_transceive_bits</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, const byte_t *pbtTx, const size_t szTxBits, const byte_t *pbtTxPar, byte_t *pbtRx, size_t *pszRxBits, byte_t *pbtRxPar)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Transceive raw bit-frames to a target.  <a href="#ae4a101a28da85b68c1d5cc000a53e428"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a319bf1bd4fa4fc1af757000e0b9b8301">nfc_target_init</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, <a class="el" href="structnfc__target__t.html">nfc_target_t</a> *pnt, byte_t *pbtRx, size_t *pszRx)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize NFC device as an emulated tag.  <a href="#a319bf1bd4fa4fc1af757000e0b9b8301"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a229671d8a0affa605d7ef0a837aa7b71">nfc_target_send_bytes</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, const byte_t *pbtTx, const size_t szTx)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Send bytes and APDU frames.  <a href="#a229671d8a0affa605d7ef0a837aa7b71"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#ac18ec064e2084f8af9a4710b50623d22">nfc_target_receive_bytes</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, byte_t *pbtRx, size_t *pszRx)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Receive bytes and APDU frames.  <a href="#ac18ec064e2084f8af9a4710b50623d22"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a8db48ddbc106b808e9d7a209a3ef186b">nfc_target_send_bits</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, const byte_t *pbtTx, const size_t szTxBits, const byte_t *pbtTxPar)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Send raw bit-frames.  <a href="#a8db48ddbc106b808e9d7a209a3ef186b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#addba6ea55b70429a3ca6f29c9d85248f">nfc_target_receive_bits</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, byte_t *pbtRx, size_t *pszRxBits, byte_t *pbtRxPar)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Receive bit-frames.  <a href="#addba6ea55b70429a3ca6f29c9d85248f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a542abdb592db5881219b074f6c061811">nfc_strerror</a> (const <a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the PCD error string.  <a href="#a542abdb592db5881219b074f6c061811"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#aa1bfc505428efc5a5dfac4718716869b">nfc_strerror_r</a> (const <a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, char *pcStrErrBuf, size_t szBufLen)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Renders the PCD error in pcStrErrBuf for a maximum size of szBufLen chars.  <a href="#aa1bfc505428efc5a5dfac4718716869b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8449cfcbea8a2b02315a21a8072f2109"></a><!-- doxytag: member="nfc.h::nfc_perror" ref="a8449cfcbea8a2b02315a21a8072f2109" args="(const nfc_device_t *pnd, const char *pcString)" -->
NFC_EXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a8449cfcbea8a2b02315a21a8072f2109">nfc_perror</a> (const <a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd, const char *pcString)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Display the PCD error a-la perror. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a893e914d305220d68689d5ef82a7b03d">nfc_device_name</a> (<a class="el" href="structnfc__device__t.html">nfc_device_t</a> *pnd)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the device name.  <a href="#a893e914d305220d68689d5ef82a7b03d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NFC_EXPORT const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nfc_8h.html#a729aa9f48fdb2e1191f76a4f0574e548">nfc_version</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the library version.  <a href="#a729aa9f48fdb2e1191f76a4f0574e548"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>libnfc interface </p>
<p>Provide all usefull functions (API) to handle NFC devices. </p>

<p>Definition in file <a class="el" href="nfc_8h_source.html">nfc.h</a>.</p>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="a793825dc0fdd1c3c1c5ba683957fbf36"></a><!-- doxytag: member="nfc.h::nfc_configure" ref="a793825dc0fdd1c3c1c5ba683957fbf36" args="(nfc_device_t *pnd, const nfc_device_option_t ndo, const bool bEnable)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_configure </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="nfc-types_8h.html#ab2cdef5e5ac453e9c60c9fe449cb311e">nfc_device_option_t</a>&#160;</td>
          <td class="paramname"><em>ndo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const bool&#160;</td>
          <td class="paramname"><em>bEnable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Configure advanced NFC device settings. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>. </dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pnd</td><td><em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct pointer that represent currently used device </td></tr>
    <tr><td class="paramname">ndo</td><td><em>nfc_device_option_t</em> struct that contains option to set to device </td></tr>
    <tr><td class="paramname">bEnable</td><td>boolean to activate/disactivate the option</td></tr>
  </table>
  </dd>
</dl>
<p>Configures parameters and registers that control for example timing, modulation, frame and error handling. There are different categories for configuring the <em>PN53X</em> chip features (handle, activate, infinite and accept). </p>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00235">235</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a031b6ed9303b80591710e4ccfac6d323"></a><!-- doxytag: member="nfc.h::nfc_connect" ref="a031b6ed9303b80591710e4ccfac6d323" args="(nfc_device_desc_t *pndd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT <a class="el" href="structnfc__device__t.html">nfc_device_t</a>* nfc_connect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__desc__t.html">nfc_device_desc_t</a> *&#160;</td>
          <td class="paramname"><em>pndd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Connect to a NFC device. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pndd</td><td>device description if specific device is wanted, <code>NULL</code> otherwise </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns pointer to a <em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct if successfull; otherwise returns <code>NULL</code> value.</dd></dl>
<p>If <em>pndd</em> is <code>NULL</code>, the first available NFC device is claimed. It will automatically search the system using all available drivers to determine a device is NFC-enabled.</p>
<p>If <em>pndd</em> is passed then this function will try to claim the right device using information provided by the <em><a class="el" href="structnfc__device__desc__t.html" title="NFC device description.">nfc_device_desc_t</a></em> struct.</p>
<p>When it has successfully claimed a NFC device, memory is allocated to save the device information. It will return a pointer to a <em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct. This pointer should be supplied by every next functions of libnfc that should perform an action with this device.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>During this function, the device will be configured with default options:<ul>
<li>Crc is handled by the device (NDO_HANDLE_CRC = true)</li>
<li>Parity is handled the device (NDO_HANDLE_PARITY = true)</li>
<li>Cryto1 cipher is disabled (NDO_ACTIVATE_CRYPTO1 = false)</li>
<li>Easy framing is enabled (NDO_EASY_FRAMING = true)</li>
<li>Auto-switching in ISO14443-4 mode is enabled (NDO_AUTO_ISO14443_4 = true)</li>
<li>Invalid frames are not accepted (NDO_ACCEPT_INVALID_FRAMES = false)</li>
<li>Multiple frames are not accepted (NDO_ACCEPT_MULTIPLE_FRAMES = false) </li>
</ul>
</dd></dl>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00071">71</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a893e914d305220d68689d5ef82a7b03d"></a><!-- doxytag: member="nfc.h::nfc_device_name" ref="a893e914d305220d68689d5ef82a7b03d" args="(nfc_device_t *pnd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT const char* nfc_device_name </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the device name. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns a string with the device name </dd></dl>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00694">694</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="ab2e652f3b35ab0c885b7cfdc71c6358f"></a><!-- doxytag: member="nfc.h::nfc_disconnect" ref="ab2e652f3b35ab0c885b7cfdc71c6358f" args="(nfc_device_t *pnd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT void nfc_disconnect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Disconnect from a NFC device. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pnd</td><td><em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct pointer that represent currently used device</td></tr>
  </table>
  </dd>
</dl>
<p>Initiator's selected tag is disconnected and the device, including allocated <em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct, is released. </p>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00161">161</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a9dbf9a23e9993437e49c33841c4ebde5"></a><!-- doxytag: member="nfc.h::nfc_initiator_init" ref="a9dbf9a23e9993437e49c33841c4ebde5" args="(nfc_device_t *pnd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_initiator_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize NFC device as initiator (reader) </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>. </dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pnd</td><td><em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct pointer that represent currently used device</td></tr>
  </table>
  </dd>
</dl>
<p>The NFC device is configured to function as RFID reader. After initialization it can be used to communicate to passive RFID tags and active NFC devices. The reader will act as initiator to communicate peer 2 peer (NFCIP) to other active NFC devices. </p>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00252">252</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a5617a81572ba89a312be38be9ddbeaad"></a><!-- doxytag: member="nfc.h::nfc_initiator_list_passive_targets" ref="a5617a81572ba89a312be38be9ddbeaad" args="(nfc_device_t *pnd, const nfc_modulation_t nm, nfc_target_t ant[], const size_t szTargets, size_t *pszTargetFound)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_initiator_list_passive_targets </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structnfc__modulation__t.html">nfc_modulation_t</a>&#160;</td>
          <td class="paramname"><em>nm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnfc__target__t.html">nfc_target_t</a>&#160;</td>
          <td class="paramname"><em>ant</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>szTargets</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>pszTargetFound</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>List passive or emulated tags. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">pnd</td><td><em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct pointer that represent currently used device </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">nm</td><td>desired modulation </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">ant</td><td>array of <em><a class="el" href="structnfc__target__t.html" title="NFC target structure.">nfc_target_t</a></em> that will be filled with targets info </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">szTargets</td><td>size of <em>ant</em> (will be the max targets listed) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pszTargetFound</td><td>pointer where target found counter will be stored</td></tr>
  </table>
  </dd>
</dl>
<p>The NFC device will try to find the available passive tags. Some NFC devices are capable to emulate passive tags. The standards (ISO18092 and ECMA-340) describe the modulation that can be used for reader to passive communications. The chip needs to know with what kind of tag it is dealing with, therefore the initial modulation and speed (106, 212 or 424 kbps) should be supplied. </p>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00358">358</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="ad223381d67671fd223cc3be5a9d0ecab"></a><!-- doxytag: member="nfc.h::nfc_initiator_poll_targets" ref="ad223381d67671fd223cc3be5a9d0ecab" args="(nfc_device_t *pnd, const nfc_modulation_t *pnmTargetTypes, const size_t szTargetTypes, const byte_t btPollNr, const byte_t btPeriod, nfc_target_t *pntTargets, size_t *pszTargetFound)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_initiator_poll_targets </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structnfc__modulation__t.html">nfc_modulation_t</a> *&#160;</td>
          <td class="paramname"><em>pnmModulations</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>szModulations</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const byte_t&#160;</td>
          <td class="paramname"><em>btPollNr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const byte_t&#160;</td>
          <td class="paramname"><em>btPeriod</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnfc__target__t.html">nfc_target_t</a> *&#160;</td>
          <td class="paramname"><em>pntTargets</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>pszTargetFound</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Polling for NFC targets. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pnd</td><td><em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct pointer that represent currently used device </td></tr>
    <tr><td class="paramname">ppttTargetTypes</td><td>array of desired target types </td></tr>
    <tr><td class="paramname">szTargetTypes</td><td><em>ppttTargetTypes</em> count </td></tr>
    <tr><td class="paramname">btPollNr</td><td>specifies the number of polling </td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>Note:</b></dt><dd>one polling is a polling for each desired target type </dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">btPeriod</td><td>indicates the polling period in units of 150 ms </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pntTargets</td><td>pointer on array of 2 <em><a class="el" href="structnfc__target__t.html" title="NFC target structure.">nfc_target_t</a></em> (over)writables struct </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pszTargetFound</td><td>found targets count </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00433">433</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a337f8b5bc27c12c31eb84ab8e5d8221c"></a><!-- doxytag: member="nfc.h::nfc_initiator_select_dep_target" ref="a337f8b5bc27c12c31eb84ab8e5d8221c" args="(nfc_device_t *pnd, const nfc_dep_mode_t ndm, const nfc_baud_rate_t nbr, const nfc_dep_info_t *pndiInitiator, nfc_target_t *pnt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_initiator_select_dep_target </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="nfc-types_8h.html#a0403437f90b1c17f0177fc26c1f4e0fc">nfc_dep_mode_t</a>&#160;</td>
          <td class="paramname"><em>ndm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="nfc-types_8h.html#ae9d7b01916fb677e7c0ad1de171b1fdd">nfc_baud_rate_t</a>&#160;</td>
          <td class="paramname"><em>nbr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structnfc__dep__info__t.html">nfc_dep_info_t</a> *&#160;</td>
          <td class="paramname"><em>pndiInitiator</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnfc__target__t.html">nfc_target_t</a> *&#160;</td>
          <td class="paramname"><em>pnt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Select a target and request active or passive mode for D.E.P. (Data Exchange Protocol) </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">pnd</td><td><em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct pointer that represent currently used device </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">ndm</td><td>desired D.E.P. mode (<em>NDM_ACTIVE</em> or <em>NDM_PASSIVE</em> for active, respectively passive mode) </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">ndiInitiator</td><td>pointer <em><a class="el" href="structnfc__dep__info__t.html" title="NFC target information in D.E.P. (Data Exchange Protocol) see ISO/IEC 18092 (NFCIP-1)">nfc_dep_info_t</a></em> struct that contains <em>NFCID3</em> and <em>General</em> <em>Bytes</em> to set to the initiator device (optionnal, can be <em>NULL</em>) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pnt</td><td>is a <em><a class="el" href="structnfc__target__t.html" title="NFC target structure.">nfc_target_t</a></em> struct pointer where target information will be put.</td></tr>
  </table>
  </dd>
</dl>
<p>The NFC device will try to find an available D.E.P. target. The standards (ISO18092 and ECMA-340) describe the modulation that can be used for reader to passive communications.</p>
<dl class="note"><dt><b>Note:</b></dt><dd><em><a class="el" href="structnfc__dep__info__t.html" title="NFC target information in D.E.P. (Data Exchange Protocol) see ISO/IEC 18092 (NFCIP-1)">nfc_dep_info_t</a></em> will be returned when the target was acquired successfully. </dd></dl>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00460">460</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a54b9ccec2cc5fdc4c0f3914230508c4b"></a><!-- doxytag: member="nfc.h::nfc_initiator_select_passive_target" ref="a54b9ccec2cc5fdc4c0f3914230508c4b" args="(nfc_device_t *pnd, const nfc_modulation_t nm, const byte_t *pbtInitData, const size_t szInitData, nfc_target_t *pnt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_initiator_select_passive_target </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structnfc__modulation__t.html">nfc_modulation_t</a>&#160;</td>
          <td class="paramname"><em>nm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const byte_t *&#160;</td>
          <td class="paramname"><em>pbtInitData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>szInitData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnfc__target__t.html">nfc_target_t</a> *&#160;</td>
          <td class="paramname"><em>pnt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Select a passive or emulated tag. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pnd</td><td><em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct pointer that represent currently used device </td></tr>
    <tr><td class="paramname">nm</td><td>desired modulation </td></tr>
    <tr><td class="paramname">pbtInitData</td><td>optional initiator data used for Felica, ISO14443B, Topaz polling or to select a specific UID in ISO14443A. </td></tr>
    <tr><td class="paramname">szInitData</td><td>length of initiator data <em>pbtInitData</em>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>Note:</b></dt><dd>pbtInitData is used with different kind of data depending on modulation type:<ul>
<li>for an ISO/IEC 14443 type A modulation, pbbInitData contains the UID you want to select;</li>
<li>for an ISO/IEC 14443 type B modulation, pbbInitData contains Application Family Identifier (AFI) (see ISO/IEC 14443-3);</li>
<li>for a FeliCa modulation, pbbInitData contains polling payload (see ISO/IEC 18092 11.2.2.5).</li>
</ul>
</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">pnt</td><td><em><a class="el" href="structnfc__target__t.html" title="NFC target structure.">nfc_target_t</a></em> struct pointer which will filled if available</td></tr>
  </table>
  </dd>
</dl>
<p>The NFC device will try to find one available passive tag or emulated tag.</p>
<p>The chip needs to know with what kind of tag it is dealing with, therefore the initial modulation and speed (106, 212 or 424 kbps) should be supplied. </p>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00292">292</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="ae4a101a28da85b68c1d5cc000a53e428"></a><!-- doxytag: member="nfc.h::nfc_initiator_transceive_bits" ref="ae4a101a28da85b68c1d5cc000a53e428" args="(nfc_device_t *pnd, const byte_t *pbtTx, const size_t szTxBits, const byte_t *pbtTxPar, byte_t *pbtRx, size_t *pszRxBits, byte_t *pbtRxPar)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_initiator_transceive_bits </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const byte_t *&#160;</td>
          <td class="paramname"><em>pbtTx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>szTxBits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const byte_t *&#160;</td>
          <td class="paramname"><em>pbtTxPar</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte_t *&#160;</td>
          <td class="paramname"><em>pbtRx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>pszRxBits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte_t *&#160;</td>
          <td class="paramname"><em>pbtRxPar</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Transceive raw bit-frames to a target. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pbtTx</td><td>contains a byte array of the frame that needs to be transmitted. </td></tr>
    <tr><td class="paramname">szTxBits</td><td>contains the length in bits.</td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>Note:</b></dt><dd>For example the REQA (0x26) command (first anti-collision command of ISO14443-A) must be precise 7 bits long. This is not possible by using <a class="el" href="nfc_8c.html#a9e32d7ad73ef60bb198a8f0d36da0890" title="Send data to target then retrieve data from target.">nfc_initiator_transceive_bytes()</a>. With that function you can only communicate frames that consist of full bytes. When you send a full byte (8 bits + 1 parity) with the value of REQA (0x26), a tag will simply not respond. More information about this can be found in the anti-collision example (<em>nfc-anticol</em>).</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pbtTxPar</td><td>parameter contains a byte array of the corresponding parity bits needed to send per byte.</td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>Note:</b></dt><dd>For example if you send the SELECT_ALL (0x93, 0x20) = [ 10010011, 00100000 ] command, you have to supply the following parity bytes (0x01, 0x00) to define the correct odd parity bits. This is only an example to explain how it works, if you just are sending two bytes with ISO14443-A compliant parity bits you better can use the <a class="el" href="nfc_8c.html#a9e32d7ad73ef60bb198a8f0d36da0890" title="Send data to target then retrieve data from target.">nfc_initiator_transceive_bytes()</a> function.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">pbtRx</td><td>response from the tag </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pszRxBits</td><td><em>pbtRx</em> length in bits </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pbtRxPar</td><td>parameter contains a byte array of the corresponding parity bits</td></tr>
  </table>
  </dd>
</dl>
<p>The NFC device (configured as <em>initiator</em>) will transmit low-level messages where only the modulation is handled by the <em>PN53x</em> chip. Construction of the frame (data, CRC and parity) is completely done by libnfc. This can be very useful for testing purposes. Some protocols (e.g. MIFARE Classic) require to violate the ISO14443-A standard by sending incorrect parity and CRC bytes. Using this feature you are able to simulate these frames. </p>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00550">550</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a66d39098b4786ae8533db79b1e5f4bd1"></a><!-- doxytag: member="nfc.h::nfc_initiator_transceive_bytes" ref="a66d39098b4786ae8533db79b1e5f4bd1" args="(nfc_device_t *pnd, const byte_t *pbtTx, const size_t szTx, byte_t *pbtRx, size_t *pszRx)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_initiator_transceive_bytes </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const byte_t *&#160;</td>
          <td class="paramname"><em>pbtTx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>szTx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte_t *&#160;</td>
          <td class="paramname"><em>pbtRx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>pszRx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Send data to target then retrieve data from target. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>.</dd></dl>
<p>The NFC device (configured as initiator) will transmit the supplied bytes (<em>pbtTx</em>) to the target. It waits for the response and stores the received bytes in the <em>pbtRx</em> byte array.</p>
<p>If <em>NDO_EASY_FRAMING</em> option is disabled the frames will sent and received in raw mode: <em>PN53x</em> will not handle input neither output data.</p>
<p>The parity bits are handled by the <em>PN53x</em> chip. The CRC can be generated automatically or handled manually. Using this function, frames can be communicated very fast via the NFC initiator to the tag.</p>
<p>Tests show that on average this way of communicating is much faster than using the regular driver/middle-ware (often supplied by manufacturers).</p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>The configuration option <em>NDO_HANDLE_PARITY</em> must be set to <code>true</code> (the default value). </dd></dl>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00506">506</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a9f6fe7975de2f224072cd172cc78fc3d"></a><!-- doxytag: member="nfc.h::nfc_list_devices" ref="a9f6fe7975de2f224072cd172cc78fc3d" args="(nfc_device_desc_t pnddDevices[], size_t szDevices, size_t *pszDeviceFound)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT void nfc_list_devices </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__desc__t.html">nfc_device_desc_t</a>&#160;</td>
          <td class="paramname"><em>pnddDevices</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>szDevices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>pszDeviceFound</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Probe for discoverable supported devices (ie. only available for some drivers) </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">pnddDevices</td><td>array of <em><a class="el" href="structnfc__device__desc__t.html" title="NFC device description.">nfc_device_desc_t</a></em> previously allocated by the caller. </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">szDevices</td><td>size of the <em>pnddDevices</em> array. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pszDeviceFound</td><td>number of devices found. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00201">201</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a542abdb592db5881219b074f6c061811"></a><!-- doxytag: member="nfc.h::nfc_strerror" ref="a542abdb592db5881219b074f6c061811" args="(const nfc_device_t *pnd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT const char* nfc_strerror </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the PCD error string. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns a string </dd></dl>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00663">663</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="aa1bfc505428efc5a5dfac4718716869b"></a><!-- doxytag: member="nfc.h::nfc_strerror_r" ref="aa1bfc505428efc5a5dfac4718716869b" args="(const nfc_device_t *pnd, char *pcStrErrBuf, size_t szBufLen)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT int nfc_strerror_r </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>pcStrErrBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>szBufLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Renders the PCD error in pcStrErrBuf for a maximum size of szBufLen chars. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns 0 upon success </dd></dl>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00673">673</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a319bf1bd4fa4fc1af757000e0b9b8301"></a><!-- doxytag: member="nfc.h::nfc_target_init" ref="a319bf1bd4fa4fc1af757000e0b9b8301" args="(nfc_device_t *pnd, nfc_target_t *pnt, byte_t *pbtRx, size_t *pszRx)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_target_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnfc__target__t.html">nfc_target_t</a> *&#160;</td>
          <td class="paramname"><em>pnt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte_t *&#160;</td>
          <td class="paramname"><em>pbtRx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>pszRx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize NFC device as an emulated tag. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pnd</td><td><em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct pointer that represent currently used device </td></tr>
    <tr><td class="paramname">ntm</td><td>target mode restriction that you want to emulate (eg. NTM_PASSIVE_ONLY) </td></tr>
    <tr><td class="paramname">pnt</td><td>pointer to <em><a class="el" href="structnfc__target__t.html" title="NFC target structure.">nfc_target_t</a></em> struct that represents the wanted emulated target</td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>Note:</b></dt><dd><em>pnt</em> can be updated by this function: if you set NBR_UNDEFINED and/or NDM_UNDEFINED (ie. for DEP mode), these fields will be updated.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">pbtRx</td><td>Rx buffer pointer </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pszRx</td><td>received bytes count</td></tr>
  </table>
  </dd>
</dl>
<p>This function initialize NFC device in <em>target</em> mode in order to emulate a tag using the specified <em>nfc_target_mode_t</em>.</p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>Be aware that this function will wait (hang) until a command is received that is not part of the anti-collision. The RATS command for example would wake up the emulator. After this is received, the send and receive functions can be used. </dd></dl>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00581">581</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="addba6ea55b70429a3ca6f29c9d85248f"></a><!-- doxytag: member="nfc.h::nfc_target_receive_bits" ref="addba6ea55b70429a3ca6f29c9d85248f" args="(nfc_device_t *pnd, byte_t *pbtRx, size_t *pszRxBits, byte_t *pbtRxPar)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_target_receive_bits </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte_t *&#160;</td>
          <td class="paramname"><em>pbtRx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>pszRxBits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte_t *&#160;</td>
          <td class="paramname"><em>pbtRxPar</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Receive bit-frames. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>.</dd></dl>
<p>This function makes it possible to receive (raw) bit-frames. It returns all the messages that are stored in the FIFO buffer of the <em>PN53x</em> chip. It does not require to send any frame and thereby could be used to snoop frames that are transmitted by a nearby <em>initiator</em>. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Check out the NDO_ACCEPT_MULTIPLE_FRAMES configuration option to avoid losing transmitted frames. </dd></dl>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00651">651</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="ac18ec064e2084f8af9a4710b50623d22"></a><!-- doxytag: member="nfc.h::nfc_target_receive_bytes" ref="ac18ec064e2084f8af9a4710b50623d22" args="(nfc_device_t *pnd, byte_t *pbtRx, size_t *pszRx)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_target_receive_bytes </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte_t *&#160;</td>
          <td class="paramname"><em>pbtRx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>pszRx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Receive bytes and APDU frames. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>. </dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">pnd</td><td><em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct pointer that represent currently used device </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pbtRx</td><td>pointer to Rx buffer </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pszRx</td><td>received byte count</td></tr>
  </table>
  </dd>
</dl>
<p>This function retrieves bytes frames (e.g. ADPU) sent by the <em>initiator</em> to the NFC device (configured as <em>target</em>). </p>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00617">617</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a8db48ddbc106b808e9d7a209a3ef186b"></a><!-- doxytag: member="nfc.h::nfc_target_send_bits" ref="a8db48ddbc106b808e9d7a209a3ef186b" args="(nfc_device_t *pnd, const byte_t *pbtTx, const size_t szTxBits, const byte_t *pbtTxPar)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_target_send_bits </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const byte_t *&#160;</td>
          <td class="paramname"><em>pbtTx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>szTxBits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const byte_t *&#160;</td>
          <td class="paramname"><em>pbtTxPar</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Send raw bit-frames. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>.</dd></dl>
<p>This function can be used to transmit (raw) bit-frames to the <em>initiator</em> using the specified NFC device (configured as <em>target</em>). </p>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00632">632</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a229671d8a0affa605d7ef0a837aa7b71"></a><!-- doxytag: member="nfc.h::nfc_target_send_bytes" ref="a229671d8a0affa605d7ef0a837aa7b71" args="(nfc_device_t *pnd, const byte_t *pbtTx, const size_t szTx)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT bool nfc_target_send_bytes </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnfc__device__t.html">nfc_device_t</a> *&#160;</td>
          <td class="paramname"><em>pnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const byte_t *&#160;</td>
          <td class="paramname"><em>pbtTx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>szTx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Send bytes and APDU frames. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if action was successfully performed; otherwise returns <code>false</code>.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pnd</td><td><em><a class="el" href="structnfc__device__t.html" title="NFC device information.">nfc_device_t</a></em> struct pointer that represent currently used device </td></tr>
    <tr><td class="paramname">pbtTx</td><td>pointer to Tx buffer </td></tr>
    <tr><td class="paramname">szTx</td><td>size of Tx buffer</td></tr>
  </table>
  </dd>
</dl>
<p>This function make the NFC device (configured as <em>target</em>) send byte frames (e.g. APDU responses) to the <em>initiator</em>. </p>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00600">600</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a729aa9f48fdb2e1191f76a4f0574e548"></a><!-- doxytag: member="nfc.h::nfc_version" ref="a729aa9f48fdb2e1191f76a4f0574e548" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NFC_EXPORT const char* nfc_version </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the library version. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns a string with the library version </dd></dl>

<p>Definition at line <a class="el" href="nfc_8c_source.html#l00706">706</a> of file <a class="el" href="nfc_8c_source.html">nfc.c</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Feb 23 2011 for libnfc by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>