Hello,
i am working with SDK 14 type 4 tag library on NRF52832 hardware. I've based my code on the example "writable ndef msg".
When receiving a record, the NFC handler assumes, that NLEN is first updated to 0, and, after the write is complete, it is updated to the length of the write:
if (dataLength == 0)
{
m_update_state = true;
}
else if (m_update_state)
{
ret_code_t err_code;
m_update_state = false;
bsp_board_led_on(BSP_BOARD_LED_1);
// Update FLASH NDEF message file with new message.
err_code = ndef_file_update(m_ndef_msg_buf, dataLength + NLEN_FIELD_SIZE);
APP_ERROR_CHECK(err_code);
NRF_LOG_DEBUG("NDEF message updated!");
}
I've tested this using the Android NDEF library with Samsung J5, and it works as the example expects. When testing with Nokia 3, the NDEF library writes the NLEN only once, leaving out the 0 length update. The code is identical, comprising connecting the NDEF object, performing a writeNdefMessage, and closing the NDEF object. The 0 length update happens somewhere inside the NDEF layer.
What could be the cause for this? How did you come up with this sequence when creating the NDEF example?
What is your recommended solution for solving this issue? One option would be to accept both ways, i.e. check the contents right away if the length is not 0, but this seemed a little unstable when i ran multiple writes. If a solution, which can e.g. make the tag indentify differently, and consequently make the Nokia NDEF message write work like the one with Samsung, i would opt for it.
BR, tommi