Mbed OS Reference
Loading...
Searching...
No Matches

Data Structures

struct  __ndef_msg
 

Generic NDEF Tag

typedef struct __ndef_msg ndef_msg_t
 
typedef nfc_err_t(* ndef_encode_fn_t) (ndef_msg_t *pTag, ac_buffer_builder_t *pBufferBldr, void *pUserData)
 Function called to generate the tag's content on read (target mode) More...
 
typedef nfc_err_t(* ndef_decode_fn_t) (ndef_msg_t *pTag, ac_buffer_t *pBuffer, void *pUserData)
 Function called to decode the tag's content on write (target mode) or read (reader mode) More...
 
void ndef_msg_init (ndef_msg_t *pNdef, ndef_encode_fn_t encode, ndef_decode_fn_t decode, uint8_t *data, size_t size, void *pUserData)
 Initialize NDEF tag abstraction. More...
 

Detailed Description

Typedef Documentation

◆ ndef_encode_fn_t

typedef nfc_err_t(* ndef_encode_fn_t) (ndef_msg_t *pTag, ac_buffer_builder_t *pBufferBldr, void *pUserData)

Function called to generate the tag's content on read (target mode)

Parameters
pTagpointer to ndef_tag_t instance
pBufferBldrbuffer in which to store the generated content
pUserDataUser data pointer passed to ndef_msg_init

Definition at line 47 of file ndef.h.

◆ ndef_decode_fn_t

typedef nfc_err_t(* ndef_decode_fn_t) (ndef_msg_t *pTag, ac_buffer_t *pBuffer, void *pUserData)

Function called to decode the tag's content on write (target mode) or read (reader mode)

Parameters
pTagpointer to ndef_tag_t instance
pBufferbuffer containing the tag's content
pUserDataUser data pointer passed to ndef_msg_init

Definition at line 54 of file ndef.h.

Function Documentation

◆ ndef_msg_init()

void ndef_msg_init ( ndef_msg_t pNdef,
ndef_encode_fn_t  encode,
ndef_decode_fn_t  decode,
uint8_t *  data,
size_t  size,
void *  pUserData 
)

Initialize NDEF tag abstraction.

Parameters
pNdefpointer to ndef_tag_t structure to initialize
encodefunction that will be called to generate the NDEF message before sending it to the other party
decodefunction that will be called to parse the NDEF message after receiving it from the other party
dataunderlying buffer to use (it should be big enough so that any NDEF message you might need could be stored inside)
sizesize of the underlying buffer
pUserDataUser data pointer to pass to callbacks.