sc_attach_by_reader()

Open a session to a smart card located in a reader.

Synopsis:

#include <smartcard/sc_smart_card.h>
 
sc_response_code_t sc_attach_by_reader(sc_context_t *context,                 
                                       const char *reader_name,                 
                                       sc_card_access_mode_t card_access_mode)

Since:

BlackBerry 10.2.0

Arguments:

context

The active smart card context. This value cannot be NULL.

reader_name

The name of the reader where the smart card to connect to is located. This value cannot be NULL.

card_access_mode

This parameter indicates whether the connection is open for shared or exclusive access. If the requested mode is unavailable, an error is returned.

Library:

libscs (For the qcc command, use the -l scs option to link against this library)

Description:

If the reader is unknown to the smart card subsystem, then an error is returned. Other connection options are set by the driver to optimize communication with the card.

Before opening a session to a smart card, you must first allocate a card handle by calling sc_allocate_handle(). Otherwise, an error is returned.

Returns:

SC_SCARD_S_SUCCESS upon success, an error code otherwise. See sc_response_code_t for defined error codes.