nRF Connect SDK API
3.4.99
Toggle main menu visibility
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
18
19
#include <zephyr/types.h>
20
#include <
nfc/ndef/record.h
>
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
31
enum
nfc_ndef_text_rec_utf
{
33
UTF_8
= 0,
35
UTF_16
= 1,
36
};
37
41
struct
nfc_ndef_text_rec_payload
{
43
enum
nfc_ndef_text_rec_utf
utf
;
45
uint8_t
const
*
lang_code
;
47
uint8_t
lang_code_len
;
49
uint8_t
const
*
data
;
51
uint32_t
data_len
;
52
};
53
66
int
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
74
extern
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
127
128
#endif
/* NFC_NDEF_TEXT_REC_H_ */
nfc_ndef_text_rec_type_field
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
nfc_ndef_text_rec_utf
Type of the Unicode Transformation Format.
Definition
text_rec.h:31
UTF_16
@ UTF_16
Definition
text_rec.h:35
UTF_8
@ UTF_8
Definition
text_rec.h:33
nfc_ndef_text_rec_payload_encode
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.
record.h
nfc_ndef_text_rec_payload::lang_code
uint8_t const * lang_code
Definition
text_rec.h:45
nfc_ndef_text_rec_payload::lang_code_len
uint8_t lang_code_len
Definition
text_rec.h:47
nfc_ndef_text_rec_payload::data_len
uint32_t data_len
Definition
text_rec.h:51
nfc_ndef_text_rec_payload::utf
enum nfc_ndef_text_rec_utf utf
Definition
text_rec.h:43
nfc_ndef_text_rec_payload::data
uint8_t const * data
Definition
text_rec.h:49
nfc_ndef_text_rec_payload
Text record payload descriptor.
Definition
text_rec.h:41
include
nfc
ndef
text_rec.h
Generated on
for nRF Connect SDK API by
1.17.0