nfc_add_ndef_record()

Add a NDEF record to an NDEF message.

Synopsis:

#include <nfc/nfc_ndef.h>
 
NFC_API nfc_result_t nfc_add_ndef_record(nfc_ndef_message_t *msg, const nfc_ndef_record_t *rec)

Since:

BlackBerry 10.0.0

Arguments:

msg

The NDEF message to add the NDEF record to.

rec

The NDEF record to add.

Library:

libnfc (For the qcc command, use the -l nfc option to link against this library)

Description:

This function adds an NDEF record to an NDEF message. If this function does not return NFC_RESULT_SUCCESS, the ownership for the memory associated with rec remains with the application, and should be cleaned up via nfc_delete_ndef_record(). Otherwise, the memory associated with rec is subsequently owned by msg. In this case, if msg is deleted via nfc_delete_ndef_message() with its parameter delete_records set to false, rec should not be cleaned up manually by the application.

Returns:

NFC_RESULT_SUCCESS, or NFC_RESULT_INVALID_PARAMETER to indicate an invalid argument.