hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
Macros | Functions
ifx-ndef-message.h File Reference

NDEF message encoding/decoding utility. More...

#include <stddef.h>
#include <stdint.h>
#include "infineon/ifx-utils.h"
#include "infineon/ifx-ndef-record.h"

Go to the source code of this file.

Macros

#define IFX_NDEF_MESSAGE_ENCODE   UINT8_C(0x01)
 Identifier for NDEF message encode ID.
 
#define IFX_NDEF_MESSAGE_DECODE   UINT8_C(0x02)
 Identifier for NDEF message decode ID.
 
#define IFX_NDEF_MESSAGE_EMPTY   UINT8_C(0xD0)
 Empty ndef record data.
 

Functions

ifx_status_t ifx_ndef_message_encode (const ifx_record_handle_t *record_handles, uint32_t number_of_records, ifx_blob_t *ndef_message)
 Encodes the array of the NDEF record handles into the NDEF message.
 
ifx_status_t ifx_ndef_message_decode (const ifx_blob_t *ndef_message, uint32_t *number_of_records, ifx_record_handle_t *record_handles)
 Decodes the NDEF message buffer to the NDEF records array.
 

Detailed Description

NDEF message encoding/decoding utility.

For more details refer to technical specification document NFC Data Exchange Format(NFCForum-TS-NDEF_1.0)

Definition in file ifx-ndef-message.h.

Macro Definition Documentation

◆ IFX_NDEF_MESSAGE_DECODE

#define IFX_NDEF_MESSAGE_DECODE   UINT8_C(0x02)

Identifier for NDEF message decode ID.

Definition at line 33 of file ifx-ndef-message.h.

◆ IFX_NDEF_MESSAGE_EMPTY

#define IFX_NDEF_MESSAGE_EMPTY   UINT8_C(0xD0)

Empty ndef record data.

Definition at line 38 of file ifx-ndef-message.h.

◆ IFX_NDEF_MESSAGE_ENCODE

#define IFX_NDEF_MESSAGE_ENCODE   UINT8_C(0x01)

Identifier for NDEF message encode ID.

Definition at line 28 of file ifx-ndef-message.h.

Function Documentation

◆ ifx_ndef_message_decode()

ifx_status_t ifx_ndef_message_decode ( const ifx_blob_t * ndef_message,
uint32_t * number_of_records,
ifx_record_handle_t * record_handles )

Decodes the NDEF message buffer to the NDEF records array.

Parameters
[in]ndef_messagePointer to the NDEF message
[out]number_of_recordsPointer to the total number of records.
[out]record_handlesPointer to the array of decoded NDEF record handles.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf decoding is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function

◆ ifx_ndef_message_encode()

ifx_status_t ifx_ndef_message_encode ( const ifx_record_handle_t * record_handles,
uint32_t number_of_records,
ifx_blob_t * ndef_message )

Encodes the array of the NDEF record handles into the NDEF message.

Parameters
[in]record_handlesPointer to the array of NDEF record handles.
[in]number_of_recordsNumber of NDEF records
[out]ndef_messagePointer to the object that stores the encoded NDEF message.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf encoding is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORYIf memory allocation is invalid