sendMiFareCommand(commandPacket:completionHandler:)
Sends a native MIFARE command to the tag.
Declaration
func sendMiFareCommand(commandPacket command: Data, completionHandler: @escaping @Sendable (Data, (any Error)?) -> Void)func sendMiFareCommand(commandPacket command: Data) async throws -> DataParameters
- command:
A MIFARE command. For Ultralight commands, you must calculate a 2-byte CRC value and append it to the end of the
commanddata. - completionHandler:
A handler that the reader session invokes after the operation completes. The session calls
completionHandleron the dispatch queue that you provided when creating the Nfctagreadersession object.The handler has the following parameters:
Discussion
Use this method to send commands to tags that are from the NFCMiFareFamily.ultralight, NFCMiFareFamily.plus, and NFCMiFareFamily.desfire product families.
This method supports command chaining, passing the full response composed of the individual fragments to the completionHandler.