I'm trying to read a NFC tag developed by NXP in my Android Application. It is possible to read the tag with Android: the App by NXP and one other read it correctly.
The exact Tag type is "ICODE SLI-L (SL2ICS50)" and the RF technology is "Type V / ISO 15693" (data taken from those working apps). The memory consists of 2 pages with 4 blocks each, the blocks have 4 bytes each – I just want to have whole data stored in the memory.
The tag has to be handled with Android's NfcV
class and the datasheet of the tag is available here, but it is hard to find any working code example using NfcV
. I tried several things which I concluded by the datasheet by myself and I tried the communication samples from this PDF I found with Google, but nothing works.
The corresponding method in my activity (I use NFC Foreground Dispatch) looks like this:
public void onNewIntent(Intent intent) {
android.nfc.Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
NfcV tech = NfcV.get(tag);
try {
tech.connect();
byte[] arrByt = new byte[9];
arrByt[0] = 0x02;
arrByt[1] = (byte) 0xB0;
arrByt[2] = 0x08;
arrByt[3] = 0x00;
arrByt[4] = 0x01;
arrByt[5] = 0x04;
arrByt[6] = 0x00;
arrByt[7] = 0x02;
arrByt[8] = 0x00;
byte[] data = tech.transceive(arrByt);
// Print data
tech.close();
} catch (IOException e) {
// Exception handling
}
}
The method is called correctly when I place my phone on the tag, but the transceive()
method of the NfcV
object always throws an IOException: android.nfc.TagLostException: Tag was lost.
. This is the result of all byte arrays I tried (the one above is unlikely correct but over the last days I tried a bunch of others which all resultet in the same behaviour.
From what I read on the Internet, I conclude that the error occurs because I send the wrong commands to the tag – but I just cannot come up with the right ones. Any ideas?