0
votes

So I have some NTAG216 tag from NXP. They have 888 bytes memory. If they are used just with my Android application the phone recognise them as 888 bytes. But after I write some message to them with my Raspberry Pi using libnfc the phone recognizes them as 238 bytes long (both the phone and the Pi uses the NDEF format and writes just the user memory of the tag). The Pi can read back its messages and can use the whole 888 bytes of memory, unlike the phone :/, the phone can only read the message if it is shorter than 238 bytes... (I am using the compatibility write mode of the NTAG216 with the Pi)

Does anyone has idea what is wrong?

1
What data do you write to the tag? Specifically, what does the Capability Container (block 3) look like?Michael Roland
The capability looks like E1 11 6F... I have found one possible solution. In the function what creates the ndef message the length is just 1 byte long. So it is always a short message. And the function as I experienced is just for short messages.Sándor Megyeri

1 Answers

0
votes

So I have found some explanation for this problem. And created some sort of solution.

The problem is that the function in the android`s NFC library always creates an NDEF short message and the message length is stored in one byte. Which means the maximum length is just 256 byte with the ndef part. Why the NXP-s OWN program discover this tag just as 238 bytes... Well because it definitely has some errors inside, well better android have some serious issue handling NFC, becaus with a microsoft Lumia this tags dicovered as 888 bytes long without any problem.

Finally, the solution is use advanced NFC classes and write it from byte to byte. It will grant better understanding how this whole NFC works. With this you can create your own message protocol a bit better than this NDEF thing. For me the solution was to use an extra four bytes at the end of the memory. With this I can adress much longer messages (2^32)than this tags can store. I also indicate in this four bytes if Ndef is present in the tag, becaus in this case I have to cut the first 7bytes of the message. And yes as you may found out I have create the ndef part of the message manually (for compatibility I need some part of the message to be readable with any application). I write just short messages, because the long messages of android and Lumia is different (Lumia can`t read what android has written and vice versa).

So have a good time with programming if you want to use the whole memory with android and use the nfc advanced :). I hope it will be easier in Windows Phone OS.