connect

fun connect(readerName: String, waitTimeoutMillis: Long = DEFAULT_WAIT_TIMEOUT_MILLIS, supportsExtendedLength: Boolean = false): SmartCardTransport

Waits for a card in the named reader, then connects with any available protocol and uses its basic channel.

The default wait is 30 seconds. A value of zero waits indefinitely, as specified by CardTerminal.waitForCardPresent. A timeout is reported as NfcTimeout with limit WAIT_FOR_DOCUMENT: the wait is the app's own. Extended-length support is disabled by default because PC/SC reader and driver support varies.

Return

A transport for the connected card's basic channel. Close it when the session ends.

Since

1.0.0

Parameters

readerName

The exact name returned by listReaders.

waitTimeoutMillis

Maximum wait in milliseconds; zero waits indefinitely.

supportsExtendedLength

Set to true only if the selected reader path is known to support extended-length APDUs.

Throws

if the reader is missing, the wait times out, or PC/SC cannot connect to the card.