• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps nfcv.transceive fails with IOException

se_ti

Lurker
Hi.
I'm new in android programming and i'm trying to read ISO 15693 (NfcV) NFC tags with raw binary data.
Usually NfcV.transceive call fails with IOException "Transceive failed", but sometimes succeeds.

And I'm sure, i send correct commands: there are about 10% of successful and correct reads.
I'm sure, it's not a hardware problem: there is at least TagInfo by NXP, which reads my tags perfectly (while most other NFC reading programs fail just like my one).

My code is pretty straightforward:
Code:
protected class ReadTag extends AsyncTask<NfcV, Void, String> implements Runnable
 {
     protected String doInBackground(NfcV... nfcs)
    {
        NfcV nfcv = nfcs[0];
        byte[] result;
        nfcv.connect();
        result = nfcv.transceive(commandData);
        nfcv.close();

        // process result to human-readable string
    }
}

Debugger shows, that BasicTagTechnology.transceive initializes TransceiveResult with result = 1 and data = null;
which directly leads to the IOException "Transceive failed";

How can i figure out the reason of result = 1?
Could it be "A blocked call will be canceled with IOException if close() is called from another thread.", mentioned in http://developer.android.com/reference/android/nfc/tech/NfcV.html#transceive(byte[])? And how should i avoid such situations?
 
Back
Top Bottom