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

◆ NFC_NDEF_NESTED_NDEF_MSG_RECORD_DEF

#define NFC_NDEF_NESTED_NDEF_MSG_RECORD_DEF ( name,
tnf_arg,
id_arg,
id_len,
type_arg,
type_len,
nested_message )

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

Value:
struct nfc_ndef_record_desc name##_ndef_record_nested_desc = \
{ \
.tnf = tnf_arg, \
.id_length = id_len, \
.id = id_arg, \
.type_length = type_len, \
.type = type_arg, \
.payload_constructor = \
.payload_descriptor = (void *) (nested_message) \
}
int nfc_ndef_msg_encode(struct nfc_ndef_msg_desc const *ndef_msg_desc, uint8_t *msg_buffer, uint32_t *msg_len)
Encode an NDEF message.
int(* payload_constructor_t)(void *payload_descriptor, uint8_t *buffer, uint32_t *len)
Payload constructor type.
Definition record.h:57
NDEF record descriptor.
Definition record.h:91

Macro for creating and initializing an NFC NDEF record descriptor with an encapsulated NDEF message. This macro creates and initializes an instance of type nfc_ndef_record_desc that contains an encapsulated NDEF message as payload. nfc_ndef_msg_encode is used as payload constructor to encode the message. The encoded message is then used as payload for the record.

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

Note
The message descriptor is declared as automatic variable, which implies that the NDEF message encoding must be done in the same variable scope.
Parameters
nameName of the created record 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.
nested_messagePointer to the message descriptor to encapsulate as the record's payload.