Contents

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

Synchronously sends an APDU command to the smart card.

Declaration

func send(ins: UInt8, p1: UInt8, p2: UInt8, data: Data? = nil, le: Int? = nil) 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

Use this method when you need synchronous execution, such as within withSession blocks or when calling from synchronous code paths.