Hi,
In my application, I'm trying to restart emulation because I want to switch from the NDEF static payload mode to ISO-DEP mode. The problem is that when I stop emulation and call nfc_t4t_done(), I get an invalid state error when I'm trying to set a new callback for the NFC lib with nfc_t4t_setup(my_callback, NULL).
To be more verbose, I'm initially setting up the library like this:
nfc_t4t_setup(nfc_ndef_callback, NULL); nfc_t4t_ndef_staticpayload_set(ndef_encoded_payload, ndef_len); nfc_t4t_emulation_start();
Later on in the application, I have an interrupt which schedules the following:
nfc_t4t_done(); nfc_t4t_emulation_stop(); nfc_t4t_setup(nfc_isodep_callback, NULL); // This returns NRF_ERROR_INVALID_STATE nfc_t4t_emulation_start();
It seems like the NFC library does not register that the emulation has stopped.
This was built with nRF5SDK v17.0.2, GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025. The code ran on an nRF52840-DK.
Any suggestions would be appreciated if this is not a bug.
Best regards,
Tofik