21#include <zephyr/types.h>
34#define NFC_NDEF_CH_REC_TYPE_LENGTH 2
91#define NFC_NDEF_CH_AC_CPS_MASK (NFC_AC_CPS_UNKNOWN)
167 uint8_t *buf, uint32_t *len);
190#define NFC_NDEF_CH_RECORD_DESC_DEF(_name, \
195 NFC_NDEF_MSG_DEF(_name, _max_records); \
196 struct nfc_ndef_ch_rec _name##_nfc_ch_rec = { \
197 .major_version = _major_version, \
198 .minor_version = _minor_version, \
199 .local_records = &NFC_NDEF_MSG(_name) \
201 NFC_NDEF_GENERIC_RECORD_DESC_DEF(_name, \
206 NFC_NDEF_CH_REC_TYPE_LENGTH, \
207 nfc_ndef_ch_rec_payload_encode, \
208 &(_name##_nfc_ch_rec))
230#define NFC_NDEF_CH_HS_RECORD_DESC_DEF(_name, \
234 NFC_NDEF_CH_RECORD_DESC_DEF(_name, \
235 nfc_ndef_ch_hs_rec_type_field, \
260#define NFC_NDEF_CH_HR_RECORD_DESC_DEF(_name, \
264 NFC_NDEF_CH_RECORD_DESC_DEF(_name, \
265 nfc_ndef_ch_hr_rec_type_field, \
290#define NFC_NDEF_CH_HM_RECORD_DESC_DEF(_name, \
294 NFC_NDEF_CH_RECORD_DESC_DEF(_name, \
295 nfc_ndef_ch_hm_rec_type_field, \
317#define NFC_NDEF_CH_HI_RECORD_DESC_DEF(_name, \
321 NFC_NDEF_CH_RECORD_DESC_DEF(_name, \
322 nfc_ndef_ch_hi_rec_type_field, \
331#define NFC_NDEF_CH_RECORD_DESC(_name) NFC_NDEF_GENERIC_RECORD_DESC(_name)
371 uint8_t *buf, uint32_t *len);
390#define NFC_NDEF_CH_HC_RECORD_DESC_DEF(_name, \
392 _payload_id_length, \
395 NFC_NDEF_GENERIC_RECORD_DESC_DEF(_name, \
398 _payload_id_length, \
399 nfc_ndef_ch_hc_rec_type_field, \
400 NFC_NDEF_CH_REC_TYPE_LENGTH, \
401 nfc_ndef_ch_hc_rec_payload_encode, \
408#define NFC_NDEF_CH_HC_RECORD_DESC(_name) NFC_NDEF_GENERIC_RECORD_DESC(_name)
425 uint8_t *buf, uint32_t *len);
446#define NFC_NDEF_CH_AC_RECORD_DESC_DEF(_name, \
448 _carr_data_ref_len, \
450 _max_aux_data_ref_cnt) \
451 struct nfc_ndef_ch_ac_rec_ref \
452 _name##nfc_ndef_ch_ac_rec_ref[_max_aux_data_ref_cnt]; \
453 struct nfc_ndef_ch_ac_rec \
454 _name##_nfc_ac_rec = { \
456 .carrier_data_ref = { _carr_data_ref_len, _carr_data_ref }, \
457 .max_aux_data_ref_cnt = _max_aux_data_ref_cnt, \
458 .aux_data_ref_cnt = 0, \
459 .aux_data_ref = _name##nfc_ndef_ch_ac_rec_ref \
461 NFC_NDEF_GENERIC_RECORD_DESC_DEF(_name, \
465 nfc_ndef_ch_ac_rec_type_field, \
466 NFC_NDEF_CH_REC_TYPE_LENGTH, \
467 nfc_ndef_ch_ac_rec_payload_encode, \
468 &(_name##_nfc_ac_rec))
474#define NFC_NDEF_CH_AC_RECORD_DESC(_name) NFC_NDEF_GENERIC_RECORD_DESC(_name)
499 const uint8_t *aux_data,
517 uint8_t *buf, uint32_t *len);
535#define NFC_NDEF_CH_CR_RECORD_DESC_DEF(_name, \
537 struct nfc_ndef_ch_cr_rec \
538 _name##_nfc_cr_rec = { \
539 .random = _random_number, \
541 NFC_NDEF_GENERIC_RECORD_DESC_DEF(_name, \
545 nfc_ndef_ch_cr_rec_type_field, \
546 NFC_NDEF_CH_REC_TYPE_LENGTH, \
547 nfc_ndef_ch_cr_rec_payload_encode, \
548 &(_name##_nfc_cr_rec))
554#define NFC_NDEF_CR_RECORD_DESC(_name) NFC_NDEF_GENERIC_RECORD_DESC(_name)
void nfc_ndef_ch_ac_rec_auxiliary_data_ref_clear(struct nfc_ndef_record_desc *ac_rec)
Function for clearing an Auxiliary Data Reference in an NFC NDEF Alternative Carrier record.
int nfc_ndef_ch_ac_rec_auxiliary_data_ref_add(struct nfc_ndef_record_desc *ac_rec, const uint8_t *aux_data, uint8_t aux_length)
Function for adding an Auxiliary Data Reference to an NFC NDEF Alternative Carrier record.
int nfc_ndef_ch_rec_payload_encode(const struct nfc_ndef_ch_rec *ch_rec, uint8_t *buf, uint32_t *len)
Constructor for an NFC Connection Handover generic record payload.
int nfc_ndef_ch_hc_rec_payload_encode(const struct nfc_ndef_ch_hc_rec *hc_rec, uint8_t *buf, uint32_t *len)
Constructor for an NFC Connection Handover Carrier Record payload.
int nfc_ndef_ch_ac_rec_payload_encode(const struct nfc_ndef_ch_ac_rec *nfc_rec_ac, uint8_t *buf, uint32_t *len)
Constructor for an NFC NDEF Alternative Carrier record payload.
nfc_ndef_ch_ac_rec_cps
Carrier Power State.
Definition ch.h:76
@ NFC_AC_CPS_ACTIVE
Definition ch.h:81
@ NFC_AC_CPS_ACTIVATING
Definition ch.h:84
@ NFC_AC_CPS_UNKNOWN
Definition ch.h:87
@ NFC_AC_CPS_INACTIVE
Definition ch.h:78
void nfc_ndef_ch_rec_local_record_clear(struct nfc_ndef_record_desc *ch_rec)
Function for clearing local records in the NFC NDEF Connection Handover records.
int nfc_ndef_ch_cr_rec_payload_encode(const struct nfc_ndef_ch_cr_rec *nfc_rec_cr, uint8_t *buf, uint32_t *len)
Constructor for an NFC NDEF Collision Resolution record payload.
int nfc_ndef_ch_rec_local_record_add(struct nfc_ndef_record_desc *ch_rec, const struct nfc_ndef_record_desc *local_rec)
Function for adding a local record to an NFC NDEF Handover Select record.
nfc_ndef_record_tnf
Type Name Format (TNF) Field Values.
Definition record.h:65
uint8_t length
Definition ch.h:98
const uint8_t * data
Definition ch.h:103
Carrier Data Reference and Auxiliary Data Reference descriptor.
Definition ch.h:96
struct nfc_ndef_ch_ac_rec_ref * aux_data_ref
Definition ch.h:123
uint8_t aux_data_ref_cnt
Definition ch.h:120
enum nfc_ndef_ch_ac_rec_cps cps
Definition ch.h:111
struct nfc_ndef_ch_ac_rec_ref carrier_data_ref
Definition ch.h:114
const uint8_t max_aux_data_ref_cnt
Definition ch.h:117
Alternative Carrier record payload descriptor.
Definition ch.h:109
uint16_t random
Definition ch.h:131
Collision Resolution record payload descriptor.
Definition ch.h:129
enum nfc_ndef_record_tnf ctf
Definition ch.h:47
struct nfc_ndef_ch_hc_rec::@218 carrier
uint8_t * data
Definition ch.h:67
uint8_t type_len
Definition ch.h:52
uint8_t data_len
Definition ch.h:61
const uint8_t * type
Definition ch.h:58
Handover Carrier record payload descriptor.
Definition ch.h:39
struct nfc_ndef_msg_desc * local_records
Definition ch.h:149
uint8_t major_version
Definition ch.h:141
uint8_t minor_version
Definition ch.h:146
Handover Select record payload descriptor.
Definition ch.h:137
NDEF message descriptor.
Definition msg.h:29
NDEF record descriptor.
Definition record.h:91