|
hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
|
Model interface to create record types and set/get record fields. More...
#include <stddef.h>#include <stdint.h>#include "infineon/ifx-error.h"#include "infineon/ifx-utils.h"Go to the source code of this file.
Data Structures | |
| struct | ifx_ndef_record_t |
| Data storage for NDEF Records. More... | |
| struct | ifx_record_handle_t |
| Defines the handle for specific record type. More... | |
| struct | ifx_record_init_t |
| This Structure holds record's type information and function pointer which retrieves record handle based on type. More... | |
Macros | |
| #define | IFX_RECORD_SET UINT8_C(0x01) |
| Identifier for model set data ID. | |
| #define | IFX_RECORD_GET UINT8_C(0x02) |
| Identifier for model get data ID. | |
| #define | IFX_RECORD_REGISTER UINT8_C(0x03) |
| Identifier for model register record ID. | |
| #define | IFX_RECORD_RETRIEVE UINT8_C(0x04) |
| Identifier for model retrieve record ID. | |
| #define | IFX_RECORD_DEREGISTER UINT8_C(0x05) |
| Identifier for model deregister record ID. | |
| #define | IFX_RECORD_DATA_FIELD_NA UINT8_C(0xF1) |
| Error id for unavailable data field in record handle. | |
| #define | IFX_RECORD_HEADER_MASK_SR_FLAG UINT8_C(0x10) |
| Mask value to extract SR bit in header. | |
| #define | IFX_RECORD_HEADER_MASK_ID_FLAG UINT8_C(0x08) |
| Mask value to extract ID bit in header. | |
| #define | IFX_RECORD_TNF_MASK UINT8_C(0x27) |
| Mask value of TNF field in header. | |
| #define | IFX_RECORD_TNF_TYPE_KNOWN UINT8_C(0x01) |
| TNF of known NDEF records such as URI, Text, Smart poster. | |
| #define | IFX_RECORD_TNF_TYPE_MEDIA UINT8_C(0x02) |
| TNF of Media NDEF record types. | |
| #define | IFX_RECORD_TNF_TYPE_EXT UINT8_C(0x04) |
| TNF of External NDEF record types. | |
Typedefs | |
| typedef ifx_status_t(* | ifx_record_encoder_t) (const void *record_details, uint8_t **payload, uint32_t *payload_length) |
| Function prototype declaration for specific record encode operation. | |
| typedef ifx_status_t(* | ifx_record_decoder_t) (const uint8_t *payload, uint32_t payload_length, void *record_details) |
| Function prototype declaration for specific record decode operation. | |
| typedef ifx_status_t(* | ifx_record_deinit_t) (void *record_data) |
| Function prototype declaration for specific record's data release memory operation. | |
| typedef ifx_status_t(* | ifx_record_init_handler_t) (ifx_record_handle_t *handle) |
| Function prototype declarations that map to creation of new record handle APIs. | |
Enumerations | |
| enum | ifx_ndef_record_type { IFX_RECORD_TYPE_URI , IFX_RECORD_TYPE_HANDOVER_SELECT , IFX_RECORD_TYPE_ALT_CARRIER , IFX_RECORD_TYPE_BT , IFX_RECORD_TYPE_BLE , IFX_RECORD_TYPE_ERROR , IFX_RECORD_MAX } |
| Defines list of available record types. More... | |
Functions | |
| ifx_status_t | ifx_ndef_record_set_record_id (ifx_record_handle_t *handle, const ifx_blob_t *record_id) |
| Sets the record ID to the handle of record. | |
| ifx_status_t | ifx_ndef_record_get_record_id (const ifx_record_handle_t *handle, ifx_blob_t *record_id) |
| Gets the record ID from the handle of record. | |
| ifx_status_t | ifx_ndef_record_retrieve_handle (uint8_t tnf, const uint8_t *type, uint32_t type_length, ifx_record_handle_t *handle) |
| Retrieves the record handle for the given type of record type information. | |
| ifx_status_t | ifx_ndef_record_register_handle (ifx_record_init_t *init_handler) |
| Register a new record service to the record init handler list based on the type data. | |
| ifx_status_t | ifx_ndef_record_release_resource (void) |
| This method will free-up the internally allocated memory for ndef registered records. | |
| ifx_status_t | ifx_ndef_record_dispose (ifx_record_handle_t *record_handle) |
| This method will free-up the internally allocated memory of a record. | |
| ifx_status_t | ifx_ndef_record_dispose_list (ifx_record_handle_t *record_handles, uint32_t number_of_records) |
| This method will free-up the internally allocated memory for the list of records. | |
Model interface to create record types and set/get record fields.
Definition in file ifx-ndef-record.h.
| #define IFX_RECORD_DATA_FIELD_NA UINT8_C(0xF1) |
Error id for unavailable data field in record handle.
Definition at line 51 of file ifx-ndef-record.h.
| #define IFX_RECORD_DEREGISTER UINT8_C(0x05) |
Identifier for model deregister record ID.
Definition at line 46 of file ifx-ndef-record.h.
| #define IFX_RECORD_GET UINT8_C(0x02) |
Identifier for model get data ID.
Definition at line 31 of file ifx-ndef-record.h.
| #define IFX_RECORD_HEADER_MASK_ID_FLAG UINT8_C(0x08) |
Mask value to extract ID bit in header.
Definition at line 61 of file ifx-ndef-record.h.
| #define IFX_RECORD_HEADER_MASK_SR_FLAG UINT8_C(0x10) |
Mask value to extract SR bit in header.
Definition at line 56 of file ifx-ndef-record.h.
| #define IFX_RECORD_REGISTER UINT8_C(0x03) |
Identifier for model register record ID.
Definition at line 36 of file ifx-ndef-record.h.
| #define IFX_RECORD_RETRIEVE UINT8_C(0x04) |
Identifier for model retrieve record ID.
Definition at line 41 of file ifx-ndef-record.h.
| #define IFX_RECORD_SET UINT8_C(0x01) |
Identifier for model set data ID.
Definition at line 26 of file ifx-ndef-record.h.
| #define IFX_RECORD_TNF_MASK UINT8_C(0x27) |
Mask value of TNF field in header.
Definition at line 66 of file ifx-ndef-record.h.
| #define IFX_RECORD_TNF_TYPE_EXT UINT8_C(0x04) |
TNF of External NDEF record types.
Definition at line 81 of file ifx-ndef-record.h.
| #define IFX_RECORD_TNF_TYPE_KNOWN UINT8_C(0x01) |
TNF of known NDEF records such as URI, Text, Smart poster.
Definition at line 71 of file ifx-ndef-record.h.
| #define IFX_RECORD_TNF_TYPE_MEDIA UINT8_C(0x02) |
TNF of Media NDEF record types.
Definition at line 76 of file ifx-ndef-record.h.
| typedef ifx_status_t(* ifx_record_decoder_t) (const uint8_t *payload, uint32_t payload_length, void *record_details) |
Function prototype declaration for specific record decode operation.
| [in] | payload | pointer to payload to be decoded |
| [in] | payload_length | pointer to payload length |
| [out] | record_details | pointer to details of respective record |
IFX_SUCCESS, if encode successful, error information in case of error. Definition at line 137 of file ifx-ndef-record.h.
| typedef ifx_status_t(* ifx_record_deinit_t) (void *record_data) |
Function prototype declaration for specific record's data release memory operation.
| [in] | record_data | Pointer to the record data field of the record handle. |
IFX_SUCCESS, if memory release successful, error information in case of error. Definition at line 149 of file ifx-ndef-record.h.
| typedef ifx_status_t(* ifx_record_encoder_t) (const void *record_details, uint8_t **payload, uint32_t *payload_length) |
Function prototype declaration for specific record encode operation.
| [in] | record_details | pointer to details of respective record |
| [out] | payload | pointer to encoded payload |
| [out] | payload_length | pointer to encoded payload length |
IFX_SUCCESS, if encode successful, error information in case of error. Definition at line 125 of file ifx-ndef-record.h.
| typedef ifx_status_t(* ifx_record_init_handler_t) (ifx_record_handle_t *handle) |
Function prototype declarations that map to creation of new record handle APIs.
Definition at line 174 of file ifx-ndef-record.h.
| enum ifx_ndef_record_type |
Defines list of available record types.
Definition at line 88 of file ifx-ndef-record.h.
| ifx_status_t ifx_ndef_record_dispose | ( | ifx_record_handle_t * | record_handle | ) |
This method will free-up the internally allocated memory of a record.
| [in] | record_handle | Pointer to the record handle. |
| IFX_SUCCESS | if releasing memory resources is done successfully |
| ifx_status_t ifx_ndef_record_dispose_list | ( | ifx_record_handle_t * | record_handles, |
| uint32_t | number_of_records ) |
This method will free-up the internally allocated memory for the list of records.
| [in] | record_handles | Pointer to the array of NDEF record handles. |
| [in] | number_of_records | Number of NDEF records |
| IFX_SUCCESS | if releasing memory resources is done successfully |
| ifx_status_t ifx_ndef_record_get_record_id | ( | const ifx_record_handle_t * | handle, |
| ifx_blob_t * | record_id ) |
Gets the record ID from the handle of record.
| [in] | handle | Pointer to the record handle. |
| [out] | record_id | Pointer to the record ID. |
| IFX_SUCCESS | If the record ID is read from the handle successfully |
| IFX_ILLEGAL_ARGUMENT | If invalid/NULL parameter is passed to function |
| IFX_OUT_OF_MEMORY | If memory allocation is invalid |
| ifx_status_t ifx_ndef_record_register_handle | ( | ifx_record_init_t * | init_handler | ) |
Register a new record service to the record init handler list based on the type data.
| [in] | init_handler | Handler that holds the type and handle retrieval APIs. |
| IFX_SUCCESS | If init handler is registered properly to the record init handler list ER_INFO_ALREADY_REGISTERED_RECORD if already same record type is registered |
| IFX_ILLEGAL_ARGUMENT | If invalid/NULL parameter is passed to function |
| IFX_OUT_OF_MEMORY | If memory allocation is invalid |
| ifx_status_t ifx_ndef_record_release_resource | ( | void | ) |
This method will free-up the internally allocated memory for ndef registered records.
| IFX_SUCCESS | if freeing up of memory is done successfully |
| ifx_status_t ifx_ndef_record_retrieve_handle | ( | uint8_t | tnf, |
| const uint8_t * | type, | ||
| uint32_t | type_length, | ||
| ifx_record_handle_t * | handle ) |
Retrieves the record handle for the given type of record type information.
| [in] | tnf | Type name format (TNF) value of the record. |
| [in] | type | Pointer to the record type data. |
| [in] | type_length | Record type data length |
| [out] | handle | Record handle that will be retrieved through the type information. |
| IFX_SUCCESS | If handler is retrieved properly |
| IFX_ILLEGAL_ARGUMENT | If invalid/NULL parameter is passed to function |
| IFX_OUT_OF_MEMORY | If memory allocation is invalid |
| ifx_status_t ifx_ndef_record_set_record_id | ( | ifx_record_handle_t * | handle, |
| const ifx_blob_t * | record_id ) |
Sets the record ID to the handle of record.
| [out] | handle | Pointer to the record handle. |
| [in] | record_id | Pointer to the record ID. |
| IFX_SUCCESS | If the record ID is set to the handle successfully |
| IFX_ILLEGAL_ARGUMENT | If invalid/NULL parameter is passed to function |
| IFX_OUT_OF_MEMORY | If memory allocation is invalid |