<!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: prothandler.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>prothandler.c File Reference</h1> <p>This handles protocol defaults, PTS, etc. <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="pcscd_8h_source.html">pcscd.h</a>"</code><br/> <code>#include "<a class="el" href="ifdhandler_8h_source.html">ifdhandler.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="readerfactory_8h_source.html">readerfactory.h</a>"</code><br/> <code>#include "<a class="el" href="prothandler_8h_source.html">prothandler.h</a>"</code><br/> <code>#include "<a class="el" href="atrhandler_8h_source.html">atrhandler.h</a>"</code><br/> <code>#include "<a class="el" href="ifdwrapper_8h_source.html">ifdwrapper.h</a>"</code><br/> <code>#include "<a class="el" href="eventhandler_8h_source.html">eventhandler.h</a>"</code><br/> <div class="dynheader"> Include dependency graph for prothandler.c:</div> <div class="dynsection"> </div> <p><a href="prothandler_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">UCHAR </td><td class="memItemRight" valign="bottom"><a class="el" href="prothandler_8c.html#a30e7c843c2a5a626a1df5abe4a116e99">PHGetDefaultProtocol</a> (PUCHAR pucAtr, DWORD dwLength)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the default protocol used immediately after reset. <a href="#a30e7c843c2a5a626a1df5abe4a116e99"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">UCHAR </td><td class="memItemRight" valign="bottom"><a class="el" href="prothandler_8c.html#a028195440f572393f25e2daf6d4df05b">PHGetAvailableProtocols</a> (PUCHAR pucAtr, DWORD dwLength)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the protocols supported by the card. <a href="#a028195440f572393f25e2daf6d4df05b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">DWORD </td><td class="memItemRight" valign="bottom"><a class="el" href="prothandler_8c.html#a4522f0d45b2ab13cf3d264a605eec02d">PHSetProtocol</a> (struct <a class="el" href="structReaderContext.html">ReaderContext</a> *rContext, DWORD dwPreferred, UCHAR ucAvailable, UCHAR ucDefault)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Determine which protocol to use. <a href="#a4522f0d45b2ab13cf3d264a605eec02d"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>This handles protocol defaults, PTS, etc. </p> <p>Definition in file <a class="el" href="prothandler_8c_source.html">prothandler.c</a>.</p> <hr/><h2>Function Documentation</h2> <a class="anchor" id="a028195440f572393f25e2daf6d4df05b"></a><!-- doxytag: member="prothandler.c::PHGetAvailableProtocols" ref="a028195440f572393f25e2daf6d4df05b" args="(PUCHAR pucAtr, DWORD dwLength)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">UCHAR PHGetAvailableProtocols </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>Get the protocols supported by the card. </p> <p>These protocols are returned from the function as bit masks. </p> <p>Definition at line <a class="el" href="prothandler_8c_source.html#l00055">55</a> of file <a class="el" href="prothandler_8c_source.html">prothandler.c</a>.</p> <p>References <a class="el" href="atrhandler_8c_source.html#l00043">ATRDecodeAtr()</a>.</p> <p>Referenced by <a class="el" href="winscard_8c_source.html#l00271">SCardConnect()</a>, and <a class="el" href="winscard_8c_source.html#l00527">SCardReconnect()</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a30e7c843c2a5a626a1df5abe4a116e99"></a><!-- doxytag: member="prothandler.c::PHGetDefaultProtocol" ref="a30e7c843c2a5a626a1df5abe4a116e99" args="(PUCHAR pucAtr, DWORD dwLength)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">UCHAR PHGetDefaultProtocol </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>Get the default protocol used immediately after reset. </p> <p>This protocol is returned from the function. </p> <p>Definition at line <a class="el" href="prothandler_8c_source.html#l00035">35</a> of file <a class="el" href="prothandler_8c_source.html">prothandler.c</a>.</p> <p>References <a class="el" href="atrhandler_8c_source.html#l00043">ATRDecodeAtr()</a>.</p> <p>Referenced by <a class="el" href="winscard_8c_source.html#l00271">SCardConnect()</a>, and <a class="el" href="winscard_8c_source.html#l00527">SCardReconnect()</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a4522f0d45b2ab13cf3d264a605eec02d"></a><!-- doxytag: member="prothandler.c::PHSetProtocol" ref="a4522f0d45b2ab13cf3d264a605eec02d" args="(struct ReaderContext *rContext, DWORD dwPreferred, UCHAR ucAvailable, UCHAR ucDefault)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">DWORD PHSetProtocol </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structReaderContext.html">ReaderContext</a> * </td> <td class="paramname"> <em>rContext</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">DWORD </td> <td class="paramname"> <em>dwPreferred</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">UCHAR </td> <td class="paramname"> <em>ucAvailable</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">UCHAR </td> <td class="paramname"> <em>ucDefault</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Determine which protocol to use. </p> <p>SCardConnect has a DWORD dwPreferredProtocols that is a bitmask of what protocols to use. Basically, if T=N where N is not zero will be used first if it is available in ucAvailable. Otherwise it will always default to T=0.</p> <p><a class="el" href="ifdwrapper_8c.html#a1f2d9c683aa5360f8576ef2c09ed4f21" title="Set the protocol type selection (PTS).">IFDSetPTS()</a> is _always_ called so that the driver can initialise its data </p> <p>Definition at line <a class="el" href="prothandler_8c_source.html#l00080">80</a> of file <a class="el" href="prothandler_8c_source.html">prothandler.c</a>.</p> <p>References <a class="el" href="ifdwrapper_8c_source.html#l00036">IFDSetPTS()</a>, <a class="el" href="pcsclite_8h_source.html#l00141">SCARD_PROTOCOL_T0</a>, and <a class="el" href="pcsclite_8h_source.html#l00142">SCARD_PROTOCOL_T1</a>.</p> <p>Referenced by <a class="el" href="winscard_8c_source.html#l00271">SCardConnect()</a>, and <a class="el" href="winscard_8c_source.html#l00527">SCardReconnect()</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> </div> </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>