我是NFC的新手,几天来,我一直在试图将NTAG212 Mifare的第7页与身份验证连接起来,我已经拥有了PWD,并准备了基于NTAG212 Docs的PWD_AUTH。
我这么做..。
//assume password as array of bytes
//assume pack as array of bytes
try{
nfc.connect();
byte[] cmd1 = nfc.transceive(new byte[]{ (byte) 0x30, (byte) 0x00 }); //read the page 0 to make the NFC active
nfc.transceive(new byte[]{
(byte) 0x1B, //command for PWD_AUTH
pass[0],
pass[1],
pass[2],
pass[3]
});
byte[] cmd4 = nfc.transceive(new byte[]{ (byte) 0x30, (byte) 0x04 }); //read the page 4
}catch(TagLostException e){
e.printStackTrace();
}catch(IOException e){
e.printStachTrace();
}finally{
try{
nfc.close();
}catch(Exception e){
//display failed to close
}
}
在向NFC发送android.nfc.TagLostException: Tag was lost.
命令后,总是会收到PWD_AUTH错误。有人能告诉我我做错了什么吗?我的方法正确吗?请帮帮忙。
注意:我已经读了很多次NTAG212的文档,搜索过google,堆栈溢出和所有可能的资源。
蒂娅
肯斯特
发布于 2021-07-20 12:15:04
当在TagLostException
操作期间发送错误的密码时,一个将获得PWD_AUTH
。
确保在PWD_AUTH
操作中发送的4字节密码与使用常规WRITE
操作设置标记的PWD
字段的内容相匹配。
https://stackoverflow.com/questions/22719465
复制相似问题