sc_connect_card(3)

NAME
sc_connect_card - connect to smart card in reader

SYNOPSIS
#include <opensc.h>

int sc_connect_card(sc_reader_t *reader,
                    int slot, sc_card_t **card);

DESCRIPTION
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(3) when no longer in used.

RETURN VALUE
If an error occurred, a negative error code is returned, as described in sc_error(3). Otherwise, the function will return 0.

SEE ALSO
sc_establish_context(3), sc_disconnect_card(3).

AUTHOR
This manual page was written by Olaf Kirch <okir@suse.de>