sc_connect_card3
Connect to smart card in reader
Usage
#include <opensc.h> int sc_connect_card(sc_reader_t *reader, int slot, sc_card_t **card);
Overview
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.
The slot parameter identifies the card reader´s slot. Slots are numbered consecutively, starting at 0.
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 card parameter. The card handle should be released with sc_disconnect_card when no longer in use.
Return value
Returns 0 if successful, or a negative value in case of error.
Releases
4 releases since Debian 3.1 (Sarge); the text changed 3 times.