4

I got a problem with NFC-V tag reading. The tag type is Tag-it HF-I Plus (TMS37112). Here is the code I use to read data:

private void GetTagInfo(Tag tag){
        String[] techList = tag.GetTechList();
        for (int i = 0; i < techList.Length; i++) {
            if(techList[i].Contains("NfcV")){
                NfcV nfcv = NfcV.Get (tag);
                nfcv.Connect ();

                var response = nfcv.Transceive(new byte[] {
                    (byte)0x00,
                    (byte)0x23,
                    (byte)0x00,
                    (byte)0x01 });
            }
        }
    }

Writing in c# but not the purpose here (working on Xamarin).

Regardless of what I use as the first block number, I got an 0x00 before my data. Is this normal?

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
Leze
  • 739
  • 5
  • 24
  • After some search i see here [nfcapp](https://code.google.com/p/nfcutils/source/browse/org/android/nfc/tech/ReadNfcV.java?r=71e8373bc57e64a1fc961b7990fe00fcf138ba8d) On line 370 in readSingleBlock and on line 395 in readMultipleBlocks that he avoid reading the first byte. Is it normal? – Leze Oct 29 '15 at 17:22

1 Answers1

4

What you see is the flags byte. This byte is part of every NFC-V response frame and provides information about the command status. If this byte is 0x00 (or possibly 0x80), then the command was executed successfully and the remaining bytes contain the response parameters/data for your command (in your case one block starting at block zero requested by the READ MULTIPLE BLOCKS command).

If bit 0 of the flags byte is set, this indicates an execution error, the second byte will encode error information as defined in the ISO/IEC 15693-3 standard.

Thus a typical NFC-V command frame (when exchanged using NfcV.transceive()) looks like this:

+-------+--------------+--------------------------------+-------------------------+
| FLAGS | COMMAND CODE | [ADDRESS, if Addressed_flag=1] | COMMAND PARAMETERS/DATA |
+-------+--------------+--------------------------------+-------------------------+

and the response frame looks like this:

+-------+--------------------------+
| FLAGS | RESPONSE PARAMETERS/DATA |
+-------+--------------------------+
Michael Roland
  • 39,663
  • 10
  • 99
  • 206
  • Thanks a lot for your answer Michael. I looked for a while to get a Doc for the nfc-v protocol to check if this byte is normal, i still have not found it. So you answer is more than apreciate for me. And your illustration is more than explicit. – Leze Nov 09 '15 at 07:50