This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to use TRF7970 read/write a HCE Android phone?

Hi All,

HCE emulates a type 4A card.The different is need an AID to read a HCE service. Is there anyone know how to use trf7970 read/write HCE in Android phone? Is that possible?

Thank you in advance. Best regards,

Victor Chu

  • For Type A the historical byte content returned in the ATS response (from the RATS command issued) is specified inside ISO7816-4...(see sections 8.1.1 and 8.2.1) 

    NFC Forum uses Select by name, for example, with the application name being D2760000850101, so if the HbCE device is actually emulating an NFC T4AT platform, reading and writing it should be same as with static transponder, too.

    this means you should be able to use NFCLink to accomplish this reading and writing, for demo. If you need more in depth detail, please advise. 

     

  • Hi Josh,

    Thank you.

    I have NFCLINK tools on hands. It works well when reading type4A tag. However, when reading HCE phone (Nexus5), it is hardly to detect the HCE device. About one or two times of 20 trying, NFCLink tools can read the random UID of HCE device successfully, but cannot read the data in the HCE device.

    Could you tell how to use NFCLINK to demo reading and writing HCE device?

    Best regards,

  • Hi Victor,

    Can you provide some information about how you are setting up HCE in your Android application?  This must configure the application of the emulated card.  What is the application value?  NFCLink is designed to work with tags using the NDEF tag application which is 0xD2, 0x76, 0x00, 0x00, 0x85, 0x01, 0x01.  NFCLink will try to select only this application and if the HCE device has a different application configured, it should return an error code in the SW1, SW2 bytes.

    Could you also send the log from the NFCLink GUI on one of the failed reads?   

     

  • Hi Eddie,

    1) I set up HCE as following descrip, and my HCE device is Nexus 5 (4.4.2):
    hen a remote NFC device wants to talk to your service, it sends a so-called "SELECT AID" APDU as defined in the ISO/IEC 7816-4 specification. The AID is an application identifier defined in ISO/IEC 7816-4.
    The registration procedure for AIDs is defined in the ISO/IEC 7816-5 specification. If you don't want to register an AID, you are free to use AIDs in the proprietary range: bits 8-5 of the first byte must each be set to '1'. For example, "0xF00102030405" is a proprietary AID. If you do use proprietary AIDs, it is recommended to choose an AID of at least 6 bytes, to reduce the risk of collisions with other applications that might be using proprietary AIDs as well.

    2) I changed the AID to your required. But the perfomance seems as same as before. There is no log for failed. It looks like did not detect any HCE deveice around it. The following is the log for success:
    16:43:02:296     CNfcInstance::dispatchEvent: nfcEventTagDetected
    16:43:02:296     CNfcInstance::handleTagDetected: Enter
    16:43:02:296     CNfcPlayer::handleNfcTechnologyDiscovered: Enter
    16:43:02:296     Tag detected
    16:43:02:296     Tag's properties:
    16:43:02:296      Identifier: ISO 14443A
    16:43:02:296      Manufacturer: Unknown
    16:43:02:296      UID length: 4
    16:43:02:296      UID: 08:29:B1:0C
    16:43:02:296      ATQA: 0x0004
    16:43:02:296      SAK: 0x20
    16:43:02:296     CNfcInstance::connectTag: Enter
    16:43:02:296     CNfcInstance::connectTag: Exit (status: 0)
    16:43:02:296     CNfcPlayer::handleNfcTechnologyDiscovered: Exit
    16:43:02:296     CNfcInstance::handleTagDetected: Exit

    Thanks a lot.

    Best regards,