This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NFC library problem. Undefined reference of nfc_t4t_setup.

Hello, I have been working with nfc libraries. In the below code you can see the my main function. In the Set up NFC part, nfc_t4t_setup(nfc_callback, NULL), nfc_t4t_ndef_rwpayload_set(m_ndef_msg_buf, sizeof(m_ndef_msg_buf)) and nfc_t4t_emulation_start() functions are not found in my libraries. These three functions are located in nfc_t4t_lib.h file which is included in my project. However, I do not have the nfc_t4t_lib.c file in my project. What is the problem in here? Should I include nfc_t4t_lib.c file, if yes where can I download it?


int main(void)
{
NRF_LOG_INFO("program starts");
ret_code_t err_code;

log_init();

NRF_LOG_INFO("Init started!");

/* Configure LED-pins as outputs */
bsp_board_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS);

/* Initialize App Scheduler. */
APP_SCHED_INIT(APP_SCHED_MAX_EVENT_SIZE, APP_SCHED_QUEUE_SIZE);

/* Initialize FDS. */
err_code = ndef_file_setup();
APP_ERROR_CHECK(err_code);

NRF_LOG_INFO("Scheduler over!");

/* Load NDEF message from the flash file. */
err_code = ndef_file_load(m_ndef_msg_buf, sizeof(m_ndef_msg_buf));
APP_ERROR_CHECK(err_code);

// Restore default NDEF message.
if (bsp_board_button_state_get(APP_DEFAULT_BTN))
{
uint32_t size = sizeof(m_ndef_msg_buf);
err_code = ndef_file_default_message(m_ndef_msg_buf, &size);
APP_ERROR_CHECK(err_code);
err_code = ndef_file_update(m_ndef_msg_buf, NDEF_FILE_SIZE);
APP_ERROR_CHECK(err_code);
NRF_LOG_DEBUG("Default NDEF message restored!");
}

/* Set up NFC */
err_code = nfc_t4t_setup(nfc_callback, NULL);
APP_ERROR_CHECK(err_code);

/* Run Read-Write mode for Type 4 Tag platform */
err_code = nfc_t4t_ndef_rwpayload_set(m_ndef_msg_buf, sizeof(m_ndef_msg_buf));
APP_ERROR_CHECK(err_code);

NRF_LOG_INFO("Writable NDEF message example started.");

/* Start sensing NFC field */
err_code = nfc_t4t_emulation_start();
APP_ERROR_CHECK(err_code);

while (1)
{
app_sched_execute();

NRF_LOG_FLUSH();
__WFE();
}
}

Parents Reply Children
No Data
Related