nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches

◆ NFC_NDEF_GENERIC_RECORD_DESC_DEF

#define NFC_NDEF_GENERIC_RECORD_DESC_DEF ( name,
tnf_arg,
id_arg,
id_len,
type_arg,
type_len,
payload_constructor_arg,
payload_descriptor_arg )

#include <include/nfc/ndef/record.h>

Value:
struct nfc_ndef_record_desc name##_ndef_generic_record_desc = { \
.tnf = tnf_arg, \
.id_length = id_len, \
.id = id_arg, \
.type_length = type_len, \
.type = type_arg, \
.payload_constructor = (payload_constructor_t)payload_constructor_arg, \
.payload_descriptor = (void *)payload_descriptor_arg}
int(* payload_constructor_t)(void *payload_descriptor, uint8_t *buffer, uint32_t *len)
Payload constructor type.
Definition record.h:57
void * payload_descriptor
Definition record.h:105
NDEF record descriptor.
Definition record.h:89

Macro for creating and initializing an NFC NDEF record descriptor for a generic record.

This macro creates and initializes an instance of type nfc_ndef_record_desc.

Use the macro NFC_NDEF_GENERIC_RECORD_DESC to access the NDEF record descriptor instance.

Note
The record descriptor is declared as automatic variable, which implies that the NDEF record encoding must be done in the same variable scope.
Parameters
nameName of the created descriptor instance.
tnf_argType Name Format (TNF) value for the record.
id_argPointer to the ID string.
id_lenLength of the ID string.
type_argPointer to the type string.
type_lenLength of the type string.
payload_constructor_argPointer to the payload constructor function. The constructor must be of type payload_constructor_t.
payload_descriptor_argPointer to the data for the payload constructor.