使用外部NFC读取器ACR1252读取NDEF消息 [英] Read NDEF message with external NFC reader ACR1252
问题描述
我正在使用以下命令从Mifare Ultralight标签读取二进制块:FF B0 00 01 04
I am using the following command to read a binary block from a Mifare Ultralight tag: FF B0 00 01 04
但是现在我想使用ACR1252 NFC阅读器来精确存储在该Mifare Ultralight标签中的NDEF消息.我必须使用哪个命令来获取完整的NDEF消息? NDEF消息存储在标签的哪个位置?
But now I want to exact the NDEF message stored in that Mifare Ultralight tag using an ACR1252 NFC reader. Which command do I have to use to get the full NDEF message? On which position in the tag is the NDEF message stored?
推荐答案
MIFARE Ultralight标记映射到 此处为替代方法.因此,为了从此类标签中提取NDEF消息,您将需要遵循该规范定义的读取过程.
MIFARE Ultralight tags map to the NFC Forum Type 2 Tag Operation specification (broken link, here is an alternative. Consequently, in order to extract the NDEF message from such a tag, you would need to follow the read procedure defined by that specification.
您已经为您的阅读器找到了read命令:
You already found the read command for your reader:
FF B0 00 BLOCK_NUMBER 10
使用该命令(注意length字段的值为0x10),您读取了从BLOCK_NUMBER
开始的4个连续块.
With that command (note the value 0x10 for the length field) you read 4 consecutive blocks starting at BLOCK_NUMBER
.
然后您将首先阅读功能容器(位于块3):
You would then first read the capability container (located at block 3):
FF B0 00 03 10
前4个字节(1个块)是功能容器:
The first 4 bytes (1 block) are the capability container:
- 将字节0设置为"magic"值
0xE1
,以指示标签遵循NFC论坛2类标签操作规范使用NDEF映射. - 字节1表示映射版本.
- 字节2指示标签的内存大小.
- 字节3表示访问限制.
- Byte 0 is set to the "magic" value
0xE1
to indicate that the tag uses an NDEF mapping following the NFC Forum Type 2 Tag Operation specification. - Byte 1 indicates the mapping version.
- Byte 2 indicates the memory size of the tag.
- Byte 3 indicates access restrictions.
一旦您确认标签符合NDEF映射规范,就可以读取从块4开始的数据(您已经使用上述命令读取了块4-6).这些块在TLV结构中包含带有标签0x03的NDEF消息.有关TLV结构的详细信息,请参见使用低级NFC通信方法将NDEF数据写入NTAG216标签.
Once you verified that the tag matches the NDEF mapping specification, you can read data starting at block 4 (you already read blocks 4-6 with the above command). Those blocks contain the NDEF message in a TLV structure with the tag 0x03. See Writing NDEF data to NTAG216 tag using low-level NFC communication methods for details on TLV structures.
这篇关于使用外部NFC读取器ACR1252读取NDEF消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!