How to run into function tnep_svc_one_selected()?

As the title, in the project "ncs\v3.2.1\nrf\samples\nfc\tnep_tag", how to runt into  function tnep_svc_one_selected()?

I use the NFC tools, Send the hex data, want to select the servive, what hex data must be send? Is there a complete example or debugging method?

  • What I'm thinking now is if there is a simple way to implement TNEP interaction, allowing data transmission and reception to be as easy as using a serial port. Right now, I'm using the NFC TOOL mobile app for debugging. This app supports NFCA and ISODEP and does not allow manual command sending. When the code executes tnep_svc_one_selected(), there is no tnep_svc_two_selected() in the code because I only used one service. You don't need two sets of services for data transmission and reception, right? The demo program is meant to demonstrate service switching, correct? I just need to implement TNEP data transmission and reception.

  • Is there a bug in t4t? I send 00D600000411223344, program jump to case

    NFC_T4T_EVENT_NDEF_UPDATED,

    the lenth is 4386 ,the  hex 1122 ,dec is 4386. the lenth is not 4?

    the lenth in callback, is 4386

        err = nfc_t4t_setup(nfc_callback, NULL);
        if (err) {
            LOG_ERR("NFC T4T setup err: %d", err);
            return;
        }
    static void nfc_callback(void *context, nfc_t4t_event_t event,
                 const uint8_t *data, size_t data_length, uint32_t flags)

  • Hello,

    It could possibly be a bug. I believe this means "write to file, offset 0x0000, length 0x04, data 0x11223344", if I am not mistaken. But it is also dependent that you have already told the receiver what file it is up front. Did you?

    Regarding NFC Tools and this TNEP feature, I am not sure (ChatGPT says that it does not, and it is a fairly new protocol). The sample is tailored to work together with the sample tnep_poller, which can run on another DK, with an NFC Reader connected to it (usually an SPI/I2C device, such as "NFC Reader ST25R3911B Nucleo expansion board (X-NUCLEO-NFC05A1)")

    Best regards,

    Edvin

  • So, give me a solution. I just want to tap my phone on the NFC antenna, and then I can continuously exchange data, with the higher application layer working like a serial port.

  • I am sorry, but I don't know how to do that. You need to figure out whether the reason it is not working for the NFC Tools app is because it is a restriction in the OS, or if it is just a lacking feature in the NFC Tools application. If it is the last one, then you may need to write your own NFC application for the phone. I don't have any experience with phone app development, unfortunately. 

    If TNEP is not supported in the Android OS, then I am afraid you need to find another way of transporting the data, like BLE, USB or some other communication protocol. 

    I know it is probably not the answer you are hoping for, but it seems like this is not possible.

    Best regards,

    Edvin

Related