CardTerminal
public protocol CardTerminal : AnyObject
A Smart Card terminal, sometimes referred to as a Smart Card Reader. A
CardTerminal object can be obtained by calling CardTerminals.list() or
CardTerminals.terminal(name:).
Note that physical card readers with slots for multiple cards are
represented by one CardTerminal object per such slot.
See also
See also
Version
1.0
Date
6 Nov 2017
-
Returns the unique name of this terminal.
Declaration
Swift
var name: String { get } -
Establishes a connection to the card. If a connection has previously established using the specified protocol, this method returns the same Card object as the previous call.
Throws
CardError.illegalArgumentif protocol is an invalid protocol specification;CardError.cardNotPresentif no card is present in this terminal;CardError.operationFailedif a connection could not be established using the specified protocol or if a connection has previously been established using a different protocolDeclaration
Swift
func connect(protocolString: String) throws -> CardParameters
protocolStringthe protocol to use (“T=0”, “T=1”, or “T=CL”), or “*” to connect using any available protocol.
Return Value
the Card object
-
Returns whether a card is present in this terminal.
Throws
CardError.operationFailedif the status could not be determinedDeclaration
Swift
func isCardPresent() throws -> BoolReturn Value
whether a card is present in this terminal
-
Waits until a card is present in this terminal or the timeout expires. If the method returns due to an expired timeout, it returns
false. Otherwise it returnstrue.If a card is present in this terminal when this method is called, it returns immediately.
Throws
CardError.illegalArgumentif timeout is negative;CardError.operationFailedif the operation failedDeclaration
Swift
func waitForCardPresent(timeout: Int) throws -> BoolParameters
timeoutif positive, block for up to
timeoutmilliseconds; if zero, block indefinitely; must not be negativeReturn Value
falseif the method returns due to an expired timeout,trueotherwise -
Waits until a card is absent in this terminal or the timeout expires. If the method returns due to an expired timeout, it returns
false. Otherwise it returnstrue.If no card is present in this terminal when this method is called, it returns immediately.
Throws
CardError.illegalArgumentif timeout is negative;CardError.operationFailedif the operation failedDeclaration
Swift
func waitForCardAbsent(timeout: Int) throws -> BoolParameters
timeoutif positive, block for up to
timeoutmilliseconds; if zero, block indefinitely; must not be negativeReturn Value
falseif the method returns due to an expired timeout,trueotherwise