Instance Method

sendCommand(apdu:completionHandler:)

Sends an application protocol data unit (APDU) to the tag and receives a response APDU.

Required.

Declaration

func sendCommand(apdu: NFCISO7816APDU, completionHandler: @escaping (Data, UInt8, UInt8, Error?) -> Void)

Parameters

apdu

An application protocol data unit to send to the tag.

completionHandler

A handler that the reader session invokes after the operation completes. The handler has the following parameters:

responseData

The response data, which may be empty even if the operation completes successfully.

sw1

The SW1 command-processing status byte. This value is always valid.

sw2

The SW2 command-processing status byte. This value is always valid.

error

nil when the operation completes successfully; otherwise, an NSError object when there's a communication issue with the tag.

The session calls completionHandler on the dispatch queue that you provided when creating the NFCTagReaderSession object.

See Also

Sending a Command

class NFCISO7816APDU

An object representing an ISO 7816 application protocol data unit (APDU).