nrfxlib API 2.7.99
Loading...
Searching...
No Matches

◆ nfc_t2t_payload_set()

int nfc_t2t_payload_set ( const uint8_t *  payload,
size_t  payload_length 
)

#include <nfc/include/nfc_t2t_lib.h>

Register the payload to send on reception of a READ request.

The payload is considered to only contain the NDEF message to deliver to a reader. The required NDEF TLV will be created implicitly by NFC T2T Library.

The pointer to the payload must stay valid for the duration of the library execution, or until it is explicitly released.

If the pointer is not NULL, but the length is zero, the payload is considered to be an empty NDEF message.

If a new payload is registered, the previously registered one is considered released.

Passing a NULL pointer releases the current payload without registering a new one.

If an invalid size is given (too big), the function returns with an error and the currently registered payload is left unchanged.

Note
Provided pointer must point to RAM region.
Parameters
payloadPointer to the memory area in RAM containing the payload to send.
payload_lengthSize of the payload in bytes.
Return values
0Success.
-NRF_EINVALInvalid payload_length.
-NRF_EOPNOTSUPPPayload has been already set.