SmartCardSession::reconnect()

Re-establish an existing connection to a smart card.

Synopsis:

#include <smartcard_spi/SmartCardSession.hpp>
virtual sc_response_code_t smartcard_spi::SmartCardSession::reconnect(unsigned int flags, unsigned int preferredProtocols, sc_card_disposition_t dispositionAction, sc_protocol_t &activeProtocol)=0

Since:

BlackBerry 10.3.0

Arguments:

flags
This parameter describes the desired access mode and is used to indicate three things:
  • First, it indicates whether the connection is opened for shared or exclusive access. If the requested mode is unavailable, an error is returned.
  • Second, it indicates whether the caller desires a "direct" connection to the reader. Direct mode implies that a connection will be established even if a card is not present.
  • Finally, it is a hint to the reader indicating whether it should use default reader-card communication settings to attempt to optimize those settings if the card is still in negotiable mode, as defined by ISO/IEC 7816.
preferredProtocols

The set of protocols that can be used when initializing the connection to the card. Note that only one of the protocols identified in this parameter will be used. If none of the listed protocols is available, then an error is returned.

dispositionAction

The desired action to be performed as part of re-establishing the connection to the card.

activeProtocol

The actual protocol used in the connection to the smart card, which is populated by this function.

Library:

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

Description:

This function re-establishes an existing connection to a smart card. For example, you can use this function to:

  • Change the mode of an existing connection (by using the flags parameter).
  • Acknowledge and clear error conditions that are preventing access to the card.

Note that a connection must have previously been established, otherwise an error is returned.

Returns:

If successful, SCARD_S_SUCCESS is returned. Otherwise, an error code is returned.