nfc_write_ndef_message_to_tag()
Write an NDEF message to an NDEF target.
Synopsis:
#include <nfc/nfc.h>
NFC_API nfc_result_t nfc_write_ndef_message_to_tag(nfc_target_t *tag, const nfc_ndef_message_t *msg, bool append)
Arguments:
- tag
-
The tag handle found after a tag detection.
- msg
-
The NDEF message to write.
- append
-
false to overwrite any previous messages, true to append
Library:
libnfcDescription:
This function writes an NDEF message to the NDEF target returned from a successful write detection. Successive calls to this function can be used to append multiple messages.
Returns:
NFC_RESULT_SUCCESS, or one of the following:
- NFC_RESULT_INVALID_PARAMETER: A parameter is invalid.
- NFC_RESULT_SERVICE_CONNECTION_ERROR: The application is not connected to the NFC system.
- NFC_RESULT_LOCKED: The tag is locked.
- NFC_RESULT_TAG_NOT_SUPPORTED: The tag type is not supported.
- NFC_RESULT_NOT_ENOUGH_SPACE: The tag does not have enough space.
- NFC_RESULT_WRITE_FAILED: Writing the message to tag failed.
- NFC_RESULT_TIMEOUT: A time-out occurred.