I'm new to NFC Android, and I have been stuck for several days trying to get the NTAG212 Mifare Ultralight authentication page . I already have PWD and PACK to do PWD_AUTH based on NTAG212 docs .
I am doing this approach ...
try{
nfc.connect();
byte[] cmd1 = nfc.transceive(new byte[]{ (byte) 0x30, (byte) 0x00 });
nfc.transceive(new byte[]{
(byte) 0x1B,
pass[0],
pass[1],
pass[2],
pass[3]
});
byte[] cmd4 = nfc.transceive(new byte[]{ (byte) 0x30, (byte) 0x04 });
}catch(TagLostException e){
e.printStackTrace();
}catch(IOException e){
e.printStachTrace();
}finally{
try{
nfc.close();
}catch(Exception e){
}
}
I always get an error android.nfc.TagLostException: Tag was lost.after sending the PWD_AUTH command to NFC. Can someone tell me what I am doing wrong? Is my approach right? Please, help.
NOTE. I read NTAG212 docs many times, searched google, stackoverflow and all possible resources.
TIA,
Kenster