Generation of NFC NDEF URI record descriptions. More...
Data Structures |
|
| struct | uri_payload_desc_t |
|
Type of description of the payload of a URI record.
More...
|
|
Macros |
|
| #define | NFC_NDEF_URI_RECORD_DESC_DEF (NAME,URI_ID_CODE,P_URI_DATA,URI_DATA_LEN) |
|
Macro for generating a description of a URI record.
More...
|
|
| #define | NFC_NDEF_URI_RECORD_DESC (NAME) NFC_NDEF_GENERIC_RECORD_DESC (NAME) |
|
Macro for accessing the NFC NDEF URI record descriptor instance that was created with
NFC_NDEF_URI_RECORD_DESC_DEF
.
|
|
Functions |
|
| ret_code_t | nfc_uri_payload_constructor ( uri_payload_desc_t *p_input, uint8_t *p_buff, uint32_t *p_len) |
|
Function for constructing the payload for a URI record.
More...
|
|
Variables |
|
| const uint8_t | ndef_uri_record_type |
External reference to the type field of the URI record, defined in the file
nfc_uri_rec.c
. It is used in the
NFC_NDEF_URI_RECORD_DESC_DEF
macro.
|
|
Detailed Description
Generation of NFC NDEF URI record descriptions.
Macro Definition Documentation
| #define NFC_NDEF_URI_RECORD_DESC_DEF | ( | NAME, | |
| URI_ID_CODE, | |||
| P_URI_DATA, | |||
| URI_DATA_LEN | |||
| ) |
Value:
uri_payload_desc_t
NAME##_ndef_uri_record_payload_desc = \
{ \
.
uri_id_code
= (URI_ID_CODE), \
.p_uri_data = (P_URI_DATA), \
.uri_data_len = (URI_DATA_LEN) \
};
\
NFC_NDEF_GENERIC_RECORD_DESC_DEF
( NAME, \
TNF_WELL_KNOWN
, \
NULL, \
0, \
&
ndef_uri_record_type
, \
sizeof
(
ndef_uri_record_type
), \
&NAME##_ndef_uri_record_payload_desc) \
Macro for generating a description of a URI record.
This macro initializes an instance of an NFC NDEF record description of a URI record.
- Note
- The record descriptor is declared as automatic variable, which implies that the NDEF message encoding (see nfc_uri_msg_encode ) must be done in the same variable scope.
- Parameters
-
[in] NAME Name for accessing record descriptor. [in] URI_ID_CODE URI identifier code that defines the protocol field of the URI. [in] P_URI_DATA Pointer to the URI string. The string should not contain the protocol field if the protocol was specified in uri_id_code.[in] URI_DATA_LEN Length of the URI string.
Enumeration Type Documentation
| enum nfc_uri_id_t |
URI identifier codes according to "URI Record Type Definition" (denotation "NFCForum-TS-RTD_URI_1.0" published on 2006-07-24) chapter 3.2.2.
Function Documentation
| ret_code_t nfc_uri_payload_constructor | ( | uri_payload_desc_t * | p_input , |
| uint8_t * | p_buff , | ||
| uint32_t * | p_len | ||
| ) |
Function for constructing the payload for a URI record.
This function encodes the payload according to the URI record definition. It implements an API compatible with p_payload_constructor_t .
- Parameters
-
[in] p_input Pointer to the description of the payload. [out] p_buff Pointer to payload destination. If NULL, function will calculate the expected size of the URI record payload. [in,out] p_len Size of available memory to write as input. Size of generated payload as output.
- Return values
-
NRF_SUCCESS If the payload was encoded successfully. NRF_ERROR_NO_MEM If the predicted payload size is bigger than the provided buffer space.