readSingleBlock(requestFlags:blockNumber:completionHandler:)
Sends a Read Single Block command (0x20 command code), as defined in the ISO 15693-3 specification, to the tag.
Declaration
func readSingleBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: UInt8, completionHandler: @escaping @Sendable (Data, (any Error)?) -> Void)func readSingleBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: UInt8) async throws -> DataParameters
- flags:
The request flags. The Requestflagaddress flag is enforced by default. However, using the Requestflagselect flag disables the Requestflagaddress flag.
- blockNumber:
The number of the block to read. Blocks are numbered from 0 to 255 inclusively.
- 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:
- data
A Nsdata object containing the blocks of data read from the tag. If the request flags include Requestflagoption, the first byte of the data contains the associated block security status.
- error
nilwhen the operation is successful; otherwise, an Nserror object indicating that a problem occurred while communicating with the tag.
When the tag responds with a command error, the error’s Userinfo directory contains the Nfciso15693tagresponseerrorkey and the error’s Code property has a value defined in the ISO15693-3 specification.
Discussion
This method sends the tag’s identifier with the command.