nRF Connect SDK API 3.3.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
37
45 uint8_t const *lang_code;
49 uint8_t const *data;
51 uint32_t data_len;
52};
53
66int nfc_ndef_text_rec_payload_encode(struct nfc_ndef_text_rec_payload *nfc_rec_text_payload_desc,
67 uint8_t *buff, uint32_t *len);
68
74extern const uint8_t nfc_ndef_text_rec_type_field[];
75
81#define NFC_NDEF_TEXT_REC_TYPE_LENGTH 1
82
102#define NFC_NDEF_TEXT_RECORD_DESC_DEF(name, utf_arg, lang_code_arg, lang_code_len_arg, data_arg, \
103 data_len_arg) \
104 struct nfc_ndef_text_rec_payload name##_nfc_ndef_text_rec_payload = { \
105 .utf = utf_arg, \
106 .lang_code = lang_code_arg, \
107 .lang_code_len = lang_code_len_arg, \
108 .data = data_arg, \
109 .data_len = data_len_arg, \
110 }; \
111 NFC_NDEF_GENERIC_RECORD_DESC_DEF(name, TNF_WELL_KNOWN, 0, 0, nfc_ndef_text_rec_type_field, \
112 NFC_NDEF_TEXT_REC_TYPE_LENGTH, \
113 nfc_ndef_text_rec_payload_encode, \
114 &(name##_nfc_ndef_text_rec_payload))
115
120#define NFC_NDEF_TEXT_RECORD_DESC(name) NFC_NDEF_GENERIC_RECORD_DESC(name)
121
122#ifdef __cplusplus
123}
124#endif
125
128#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