nRF Connect SDK API 2.7.99
Loading...
Searching...
No Matches
text_rec.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef NFC_NDEF_TEXT_REC_H_
8#define NFC_NDEF_TEXT_REC_H_
9
19#include <zephyr/types.h>
20#include <nfc/ndef/record.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
33 UTF_8 = 0,
35 UTF_16 = 1,
36};
37
45 uint8_t const *lang_code;
49 uint8_t const *data;
51 uint32_t data_len;
52};
53
67 struct nfc_ndef_text_rec_payload *nfc_rec_text_payload_desc,
68 uint8_t *buff,
69 uint32_t *len);
70
76extern const uint8_t nfc_ndef_text_rec_type_field[];
77
83#define NFC_NDEF_TEXT_REC_TYPE_LENGTH 1
84
104#define NFC_NDEF_TEXT_RECORD_DESC_DEF(name, \
105 utf_arg, \
106 lang_code_arg, \
107 lang_code_len_arg, \
108 data_arg, \
109 data_len_arg) \
110 struct nfc_ndef_text_rec_payload name##_nfc_ndef_text_rec_payload = \
111 { \
112 .utf = utf_arg, \
113 .lang_code = lang_code_arg, \
114 .lang_code_len = lang_code_len_arg, \
115 .data = data_arg, \
116 .data_len = data_len_arg, \
117 }; \
118 NFC_NDEF_GENERIC_RECORD_DESC_DEF(name, \
119 TNF_WELL_KNOWN, \
120 0, \
121 0, \
122 nfc_ndef_text_rec_type_field, \
123 NFC_NDEF_TEXT_REC_TYPE_LENGTH, \
124 nfc_ndef_text_rec_payload_encode, \
125 &(name##_nfc_ndef_text_rec_payload))
126
131#define NFC_NDEF_TEXT_RECORD_DESC(name) NFC_NDEF_GENERIC_RECORD_DESC(name)
132
133#ifdef __cplusplus
134}
135#endif
136
139#endif /* NFC_NDEF_TEXT_REC_H_ */
const uint8_t nfc_ndef_text_rec_type_field[]
External reference to the type field of the Text record, defined in the file text_rec....
nfc_ndef_text_rec_utf
Type of the Unicode Transformation Format.
Definition: text_rec.h:31
@ UTF_16
Definition: text_rec.h:35
@ UTF_8
Definition: text_rec.h:33
int nfc_ndef_text_rec_payload_encode(struct nfc_ndef_text_rec_payload *nfc_rec_text_payload_desc, uint8_t *buff, uint32_t *len)
Constructor for an NFC NDEF Text record payload.
uint8_t const * lang_code
Definition: text_rec.h:45
uint8_t lang_code_len
Definition: text_rec.h:47
uint32_t data_len
Definition: text_rec.h:51
enum nfc_ndef_text_rec_utf utf
Definition: text_rec.h:43
uint8_t const * data
Definition: text_rec.h:49
Text record payload descriptor.
Definition: text_rec.h:41