1SC_CONNECT_CARD(3) OpenSC API reference SC_CONNECT_CARD(3)
2
3
4
6 sc_connect_card - Connect to smart card in reader
7
9 #include <opensc.h>
10
11 int sc_connect_card(sc_reader_t *reader, int slot, sc_card_t **card);
12
13
14
16 This function connects to a card in a reader, resets the card and
17 retrieves the ATR (Answer To Reset). Based on the ATR, it tries to
18 auto-detect which card driver to use.
19
20 The slot parameter identifies the card readerĀ“s slot. Slots are
21 numbered consecutively, starting at 0.
22
23 If OpenSC was able to connect to the card, a pointer to the sc_card_t
24 object is stored in the location pointer to by the card parameter. The
25 card handle should be released with sc_disconnect_card when no longer
26 in use.
27
29 Returns 0 if successful, or a negative value in case of error.
30
31
32
33opensc 02/16/2010 SC_CONNECT_CARD(3)