pythonraspberry-pinfcrfidndef

Defining a NDEF Message


I am working on a Python project with my Raspberry Pi and the RFID-RC522 board. As NFC tags I use NXP NTAG213. My plan now is to store links on the tags. I can read/write on them without a problem. But I don't understand how to define the NDEF header for the stored data on the tags.

When I write a link on the tags with my smartphone and read it with my program the stored data on the tag looks like this:

The NDEF header for the URL "http://www.gmx.at" is

[3, 11, 209, 1, 7, 85, 1, ... (Data)]

I recognized that some of these parameters change when I write another link, but some still stay the same.

I found this tutorial which describes the different fields of the NDEF header but I still don't get how I need to set them to store a link to a website.

I would be very happy if someone can describe how I need to calculate/define the parameters for a link correctly.


Solution

  • In order to understand the NDEF format and the way how NDEF formatted data is stored on an NFC Forum Type 2 tag (which is the tag platform that is implemented by the NTAG213), I suggest that you read the following NFC Forum specifications:

    The data that you read from the tag is an NDEF Message TLV object containing an NDEF message that consists of one URI record.