none
How to forward NCI message response to NfcCx in EvtNfcCxWriteNciPacket for NCI message handshaking? RRS feed

  • Question

  • Hi all,

    During NfcCx client driver development, I am blocking at the point with NCI message handshaking during the registered sequence.

    Here is the detail of what I have done(1 - 5) and blocking point(in Red):


    1. During NfcCxDeviceInitConfig method, 2 I/O callback functions are registered

      - EvtNfcCxWriteNciPacket

      - EvtNfcCxDeviceIoControl

    2. NfcCx is initialized success by NfcCxDeviceInitialize method.

    3. All the sequences provided by NfcCx are registered by NfcCxRegisterSequenceHandle method.

    4. The client driver register EvtDeviceD0Entry of WDF_PNPPOWER_EVENT_CALLBACKS.

        In the callback function EvtDeviceD0Entry, HostActionStart is triggered by NfcCxHardwareEvent method.

       The callback function is called after client driver device add routine is done.

    5. NfcCx initialization sequence is triggered after client driver intialized. Flow of the sequence in

    red rectangleworks fine(refer to flowchart below)

    The registered EvtNfcCxWriteNciPacket callback function is called,

    Inside this function, using WdfRequestRetrieveInputMemory and WdfMemoryCopyToBuffer, I can decode the data passed to client driver as NCI control message CORE_RESET_CMD (20000100).


    Now, my blocking point is how could I pass back the CORE_RESET_RSP to NfcCx to ensure all NCI commands and responses handshaking are complete shown in the sequence?

    I have looked through the NfcCx design guide, but no detail explanation on this part.



    It is appreciate that anyone can provide some guideline.

    Thanks.

    Wednesday, April 19, 2017 8:34 AM

All replies

  • Dear,

    Did you get help regarding your question?

    I'm not able to answer to the CORE_RESET_CMD. I tried( without success)

    - from EvtNfcCxWriteNciPacket callback function.

    - from a workitem.

    Best regards

    Sylvain

    Thursday, June 29, 2017 2:11 PM
  • Dear WangXin,

    I'm now able to answer to the CORE_RESET_CMD. You have to use the NfcCxNciReadNotification from your workitem or completion routine.

    From EvtNfcCxWriteNciPacket, I create a IO completion routine or a work-item. I set the Request to STATUS_PENDING.

    Then when my IO completion routine or work-item ended the exchange with my front-end, I call NfcCxNciReadNotification with appropriate NCI data.

    Best regards.

    Sylvain

    Friday, June 30, 2017 9:15 AM
  • Hi Sylvain,

    As with WangXin, I use the NFCCX framework to develop the NFC Client driver,

    Current state is via cordNfcCxWriteNciPacket callback to send CORE_RESET_CMD then receive CORE_RESET_RSP and use NfcCxNciReadNotification feedback from workitem.

    Two questions:

    1. Not as expected there will be another EvtNfcCxWriteNciPacket callback to send CORE_INIT_CMD

    2. In EvtDeviceD0Entry callback, HostActionStart is triggered by NfcCxHardwareEvent,

    Later return fails (0xc0000001).

    Thanks.Best regardshogtyan

    Thursday, September 28, 2017 2:20 AM