<!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>pcsc-lite: atrhandler.c 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.6.2-20100208 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data 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 class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_c68a5dfdca54003c765e303a18006edb.html">src</a> </div> </div> <div class="contents"> <h1>atrhandler.c File Reference</h1> <p>This keeps track of smartcard protocols, timing issues and ATR (Answer-to-Reset) handling. <a href="#_details">More...</a></p> <code>#include "config.h"</code><br/> <code>#include <string.h></code><br/> <code>#include "misc.h"</code><br/> <code>#include "<a class="el" href="pcsclite_8h_source.html">pcsclite.h</a>"</code><br/> <code>#include "<a class="el" href="debuglog_8h_source.html">debuglog.h</a>"</code><br/> <code>#include "<a class="el" href="atrhandler_8h_source.html">atrhandler.h</a>"</code><br/> <div class="dynheader"> Include dependency graph for atrhandler.c:</div> <div class="dynsection"> </div> <p><a href="atrhandler_8c_source.html">Go to the source code of this file.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">short </td><td class="memItemRight" valign="bottom"><a class="el" href="atrhandler_8c.html#a84127d39d788360749d94c602ab3e129">ATRDecodeAtr</a> (<a class="el" href="struct__SMARTCARD__EXTENSION.html">PSMARTCARD_EXTENSION</a> psExtension, PUCHAR pucAtr, DWORD dwLength)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Uncomment the following for ATR debugging or use . <a href="#a84127d39d788360749d94c602ab3e129"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>This keeps track of smartcard protocols, timing issues and ATR (Answer-to-Reset) handling. </p> <dl class="note"><dt><b>Note:</b></dt><dd>use ./configure --enable-debugatr to enable debug messages to be logged. </dd></dl> <p>Definition in file <a class="el" href="atrhandler_8c_source.html">atrhandler.c</a>.</p> <hr/><h2>Function Documentation</h2> <a class="anchor" id="a84127d39d788360749d94c602ab3e129"></a><!-- doxytag: member="atrhandler.c::ATRDecodeAtr" ref="a84127d39d788360749d94c602ab3e129" args="(PSMARTCARD_EXTENSION psExtension, PUCHAR pucAtr, DWORD dwLength)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">short ATRDecodeAtr </td> <td>(</td> <td class="paramtype"><a class="el" href="struct__SMARTCARD__EXTENSION.html">PSMARTCARD_EXTENSION</a> </td> <td class="paramname"> <em>psExtension</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">PUCHAR </td> <td class="paramname"> <em>pucAtr</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">DWORD </td> <td class="paramname"> <em>dwLength</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Uncomment the following for ATR debugging or use . </p> <p>/configure --enable-debugatr parse an ATR </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>psExtension</em> </td><td></td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>pucAtr</em> </td><td>ATR </td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>dwLength</em> </td><td>ATR length </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd></dd></dl> <p><dl><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>Atr must have TS and T0</td></tr> <tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>Unable to decode TS byte</td></tr> <tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>Unable to decode LNS</td></tr> <tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>Unable do decode T protocol</td></tr> <tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>Maximum attribute size</td></tr> <tr><td valign="top"></td><td valign="top"><em>1</em> </td><td>Success </td></tr> </table> </dd> </dl> </p> <p>Definition at line <a class="el" href="atrhandler_8c_source.html#l00043">43</a> of file <a class="el" href="atrhandler_8c_source.html">atrhandler.c</a>.</p> <p>References <a class="el" href="pcsclite_8h_source.html#l00035">MAX_ATR_SIZE</a>, <a class="el" href="pcsclite_8h_source.html#l00141">SCARD_PROTOCOL_T0</a>, <a class="el" href="pcsclite_8h_source.html#l00142">SCARD_PROTOCOL_T1</a>, <a class="el" href="pcsclite_8h_source.html#l00144">SCARD_PROTOCOL_T15</a>, and <a class="el" href="pcsclite_8h_source.html#l00139">SCARD_PROTOCOL_UNDEFINED</a>.</p> <p>Referenced by <a class="el" href="ifdwrapper_8c_source.html#l00318">IFDPowerICC()</a>, <a class="el" href="ifdwrapper_8c_source.html#l00412">IFDStatusICC()</a>, <a class="el" href="prothandler_8c_source.html#l00055">PHGetAvailableProtocols()</a>, and <a class="el" href="prothandler_8c_source.html#l00035">PHGetDefaultProtocol()</a>.</p> </div> </div> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address> </body> </html>