# CardChannel

    @objcMembers
    public class CardChannel : BaseClass

SmartCardIO - CardChannel class

A logical channel connection to a Smart Card. It is used to exchange APDUs with a Smart Card. A CardChannel object can be obtained by calling the method Card.getBasicChannel() or Card.openLogicalChannel().

- `close()`

  Closes this CardChannel

  Throws

  Status.StatusCode on failure (see enum Status.StatusCode for possible values)

  #### Declaration

  Swift

      public func close() throws

- `getCard()`

  Returns the Card this channel is associated with.

  #### Declaration

  Swift

      public func getCard() -> Card

  #### Return Value

  Associated Card object

- `getChannelNumber()`

  Returns the channel number of this CardChannel (0 for default channel).

  #### Declaration

  Swift

      public func getChannelNumber() -> Int

  #### Return Value

  Channel number as Int

- `transmit(command:)`

  Transmits the specified command APDU to the Smart Card and returns the response APDU.

  Throws

  Status.StatusCode on failure (see enum Status.StatusCode for possible values)

  #### Declaration

  Swift

      public func transmit(command: CommandAPDU) throws -> ResponseAPDU

  #### Parameters

  `command` | Command in the form of a CommandAPDU

  #### Return Value

  A response in the form of a ResponseAPDU

- `transmit(command:response:)`

  Transmits the command APDU stored in the command Data buffer and receives the reponse APDU in the response Data buffer.

  Throws

  Status.StatusCode on failure (see enum Status.StatusCode for possible values)

  #### Declaration

  Swift

      public func transmit(command: Data, response: inout Data) throws -> Int

  #### Parameters

  `command` | Command APDU in the form of a Data buffer
  `response` | Response APDU in the form of a Data buffer

  #### Return Value

  Number of response bytes on success

Copyright (c) 2018-2024, AB Circle Ltd. All rights reserved.

Generated by jazzy ♪♫ v0.14.3, a Realm project.