Android NFC read ISO15693 RFID Tag

前端 未结 1 658
攒了一身酷
攒了一身酷 2020-12-31 14:21

I am trying to read an ISO15693 RFID tag with the nfc android library:

Here is more info on the Tag: http://img42.com/gw07d+

The Tag ID is read correctly but

相关标签:
1条回答
  • 2020-12-31 14:46

    So you receive a value of { 0x02 } from the transceive method. As found in this thread this may happen when you use unaddressed commands. Hence, you should always send addressed commands through NfcV (as this seems to be supported across all NFC chipsets on Android devices). In your case, you could use something like this to generate an addressed READ MULTIPLE BLOCKS command:

    int offset = 0;  // offset of first block to read
    int blocks = 1;  // number of blocks to read
    byte[] cmd = new byte[]{
            (byte)0x60,                  // flags: addressed (= UID field present)
            (byte)0x23,                  // command: READ MULTIPLE BLOCKS
            (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,  // placeholder for tag UID
            (byte)(offset & 0x0ff),      // first block number
            (byte)((blocks - 1) & 0x0ff) // number of blocks (-1 as 0x00 means one block)
    };
    System.arraycopy(id, 0, cmd, 2, 8);
    byte[] response = nfcvTag.transceive(cmd);
    
    0 讨论(0)
提交回复
热议问题