nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches

◆ nfc_ndef_uri_msg_encode()

int nfc_ndef_uri_msg_encode ( enum nfc_ndef_uri_rec_id uri_id_code,
uint8_t const *const uri_data,
uint16_t uri_data_len,
uint8_t * buf,
uint32_t * len )

#include <include/nfc/ndef/uri_msg.h>

Encode an NFC NDEF URI message.

This function encodes an NFC NDEF message into a buffer.

Parameters
uri_id_codeURI identifier code that defines the protocol field of the URI.
uri_dataPointer to the URI string. The string should not contain the protocol field if the protocol was specified in uri_id_code.
uri_data_lenLength of the URI string.
bufPointer to the buffer for the message.
lenSize of the available memory for the message as input. Size of the generated message as output.
Return values
0If the description was successfully created.
-EINVALIf the URI string was invalid (equal to NULL).
-ENOMEMIf the predicted message size is bigger than the provided buffer space.
OtherOther codes might be returned depending on the function nfc_ndef_msg_encode.