I am authenticating my tag using this piece of code
nfcA.connect();
byte[] authResponse = nfcA.transceive(new byte[]{
(byte)0x1b,
pwd[0], pwd[1], pwd[2], pwd[3]
});
nfcA.close();
I checked the result of authResponse and it is equal to my pack. After authenticating, I write NDEF contents using the writeNdefMessage()
method of the Ndef
class, but I was not able to write.
This is where I found the way to authenticate the tag.
This is my approach:
- Authenticate tag (using that piece of code)
- If response of authentication is equal to my pack, proceed to writing the NDEF message
However, I get a java.io.IOException
whenever I'm calling writeNdefMessage()
.