Write to NTAG216 after authentication?

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().

+4
source share
1 answer

, , , , . ( !), tag.connect()/tag.close() , , . , .

Ndef, , . NDEF ( NFC Forum Type 2 ) NDEF.

NTAG216 MifareUltralight, MifareUltralight.

  • :

    mfu.transceive(new byte[]{ (byte)0x1b, pwd[0], pwd[1], pwd[2], pwd[3] });
    
  • (, , 4 , NDEF, TLV 0x03, 3, - ):

    mfu.write(pageNumber, data)
    

    data - , pageNumber.

+1

Source: https://habr.com/ru/post/1620275/


All Articles