nRF Connect SDK API 0.1.0
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
20#include <zephyr/types.h>
21#include <nfc/ndef/record.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
34 UTF_8 = 0,
36 UTF_16 = 1,
37};
38
46 uint8_t const *lang_code;
50 uint8_t const *data;
52 uint32_t data_len;
53};
54
68 struct nfc_ndef_text_rec_payload *nfc_rec_text_payload_desc,
69 uint8_t *buff,
70 uint32_t *len);
71
77extern const uint8_t nfc_ndef_text_rec_type_field[];
78
84#define NFC_NDEF_TEXT_REC_TYPE_LENGTH 1
85
105#define NFC_NDEF_TEXT_RECORD_DESC_DEF(name, \
106 utf_arg, \
107 lang_code_arg, \
108 lang_code_len_arg, \
109 data_arg, \
110 data_len_arg) \
111 struct nfc_ndef_text_rec_payload name##_nfc_ndef_text_rec_payload = \
112 { \
113 .utf = utf_arg, \
114 .lang_code = lang_code_arg, \
115 .lang_code_len = lang_code_len_arg, \
116 .data = data_arg, \
117 .data_len = data_len_arg, \
118 }; \
119 NFC_NDEF_GENERIC_RECORD_DESC_DEF(name, \
120 TNF_WELL_KNOWN, \
121 0, \
122 0, \
123 nfc_ndef_text_rec_type_field, \
124 NFC_NDEF_TEXT_REC_TYPE_LENGTH, \
125 nfc_ndef_text_rec_payload_encode, \
126 &(name##_nfc_ndef_text_rec_payload))
127
132#define NFC_NDEF_TEXT_RECORD_DESC(name) NFC_NDEF_GENERIC_RECORD_DESC(name)
133
134#ifdef __cplusplus
135}
136#endif
137
140#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:32
@ UTF_16
Definition: text_rec.h:36
@ UTF_8
Definition: text_rec.h:34
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:46
uint8_t lang_code_len
Definition: text_rec.h:48
uint32_t data_len
Definition: text_rec.h:52
enum nfc_ndef_text_rec_utf utf
Definition: text_rec.h:44
uint8_t const * data
Definition: text_rec.h:50
Text record payload descriptor.
Definition: text_rec.h:42