2005-03-01 23:18:24 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2005-02-23 02:52:20 +00:00
|
|
|
<refentry id="scconnectcard">
|
2005-03-01 23:18:24 +00:00
|
|
|
<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
|
2005-02-23 02:52:20 +00:00
|
|
|
<refmeta>
|
|
|
|
<refentrytitle>sc_connect_card</refentrytitle>
|
|
|
|
<manvolnum>3</manvolnum>
|
|
|
|
<refmiscinfo>opensc</refmiscinfo>
|
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
|
|
|
<refname>sc_connect_card</refname>
|
|
|
|
<refpurpose>Connect to smartcard in reader</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Synopsis</title>
|
|
|
|
<para>
|
|
|
|
<programlisting>
|
2005-03-01 23:18:24 +00:00
|
|
|
#include <opensc.h>
|
2005-02-23 02:52:20 +00:00
|
|
|
|
|
|
|
int sc_connect_card(sc_reader_t *reader, int slot, <link linkend="sccardt">sc_card_t</link> **card);
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<para>
|
|
|
|
This function connects to a card in a reader, resets the card and retrieves the ATR (Answer To
|
|
|
|
Reset). Based on the ATR, it tries to auto-detect which card driver to use.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <emphasis>slot</emphasis> parameter identifies the card reader's slot. Slots are numbered
|
|
|
|
consecutively, starting at 0.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If OpenSC was able to connect to the card, a pointer to the sc_card_t object is stored in the
|
|
|
|
location pointer to by the <emphasis>card</emphasis> parameter. The card handle should be
|
|
|
|
released with <link linkend="scdisconnectcard">sc_disconnect_card</link> when no longer in use.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2005-03-01 23:18:24 +00:00
|
|
|
<refsect1>
|
|
|
|
<title>Return value</title>
|
|
|
|
<para>Returns 0 if successful, or a negative value in case of error.</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2005-02-23 02:52:20 +00:00
|
|
|
</refentry>
|