You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Adafruit_PN532::ntag2xx_WriteNDEFURI method writes an NDEF URI in a NTAG2xx tag. To do so, it completely reformats the user data memory area. This is how that's achieved:
// Setup the record header
// See NFCForum-TS-Type-2-Tag_1.1.pdf for details
uint8_t pageHeader[12] = {
/* NDEF Lock Control TLV (must be first and always present) */
0x01, /* Tag Field (0x01 = Lock Control TLV) */
0x03, /* Payload Length (always 3) */
0xA0, /* The position inside the tag of the lock bytes (upper 4 = page
address, lower 4 = byte offset) */
0x10, /* Size in bits of the lock area */
0x44, /* Size in bytes of a page and the number of bytes each lock bit can
lock (4 bit + 4 bits) */
/* NDEF Message TLV - URI Record */
[ ... etc ... ]
};
While reformatting the memory area, the method writes a Lock Control TLV.
There are two issues with this:
The TLV, as hardcoded in the method, seems (i.e. as per back-of-the-envelope computation) to be completely wrong for all NTAG2xx platforms, and as it is hardcoded, it can ever be correct correct for at most a specific model of the platform series
In contrast to what is suggested in the comment, the TVL block does not always have to be present; the NFC Forum standard for T2T platforms states (RQ_T2T_MEM_021): "The Lock Control TLV can be present inside the Type 2 Tag Platform." And in fact, in the case of NTAG2xx platforms, it is completely useless, as the user data area is contiguous and limited by the Capability Container.
Since it is both wrong and useless, I suggest that it should not be written. If you agree, I would be happy to submit a pull request.
The text was updated successfully, but these errors were encountered:
Hello,
The
Adafruit_PN532::ntag2xx_WriteNDEFURI
method writes an NDEF URI in a NTAG2xx tag. To do so, it completely reformats the user data memory area. This is how that's achieved:While reformatting the memory area, the method writes a Lock Control TLV.
There are two issues with this:
Since it is both wrong and useless, I suggest that it should not be written. If you agree, I would be happy to submit a pull request.
The text was updated successfully, but these errors were encountered: