How to write NDEF record across multiple blocks with MIFARE 1k classic?

I writing an application in C# that writes a NDEF record to a MIFARE 1k tag. Im using the ACR122 contactless card reader to send APDU commands.

The record that I want to write is URI type, and it needs to be long, so thats where my problem begins.

So far Im able to write to whichever block I want, but I can only read what is written in the first sector (blocks 4,5 and 6). blocks 8 and 9 (second sector) have content but cannot be read.

Since I cant write to the sector block, i make the jump from block 6 to 8. So, Im not sure if I have to set a byte that indicates that the message continues on the other block.

Any thoughts?

Im using my android nfc enable to read the messages...


The complete documentation on how NDEF messages are written to and read from MIFARE Classic tags is publicly available, see http://www.nxp.com/documents/application_note/AN1304.pdf and http://www.nxp.com/documents/application_note/AN1305.pdf.

What has to be done in your case boils down to:

  • Write in sector 0 (= MIFARE Application Directory) in which sectors the NDEF message will be stored
  • Write the bytes of the NDEF TLV into the data blocks of these sectors.
  • There is no need to add any management data to the data blocks containing the NDEF data. Be careful, though, to configure the different sector trailer blocks correctly, otherwise the NDEF message will not be detected correctly.

    链接地址: http://www.djcxy.com/p/70142.html

    上一篇: 是否可以将2个URI写入1 NFC标签?

    下一篇: 如何使用MIFARE 1k classic在多个块中编写NDEF记录?