![]() |
nRF Connect SDK API 3.3.99
|
| 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.
| uri_id_code | URI identifier code that defines the protocol field of the URI. |
| uri_data | Pointer to the URI string. The string should not contain the protocol field if the protocol was specified in uri_id_code. |
| uri_data_len | Length of the URI string. |
| buf | Pointer to the buffer for the message. |
| len | Size of the available memory for the message as input. Size of the generated message as output. |
| 0 | If the description was successfully created. |
| -EINVAL | If the URI string was invalid (equal to NULL). |
| -ENOMEM | If the predicted message size is bigger than the provided buffer space. |
| Other | Other codes might be returned depending on the function nfc_ndef_msg_encode. |