<!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.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">pcsc-lite <span id="projectnumber">1.7.2</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</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 id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File 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_7a4553ee0c3b13d0e595a5d1659110a6.html">src</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#func-members">Functions</a> </div> <div class="headertitle"> <h1>atrhandler.c File Reference</h1> </div> </div> <div class="contents"> <p>This keeps track of smartcard protocols, timing issues and ATR (Answer-to-Reset) handling. <a href="#_details">More...</a></p> <div class="textblock"><code>#include "config.h"</code><br/> <code>#include <string.h></code><br/> <code>#include "misc.h"</code><br/> <code>#include "pcsclite.h"</code><br/> <code>#include "debuglog.h"</code><br/> <code>#include "<a class="el" href="atrhandler_8h_source.html">atrhandler.h</a>"</code><br/> </div><div class="textblock"><div class="dynheader"> Include dependency graph for atrhandler.c:</div> <div class="dyncontent"> <div class="center"><img src="atrhandler_8c__incl.png" border="0" usemap="#atrhandler_8c" alt=""/></div> <map name="atrhandler_8c" id="atrhandler_8c"> <area shape="rect" id="node7" href="misc_8h_source.html" title="misc.h" alt="" coords="184,83,245,112"/><area shape="rect" id="node13" href="atrhandler_8h.html" title="This keeps track of smartcard protocols, timing issues and Answer to Reset ATR handling." alt="" coords="480,83,571,112"/></map> </div> </div> <p><a href="atrhandler_8c_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">short </td><td class="memItemRight" valign="bottom"><a class="el" href="atrhandler_8c.html#a76bf3383cc11cc95499325c987d6f193">ATRDecodeAtr</a> (<a class="el" href="structSMARTCARD__EXTENSION.html">SMARTCARD_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="#a76bf3383cc11cc95499325c987d6f193"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <div class="textblock"><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> </div><hr/><h2>Function Documentation</h2> <a class="anchor" id="a76bf3383cc11cc95499325c987d6f193"></a><!-- doxytag: member="atrhandler.c::ATRDecodeAtr" ref="a76bf3383cc11cc95499325c987d6f193" args="(SMARTCARD_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="structSMARTCARD__EXTENSION.html">SMARTCARD_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> </tr> <tr> <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 class="params"> <tr><td class="paramdir">[out]</td><td class="paramname">psExtension</td><td></td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">pucAtr</td><td>ATR </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">dwLength</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 class="retval"> <tr><td class="paramname">0</td><td>Atr must have TS and T0</td></tr> <tr><td class="paramname">0</td><td>Unable to decode TS byte</td></tr> <tr><td class="paramname">0</td><td>Unable to decode LNS</td></tr> <tr><td class="paramname">0</td><td>Unable do decode T protocol</td></tr> <tr><td class="paramname">0</td><td>Maximum attribute size</td></tr> <tr><td class="paramname">0</td><td>Maximum attribute size</td></tr> <tr><td class="paramname">1</td><td>Success </td></tr> </table> </dd> </dl> </p> <p>Definition at line <a class="el" href="atrhandler_8c_source.html#l00044">44</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#l00038">MAX_ATR_SIZE</a>, <a class="el" href="pcsclite_8h_source.html#l00152">SCARD_PROTOCOL_T0</a>, <a class="el" href="pcsclite_8h_source.html#l00153">SCARD_PROTOCOL_T1</a>, <a class="el" href="pcsclite_8h_source.html#l00155">SCARD_PROTOCOL_T15</a>, and <a class="el" href="pcsclite_8h_source.html#l00150">SCARD_PROTOCOL_UNDEFINED</a>.</p> <p>Referenced by <a class="el" href="prothandler_8c_source.html#l00054">PHGetAvailableProtocols()</a>, and <a class="el" href="prothandler_8c_source.html#l00034">PHGetDefaultProtocol()</a>.</p> </div> </div> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Mar 31 2011 for pcsc-lite by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address> </body> </html>