CardReaderType
public protocol CardReaderType : AnyObject
General card reader representation.
A card reader represents only one (logical) slot, when a CardReader supports multiple cards at the same time it needs to provide a CardReaderType for each slot.
-
CardReader name
Declaration
Swift
var name: String { get }
-
displayName
Default implementationReturns the system displayable name of this reader.
Default Implementation
if there is no distinction necessary, displayName returns CardReader name per default
Declaration
Swift
var displayName: String { get }
-
Whether there is a SmartCard present (mute or not) at the time of reading the property
Declaration
Swift
var cardPresent: Bool { get }
-
Add an execution block for when a card is presented
Declaration
Swift
func onCardPresenceChanged(_ block: @escaping (CardReaderType) -> Void)
Parameters
block
Block that takes the CardReader as parameter
-
Connect to the currently present SmartCard.
Throws
CardError
when the connection could not be establishedDeclaration
Swift
func connect(_ params: [String : Any]) throws -> CardType?
Parameters
params
Map with arbitrary parameters that might be necessary to connect the specific reader to a Card/Channel. E.g. NFC Card Reader
Return Value
instance of the CardType that has been connected or nil on mute (there is a card inserted but no communication with it is possible, e.g. it is inserted upside down)