简体   繁体   中英

NDEF vs APDU NFC Android

Can you tell me please what is the difference between NDEF (NFC Data Exchange Format) and APDU (Application Protocol Data Unit).

I have developed an Android application that reads NDEF messages, and I want to know if it can work for APDU data too.

NFC Data Exchange Format (NDEF)

NDEF is a wrapper format that allows you to package a data payload together with meta information (such as a data type identification), and that permits combining multiple such packages (so-called "records") in one "message" that can be stored on NFC tags and transfered across an NFC link.

NDEF itself does not define how such data (messages) should be exchanged between NFC devices (ie it does not define the communication protocol and commands to read or store such data).

Application Protocol Data Unit (APDU)

APDUs are the command and response packets for communication with smartcards. A command APDU consists of an instruction code and associated parameter data. A resonse APDU consists of response data and a response status code (in response to a preceding command APDU).

What's the difference?

NDEF is data container for storing structured data on NFC tags and transfering such data over peer-to-peer links while APDUs are commands and responses of a communication protocol for smartcards.

Are APDUs and NDEF somehow related?

With NFC Forum Type 4 tags, APDU commands (like READ BINARY and STORE BINARY) are used to read and store NDEF data into a file on that tag type. Other NFC Forum tag types do not rely on APDUs but use other command sets.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM