NFC Operating Modes
The operating mode determines the specific kind of task that Near Field Communication (NFC) is performing at any given time. The devices interacting at the time allow for certain operating modes.
NFC card emulation mode
Card emulation mode places the NFC device in passive communication mode. The device acts precisely the same as a smart card. The figure shows some of the ways in which you can use an NFC device in card emulation mode. It’s important to remember that NFC security (through an SE or HCE) only protects the tokens used to identify the individual. You must still have an application that provides security for the data.
Your NFC-enabled device can emulate more than one smart card, and the smart card support can include more than one form of identification. For example, the same digital wallet can hold loyalty cards and credit cards.
NFC reader/writer mode
When working in reader/writer mode, most NFC devices act as readers, as shown here. The NFC device works in active mode to read the content of a tag. When it detects two or more tags, it relies on an anticollision algorithm to select just one tag. The NFC device must also detect the tag type (ISO/IEC 14443 A/B or FeliCa) and interact with it appropriately. The method used to perform anticollision depends on the tag type.
The application that interacts with the NFC data interprets the tag data and reacts accordingly. For example, when reading a tag containing a Uniform Resource Identifier (URI), the device opens a browser and the browser opens the content pointed at by the URI. All the user sees is a browser with web content displayed in it — the process for opening the URI remains hidden from view.
The originator of a tag can protect the tag content. Some tags provide for global locking, while other tags allow locking of selected data within a protected area of memory. When the tag remains unlocked, an NFC device can also write data to the tag. In order to write data to a tag, you must have a tag writer application, such as TagWriter installed on your device. After the application starts, you typically use steps like these to write data to a tag:
- Select an encoding type. The encoding type determines the kind of data that the tag contains. Here are some typical encoding types:
- Plain text
- Short Message Service (SMS)
- Define a bookmark to hold the data.
- Create the data.
- Choose the encoding options, which can include:
- Locking the tag from further changes
- Writing multiple tags using the same data
- Confirming the overwriting of existing tag data
- Tap the tag to encode it.
The process will typically take a few seconds, so you must leave the device in place until the application tells you that encoding is complete.
NFC peer-to-peer mode
Two powered devices can engage in peer-to-peer mode, which is NFC specific. However, the initiator starts with its RF field turned on, and the target starts with its RF field turned off. (The target can also go into passive mode in order to reduce power usage.) The RF field state changes as the direction of communication changes. This figure shows typical uses for peer-to-peer mode.
Be sure to note that NFC devices use a listen-before-talk protocol. The devices listen to ensure that no other device is transmitting before the device tries to transmit any information itself. Using listen before talk helps ensure that communication between devices doesn’t suffer from interference from other devices. Given the short distances that NFC uses, the amount of interference is usually negligible, so listen before talk is the only protocol needed for this particular requirement.
During the initial communication, the two devices determine the communication parameters, such as data block size. The maximum data block size is 256 bytes. In many cases, peer-to-peer mode is used for pairing of the devices to use some other means of transferring the actual data, such as Wi-Fi or Bluetooth. This process is referred to as Connection Handover.