android.nfc.TagLostException:标记丢失

时间:2018-07-16 12:25:43

标签: android nfc smartcard apdu

我尝试通过Android NFC发送APDU命令:

        byte[] selCommand = ApduBuilder.INS(INS.SELECT).P1(NfcActivityA.FileRefControl.GET_BY_DF.code).data("A0000006581010").build();

        Log.d("APDU", "selCommand: "+ fromByteArray(selCommand));

        byte[] result = mNfc.transceive(selCommand);

但是我得到奇怪的行为:

方法之一-我尝试发送命令

-> log write selCommand: 123(for example) 
-> I get ecxeption `android.nfc.TagLostException: Tag was lost.`

方法二-我尝试发送命令(调试模式)

-> log write selCommand: 123(for example) 
-> I stop on `mNfc.transceive(selCommand);` line 
-> I select this line and pres Alt + F8 
-> Evaluate
-> get success response

enter image description here

enter image description here

为什么?

0 个答案:

没有答案