Search code examples
nfc

NFC 4aTag ISO-DEP APDU and NDEF


using Android phone I need read NDEF message (URI) from a microcontroller based NFC device. I read several standards like ISO/IEC 7816-4:2005, NFC Data Exchange Format (NDEF) and others. For now i have the following data exchange (crc bytes omitted when tx):

RX: 00 a4 04 00 07 d2 76 00 00 85 01 01 00 35 c0 // android selects file1
TX: 90 00

RX: 00 a4 00 0c 02 e1 03 d2 af //android selects file2
TX: 90 00

RX: 00 b0 00 00 0f 8e a6 
TX: 00 01 02 03 04 05 06 07 08 09 //it is the dummy data

//here android restarts autocollision detection process

Maybe somebody can explain me the workflow of the commands. I dont know what file id means (file1= "d2 76 00 00 85 01 01" and file2= "e1 03")

I stopped at the first READ_BINARY command. i dont know what to send in response and where to read about this. I supposed that i need somehow insert the NDEF payload here. Also here another nfc topic i found that the response to the first BO should be so called "capability container" but i dont know what is it, and it is not said in the NDEF specification.


Solution

  • The NFC spec for Type 4 cards is a good read

    "d2 76 00 00 85 01 01" is the AID (Application ID) used for NDEF

    "e1 03" is the Capability Container File ID

    A summary of NDEF reading from a Type 4 card is:-

    1. Select the NDEF AID
    2. Select the Capability Container File ID
    3. Read 15 Bytes of the Capability Container File
    4. Select NDEF file ID
    5. Read NDEF file

    Capability Container File contains things like the File ID of the NDEF file, NDEF version number, NDEF read/write security, Maximum NDEF size,Maximum read sizes, etc.
    All defined in the link of the NDEF spec I gave.