4

NFC和NDEF究竟是什么关系?是否任何 NFC 设备总是必须具有 NDEF 格式的数据?或者是否有可能有 NFC 但没有 NDEF(虽然我认为反之亦然是不可能的?)?一张空的 NFC 卡会是什么样子?它是否仍然有 NDEF 标头信息但没有有效负载?或者标签是否可能完全为空,即也没有任何标题信息?在那种情况下,这仍然可以被安卓手机或读卡器检测到吗?究竟是什么让阅读器能够检测到标签?

4

2 回答 2

15

In NFC communication there are mainly three modes of operation

  1. Reader/Writer Mode (PCD)
  2. Peer-to-Peer Mode (NFC)
  3. Tag/Card Emulation Mode (PICC)



The base of NFC is antenna coupling, whenever an NFC device approaches another one antenna coupling occurs, there is a Multiprotocol RF front-end IC chip connected to the reader/writer device, the other device can be a reader/writer device or simply a NFC tag (an nfc tag is nothing but an antenna and a data storage). Communication takes place only when the ISO?IEC 18092 & ISO/IEC 14443 protocols are passed, otherwise no communication will take place.

What exactly is the relationship between NFC and NDEF?

In android all NFC devices are detected and processed as PICC devices, android.nfc package provides access to Near Field Communication (NFC) functionality, allowing applications to read NDEF message in NFC tags

Does any NFC device always have to have data in NDEF format?

Yes and no, In this mode the NFC device emulates an ISO 14443 smart card or a smart card chip integrated in the mobile devices is connected to the antenna of the NFC module. A legacy reader cannot distinguish a mobile phone operating in tag emulation mode from an ordinary smart card.

This is an advantage of NFC technology as already existing reader infrastructures do not need to be replaced. The smart card chip used for tag emulation is also referred to as secure element.

Is it possible to have NFC but not NDEF?

Yes, it is fairly covered here : Advanced NFC

What would an empty NFC card be like? Would it still have the NDEF header information but no payload? Or is it possible for the tag to be completely empty, that is, not have any header information either?

NDEF is made of four parts
3-bit TNF (Type Name Format)
Indicates how to interpret the variable length type field.
Variable length type
Describes the type of the record. If using TNF_WELL_KNOWN, use this field to specify the Record Type Definition (RTD).
Variable length ID
A unique identifier for the record. This field is not used often, but if you need to uniquely identify a tag, you can create an ID for it.
Variable length payload
The actual data payload that you want to read or write. An NDEF message can contain one or none or multiple NDEF records, so don't assume the full payload is in the first NDEF record of the NDEF message.

In that case, would this still be detectable by an android phone or a card reader? What exactly makes a tag to be detected by a reader?

The tag dispatch system uses the Type Name Format(TNF) and type fields to try to map a MIME type or URI to the NDEF message. If successful, it encapsulates that information inside of a ACTION_NDEF_DISCOVERED intent along with the actual payload. However, there are cases when the tag dispatch system cannot determine the type of data based on the first NDEF record. This happens when the NDEF data cannot be mapped to a MIME type or URI, or when the NFC tag does not contain NDEF data to begin with. In such cases, a Tag object that has information about the tag's technologies and the payload are encapsulated inside of a ACTION_TECH_DISCOVERED intent instead.

For an empty message the TNF will be TNF_EMPTY(Indicates the record is empty. Type, id and payload fields are empty in a TNF_EMPTY record.) in such cases it falls back to ACTION_TECH_DISCOVERED.

Refer these links

于 2013-08-02T10:40:04.160 回答
3

NFC 是一套电信标准,NDEF 是一种数据格式。所以 NFC 和 NDEF 是相互独立存在的,例如一个 NDEF 消息可以是一个文件。

NDEF 记录直接定义了一条消息,因此不存在空 NDEF 消息(它将是 0 字节)之类的东西。然而,许多类型的标签可以被格式化为“NDEF”,因为在写入实际的 NDEF 数据之前,必须就访问密钥和数据区域等概念达成一致,否则存储的 NDEF 数据将无法被第三方读取(违背整点使用标准)。

标签本身永远不会为空(如硬盘),但写入它们的数据可以说有用数据的数量为零。

无源(标签)NFC 设备由有源(电话/阅读器)NFC 设备供电。也就是说,有源设备会关闭(轮询)磁场,从而让无源设备为其内部电路和通信天线获取电力。

于 2013-08-03T22:38:08.570 回答