Contents

send(ins:p1:p2:data:le:)

Asynchronously sends an APDU command to the smart card.

Declaration

@backDeployed(before: macOS 27.0, iOS 27.0, tvOS 27.0, watchOS 27.0, visionOS 27.0)
final func send(ins: UInt8, p1: UInt8, p2: UInt8, data: Data? = nil, le: Int? = nil) async throws -> (sw: UInt16, response: Data)

Parameters

  • ins:

    Instruction byte of the APDU command.

  • p1:

    P1 parameter byte.

  • p2:

    P2 parameter byte.

  • data:

    Optional command data.

  • le:

    Optional expected response length.

Return Value

A tuple containing the status word (sw) and response data.

Discussion

In an async context, Swift prefers this overload over the synchronous send(ins:p1:p2:data:le:) throws method. To call the synchronous overload from an async context, use a typed function reference cast: card.send as (UInt8, UInt8, UInt8, Data?, Int?) throws -> (UInt16, Data)