The Basics of NDEF
Overview
- Intro
- NFC Tag Types
- NDEF Messages
- NDEF Records
- Type Name Format (TNF)
- Record Type Definition (RTD)
Intro
NFC Data Exchange Format, or NDEF, is the most widely supported format for writing and reading NFC tag data. It’s a lightweight, binary message format used to encapsulate arbitrary data like URL’s or MIME-TYPE. The format is composed of NDEF Messages which contain an array of NDEF Records each encapsulating a certain type of data.
NFC Tag Types
The NFC Forum has drafted a number of specifications to ensure that tag and reader manufacturers maintain interoperability. The forum has outlined specs for four different types of tags, each with different features and payload sizes:
- NFC Forum Type 1 Tag
- Example: Innovision Topaz
- Users can configure the tag to become read-only
- Memory availability is 96 bytes and expandable to 2 kbyte.
- NFC Forum Type 2 Tag
- Example: NXP MIFARE Ultralight
- Users can configure the tag to become read-only.
- Memory availability is 48 bytes and expandable to 2 kbyte.
- NFC Forum Type 3 Tag
- Example: Sony Felica
- Manufacturer can configure tag to become read-only
- Memory availability up to 1MByte.
- NFC Forum Type 4 Tag
- Example: NXP MIFARE Desfire
- Manufacturer can configure tag to become read-only
- Memory availability up to 1MByte.
- NFC Forum Type 5 Tag
- Example: TI TagIt Plus
- Manufacturer can configure tag to become read-only
- Memory availability up to 1MByte.
Any NFC Forum certified device is guaranteed to work with these four tag types.
NDEF Messages
It’s easiest to think of an NDEF Message as an array of NDEF records. Typically tags contain a single NDEF message however it’s possible for there to be multiple.
NDEF Records
NDEF records are the heart of NFC data exchange. NDEF Record payload can contain a wide variety of data including URI’s, URL’s, vCards, and more.
NDEF records are composed of :
- Type Name Format (TNF)
- The TNF indicates how to interpret the Record Type Definition
- Record Type Definition (RTD)
- Describes the format of the record
- ID:
- A unique identifier for the record
- Payload:
- The actual data payload
Type Name Format (TNF)
The Type Name Format (or TNF) field indicates the structure of the value of the Record Type Definition.
- Mime Media Type
- Indicates the type field contains a value that follows the media-type BNF construct defined by RFC 2046.
- Well Known Type
- Indicates the the RTD follows the guidelines set forth in the NFC Forum RTD specification.
Record Type Definitions (RTD)
NFC Record Type Definitions (RTD) specify the record formats for specific applications.
- Generic Control
- Provides a simple way to request a specific action (such as starting an application or setting a mode) to an NFC Forum device (destination device) from another NFC Forum device, tag or card (source device) through NFC communication.
- Smart Posters
- Defines an NFC Forum Well Known Type to put URLs, SMSs or phone numbers on an NFC tag, or to transport them between devices. The Smart Poster RTD builds on the RTD mechanism and NDEF format and uses the URI RTD and Text RTD as building blocks.
- Text
- Provides an efficient way to store text strings in multiple languages by using the RTD mechanism and NDEF format.
- URI
- Provides an efficient way to store Uniform Resource Identifiers (URI) by using the RTD mechanism and NDEF format.
More Resources
For more information see one of the following:
- Flomio NDEF Android Tutorial
- Flomio NDEF Helper (Android)
Leave a Reply
Want to join the discussion?Feel free to contribute!