I check my tag using this code snippet
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 package. After authentication, I write the contents of NDEF using the writeNdefMessage()class method Ndef, but I could not write.
This is where I found a way to authenticate a tag.
This is my approach:
- Authentication tag (using this code snippet)
- If the authentication response is equal to my packet, go on to write the NDEF message
However, I get java.io.IOExceptionwhen I call writeNdefMessage().
source
share