| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
Text records
Predefined NDEF messages

Generation of NFC NDEF Text record descriptions. More...

## Data Structures
struct | nfc_text_rec_payload_desc_t
| Text record payload descriptor. More...

## Macros
#define | NFC_TEXT_REC_TYPE_LENGTH 1
| Size of the type field of the Text record, defined in the file `nfc_text_rec.c`. It is used in the NFC_NDEF_TEXT_RECORD_DESC_DEF macro.
#define | NFC_NDEF_TEXT_RECORD_DESC_DEF(NAME,UTF,P_LANG_CODE,LANG_CODE_LEN,P_DATA,DATA_LEN)
| Macro for creating and initializing an NFC NDEF record descriptor for a Text record. More...
#define | NFC_NDEF_TEXT_RECORD_DESC(NAME) NFC_NDEF_GENERIC_RECORD_DESC(NAME)
| Macro for accessing the NFC NDEF Text record descriptor instance that was created with NFC_NDEF_TEXT_RECORD_DESC_DEF.

## Enumerations
enum | nfc_text_rec_utf_type_t { UTF_8 = 0, UTF_16 = 1 }
| Type of the Unicode Transformation Format. More...

## Functions
ret_code_t | nfc_text_rec_payload_constructor (nfc_text_rec_payload_desc_t *p_nfc_rec_text_payload_desc, uint8_t *p_buff, uint32_t *p_len)
| Constructor for an NFC NDEF Text record payload. More...

## Variables
const uint8_t | nfc_text_rec_type_field []
| External reference to the type field of the Text record, defined in the file `nfc_text_rec.c`. It is used in the NFC_NDEF_TEXT_RECORD_DESC_DEF macro.

## Detailed Description

Generation of NFC NDEF Text record descriptions.

## Macro Definition Documentation

#define NFC_NDEF_TEXT_RECORD_DESC_DEF | ( |  | NAME,
|  |  | UTF,
|  |  | P_LANG_CODE,
|  |  | LANG_CODE_LEN,
|  |  | P_DATA,
|  |  | DATA_LEN
| ) |  |

Value:
static nfc_text_rec_payload_desc_t NAME##_nfc_text_rec_payload_desc; \
NAME##_nfc_text_rec_payload_desc = (nfc_text_rec_payload_desc_t) \
{ \
.utf = UTF, \
.p_lang_code = P_LANG_CODE, \
.lang_code_len = LANG_CODE_LEN, \
.p_data = P_DATA, \
.data_len = DATA_LEN, \
}; \
NFC_NDEF_GENERIC_RECORD_DESC_DEF(NAME, \
TNF_WELL_KNOWN, \
0, \
0, \
nfc_text_rec_type_field, \
NFC_TEXT_REC_TYPE_LENGTH, \
nfc_text_rec_payload_constructor, \
&(NAME##_nfc_text_rec_payload_desc))

Macro for creating and initializing an NFC NDEF record descriptor for a Text record.

This macro creates and initializes a static instance of type nfc_ndef_record_desc_t and a static instance of type nfc_text_rec_payload_desc_t, which together constitute an instance of a Text record.

Use the macro NFC_NDEF_TEXT_RECORD_DESC to access the NDEF Text record descriptor instance.

Parameters

  [in] | NAME | Name of the created record descriptor instance.
  [in] | UTF | Unicode Transformation Format.
  [in] | P_LANG_CODE | Pointer to the IANA language code.
  [in] | LANG_CODE_LEN | Length of the IANA language code.
  [in] | P_DATA | Pointer to the user text.
  [in] | DATA_LEN | Length of the user text.

## Enumeration Type Documentation

enum nfc_text_rec_utf_type_t

Type of the Unicode Transformation Format.

Values to specify the type of UTF for an NFC NDEF Text record.

Enumerator
UTF_8 | Unicode Transformation Format 8.
UTF_16 | Unicode Transformation Format 16.

## Function Documentation

ret_code_t nfc_text_rec_payload_constructor | ( | nfc_text_rec_payload_desc_t * | p_nfc_rec_text_payload_desc,
|  | uint8_t * | p_buff,
|  | uint32_t * | p_len
| ) |  |

Constructor for an NFC NDEF Text record payload.

Parameters

  [in] | p_nfc_rec_text_payload_desc | Pointer to the Text record description.
  [out] | p_buff | Pointer to the payload destination. If NULL, function will calculate the expected size of the Text record payload.
  [in,out] | p_len | Size of the available memory to write as input. Size of the generated record payload as output.