Open a session to the smart card that corresponds to a card ID.
#include <smartcard/sc_smart_card.h>
sc_response_code_t sc_attach_by_smart_card_id(sc_context_t *context,
sc_smart_card_id_t *smart_card_id,
sc_handle_type_t handle_type,
sc_card_access_mode_t card_access_mode)
BlackBerry 10.2.0
The active smart card context. This value cannot be NULL.
The smart card ID to attach to. This value cannot be NULL.
The type of smart card resource the session is used with. For example, if the smart card is used to perform cryptographic operations, then specify a value of SC_HANDLE_CARD_CRYPTO_PROVIDER_X.
This parameter indicates whether the connection is opened for shared or exclusive access. If the requested mode is unavailable, an error is returned.
If the expected card is not found, the user is prompted to insert the specified card based on the provided card ID.
If this function completely successfully, a smart card handle is added to the provided context. For this reason, it is necessary to explicitly release the handle using sc_free_handle() before another smart card handle can be allocated.