Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

NDEF

NDEF

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)
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)
static nfc_err_t ndef_msg_encode (ndef_msg_t *pNdef)
static nfc_err_t ndef_msg_decode (ndef_msg_t *pNdef)
static ac_buffer_builder_t * ndef_msg_buffer_builder (ndef_msg_t *pNdef)

Generic NDEF Tag

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.

Typedef Documentation

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
typepMem buffer containing the tag's content

Definition at line 51 of file ndef.h.

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
typepMem buffer in which to store the generated content

Definition at line 45 of file ndef.h.


Function Documentation

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:
pNdefTagpointer 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
bufferunderlying buffer to use (it should be big enough so that any NDEF message you might need could be stored inside)
buffer_sizesize of the underlying buffer
pImplpointer to actual implementation

Definition at line 41 of file ndef.c.