APDUResponse

internal struct APDUResponse

Represents the response from an APDU (Application Protocol Data Unit) command.

  • The data received as a response to the command.

    Declaration

    Swift

    private(set) var data: [UInt8] { get }
  • sw1

    The first status byte (SW1) of the response.

    Declaration

    Swift

    private(set) var sw1: UInt8 { get }
  • sw2

    The second status byte (SW2) of the response.

    Declaration

    Swift

    private(set) var sw2: UInt8 { get }
  • Indicates whether the response is a success based on SW1 and SW2 values (0x90, 0x00).

    Declaration

    Swift

    internal var isSuccess: Bool { get }
  • Indicates whether the response represents an error.

    Declaration

    Swift

    internal var isError: Bool { get }
  • If the response is an error, provides details about the error.

    Declaration

    Swift

    internal var error: APDUResponseError? { get }
  • Discards the response, useful in cases where you don’t need to process the response further.

    Declaration

    Swift

    internal func discardResponse()