nRF5 SDK v13.1.0
Writable NDEF Message Example

The Writable NDEF Message Example shows how to use the NFC tag to expose an NDEF message, which can be overwritten with any other NDEF message by NFC device.

When the application starts, it initializes the NFC tag and generates a URI message with a URI record containing the URL "nordicsemi.com". Then it sets up the NFC library for Type 4 Tag platform, which uses the generated message and senses the external NFC field. The library works in Read-Write emulation mode. In this mode, procedures for reading and updating an NDEF message are handled internally by NFC library.

The only events handled by the application are the NFC events. Each of these events is related to following LEDs actions:

NFC event LED action
NFC field on LED 1 is lit.
NDEF message read LED 4 is lit.
NDEF message updated LED 2 is lit.
NFC field off All LEDs are turned off.

The Writable NDEF Message Example shows the usage of the NFC Type 4 Tag and the URI message generation modules.

You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\nfc\experimental_writable_ndef_msg

Note
This application is not power optimized!

Testing

Test the Writable NDEF Message Example with a smartphone or a tablet with NFC support by performing the following steps:

  1. Compile and program the application.
  2. Touch the NFC antenna with the smartphone or tablet and observe that LED 1 and LED 4 are lit.
  3. Observe that the smartphone/tablet tries to open the URL "http://www.nordicsemi.com" in a web browser.
  4. Use a proper application (e.g. NFC Tools for Android) to overwrite the existing NDEF message with your own message.
  5. Observe that LED2 is lit after a successful overwrite.
  6. Move the smartphone/tablet away from the NFC antenna and observe that all LEDs are turned off.

Documentation feedback | Developer Zone | Subscribe | Updated