Contents

sendMiFareISO7816Command(_:completionHandler:)

Sends an ISO 7816 command APDU to the tag and receives a response APDU.

Declaration

func sendMiFareISO7816Command(_ apdu: NFCISO7816APDU, completionHandler: @escaping  @Sendable (Data, UInt8, UInt8, (any Error)?) -> Void)
func sendMiFareISO7816Command(_ apdu: NFCISO7816APDU) async throws -> (Data, UInt8, UInt8)

Parameters

  • apdu:

    An ISO 7816-4 command APDU object.

  • completionHandler:

    A handler that the reader session invokes after the operation completes. The session calls completionHandler on the dispatch queue that you provided when creating the Nfctagreadersession object.

    The handler has the following parameters:

    responseData

    An Nsdata object containing the APDU response.

    sw1

    The SW1 command-processing status byte.

    sw2

    The SW2 command-processing status byte.

    error

    nil when the operation is successful; otherwise, an Nserror object indicating that a problem occurred while communicating with the tag, or that the tag doesn’t support ISO 7816-4 commands.

Discussion

Use this method to send commands to tags that have a mifareFamily value of either NFCMiFareFamily.plus or NFCMiFareFamily.desfire.

See Also

Sending Commands