nrfxlib API 2.8.99
|
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.
payload | Pointer to the memory area in RAM containing the payload to send. |
payload_length | Size of the payload in bytes. |
0 | Success. |
-NRF_EINVAL | Invalid payload_length . |
-NRF_EOPNOTSUPP | Payload has been already set. |