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

◆ NFC_NDEF_RECORD_BIN_DATA_DEF

#define NFC_NDEF_RECORD_BIN_DATA_DEF ( name,
tnf_arg,
id_arg,
id_len,
type_arg,
type_len,
payload_arg,
payload_len )

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

Value:
struct nfc_ndef_bin_payload_desc name##_nfc_ndef_bin_payload_desc = { \
.payload = payload_arg, .payload_length = payload_len}; \
\
struct nfc_ndef_record_desc name##_nfc_ndef_bin_record_desc = { \
.tnf = tnf_arg, \
.id_length = id_len, \
.id = id_arg, \
.type_length = type_len, \
.type = type_arg, \
.payload_descriptor = (void *)&name##_nfc_ndef_bin_payload_desc}
int(* payload_constructor_t)(void *payload_descriptor, uint8_t *buffer, uint32_t *len)
Payload constructor type.
Definition record.h:57
int nfc_ndef_bin_payload_memcopy(struct nfc_ndef_bin_payload_desc *payload_descriptor, uint8_t *buffer, uint32_t *len)
Construct the payload for an NFC NDEF record from binary data.
Binary data descriptor containing the payload for the record.
Definition record.h:126
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 record with binary payload.

This macro creates and initializes an instance of type nfc_ndef_record_desc and a binary data descriptor containing the payload data.

Use the macro NFC_NDEF_RECORD_BIN_DATA 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_argPointer to the payload data that will be copied to the payload field.
payload_lenLength of the payload.