CardChannelType

public protocol CardChannelType

General card communications protocol

  • The associated card with this channel Note: implementers may choose to hold a weak reference

    Declaration

    Swift

    var card: CardType { get }
  • The channel number

    Declaration

    Swift

    var channelNumber: Int { get }
  • Identify whether a channel supports APDU extended length commands/responses

    Declaration

    Swift

    var extendedLengthSupported: Bool { get }
  • Max length of APDU body in bytes.

    Note

    HealthCards COS typically support up to max 4096 byte body-length

    Declaration

    Swift

    var maxMessageLength: Int { get }
  • Max length of a APDU response.

    Declaration

    Swift

    var maxResponseLength: Int { get }
  • Transceive a (APDU) command

    Throws

    CardError when transmitting and/or receiving the response failed

    Declaration

    Swift

    func transmit(command: CommandType, writeTimeout: TimeInterval, readTimeout: TimeInterval) throws -> ResponseType

    Parameters

    command

    the prepared command

    writeTimeout

    the max waiting time in seconds before the first byte should have been sent. (<= 0 = no timeout)

    readTimeout

    the max waiting time in seconds before the first byte should have been received. (<= 0 = no timeout)

    Return Value

    the Command APDU Response or CardError on failure

  • Close the channel for subsequent actions.

    Throws

    Throws CardError

    Declaration

    Swift

    func close() throws