Protocol

NFCISO15693Tag

An interface for interacting with an ISO 15693 tag.

Declaration

protocol NFCISO15693Tag

Overview

The NFCTagReaderSessionDelegate receives an object that conforms to the NFCISO15693Tag protocol when the NFCTagReaderSession detects an ISO 15693-compatible tag. For the delegate to receive the tag object, your app must include the Near Field Communication Tag Reader Session Formats Entitlement.

For the reader session to read and write data to the tag, it must be available to the reader session. Use the isAvailable property to check the tag’s availability.

Topics

Getting Tag Information

var icManufacturerCode: Int

The IC manufacturer code of the tag.

Required.

var icSerialNumber: Data

The IC serial number assigned to the tag by the manufacturer.

Required.

var identifier: Data

The unique hardware identifier of the tag.

Required.

Selecting Request Flag Options

struct RequestFlag

A set of bit mask options that, when combined, define the request flags to use when sending a command.

Getting System Information

func getSystemInfo(requestFlags: RequestFlag, completionHandler: (Int, Int, Int, Int, Int, Error?) -> Void)

Sends the Get System Information command (0x2B command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

Sending Single Block Commands

func readSingleBlock(requestFlags: RequestFlag, blockNumber: UInt8, completionHandler: (Data, Error?) -> Void)

Sends a Read Single Block command (0x20 command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

func writeSingleBlock(requestFlags: RequestFlag, blockNumber: UInt8, dataBlock: Data, completionHandler: (Error?) -> Void)

Sends the Write Single Block command (0x21 command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

func lockBlock(requestFlags: RequestFlag, blockNumber: UInt8, completionHandler: (Error?) -> Void)

Sends the Lock Block command (0x22 command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

Sending Multi-block Commands

func readMultipleBlocks(requestFlags: RequestFlag, blockRange: NSRange, completionHandler: ([Data], Error?) -> Void)

Sends the Read Multiple Blocks command (0x23 command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

func writeMultipleBlocks(requestFlags: RequestFlag, blockRange: NSRange, dataBlocks: [Data], completionHandler: (Error?) -> Void)

Sends the Write Multiple Blocks command (0x24 command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

func getMultipleBlockSecurityStatus(requestFlags: RequestFlag, blockRange: NSRange, completionHandler: ([NSNumber], Error?) -> Void)

Sends the Get Multiple Block Security Status command (0x2C command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

Sending Application Family Identifier Commands

func writeAFI(requestFlags: RequestFlag, afi: UInt8, completionHandler: (Error?) -> Void)

Sends the Write AFI command (0x27 command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

func lockAFI(requestFlags: RequestFlag, completionHandler: (Error?) -> Void)

Sends the Lock AFI command (0x28 command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

Sending Data Storage Format Identifier Commands

func writeDSFID(requestFlags: RequestFlag, dsfid: UInt8, completionHandler: (Error?) -> Void)

Sends the Write DSFID command (0x29 command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

func lockDFSID(requestFlags: RequestFlag, completionHandler: (Error?) -> Void)

Sends the Lock DSFID command (0x2A command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

Sending Reset to Ready Command

func resetToReady(requestFlags: RequestFlag, completionHandler: (Error?) -> Void)

Sends the Reset To Ready command (0x26 command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

Sending Select Command

func select(requestFlags: RequestFlag, completionHandler: (Error?) -> Void)

Sends the Select command (0x25 command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

Sending Stay Quiet Command

func stayQuiet(completionHandler: (Error?) -> Void)

Sends a Stay Quiet command (0x02 command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

Sending Custom Commands

func customCommand(requestFlags: RequestFlag, customCommandCode: Int, customRequestParameters: Data, completionHandler: (Data, Error?) -> Void)

Sends a custom command (0xA0 to 0xDF command code), as defined in the ISO 15693-3 specification, to the tag.

Required.

Sending Extended Commands

func extendedReadSingleBlock(requestFlags: RequestFlag, blockNumber: Int, completionHandler: (Data, Error?) -> Void)

Sends the Extended Read Single Block command (0x30 command code), as defined in the NFC Forum Type 5 tag specification, to the tag.

Required.

func extendedWriteSingleBlock(requestFlags: RequestFlag, blockNumber: Int, dataBlock: Data, completionHandler: (Error?) -> Void)

Sends the Extended Write Single Block command (0x31 command code), as defined in the NFC Forum Type 5 tag specification, to the tag.

Required.

func extendedLockBlock(requestFlags: RequestFlag, blockNumber: Int, completionHandler: (Error?) -> Void)

Sends the Extended Lock Single Block command (0x32 command code), as defined in the NFC Forum Type 5 tag specification, to the tag.

Required.

func extendedReadMultipleBlocks(requestFlags: RequestFlag, blockRange: NSRange, completionHandler: ([Data], Error?) -> Void)

Sends the Extended Read Multiple Block command (0x33 command code), as defined in the NFC Forum Type 5 tag specification, to the tag.

Required.

Getting Response Errors

let NFCISO15693TagResponseErrorKey: String

A user information dictionary key indicating that a tag responded with a command error.

Relationships

Inherits From

See Also

Tag Types

Creating NFC Tags from Your iPhone

Save data to tags, and interact with them using native tag protocols.

protocol NFCISO7816Tag

An interface for interacting with an ISO 7816 tag.

protocol NFCFeliCaTag

An interface for interacting with a FeliCa™ tag.

protocol NFCMiFareTag

An interface for interacting with a MIFARE® tag.

protocol NFCNDEFTag

An interface for interacting with an NDEF tag.

enum NFCTag

An object that represents an NFC tag object.

class NFCTagCommandConfiguration

A set of parameters you use to define the configuration of an NFC tag command.