Read NDEF message with external NFC reader ACR1252

岁酱吖の 提交于 2019-12-01 11:29:20

问题


I am using the following command to read a binary block from a Mifare Ultralight tag: FF B0 00 01 04

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?


回答1:


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.

You already found the read command for your reader:

FF B0 00 BLOCK_NUMBER 10

With that command (note the value 0x10 for the length field) you read 4 consecutive blocks starting at BLOCK_NUMBER.

You would then first read the capability container (located at block 3):

FF B0 00 03 10

The first 4 bytes (1 block) are the capability container:

  • 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.

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.



来源:https://stackoverflow.com/questions/49228805/read-ndef-message-with-external-nfc-reader-acr1252

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!