Read NDEF message with external NFC reader ACR1252

后端 未结 1 1917
攒了一身酷
攒了一身酷 2021-01-16 15:24

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

相关标签:
1条回答
  • 2021-01-16 15:38

    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.

    0 讨论(0)
提交回复
热议问题