sc_connect_card(3)

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.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0

From libopensc2-dev 0.11.13-1.1 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.