hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
Data Structures | Macros | Functions
ifx-apdu-error.h File Reference

APDU (response) error utility. More...

#include <stddef.h>
#include <stdint.h>
#include "infineon/ifx-error.h"
#include "infineon/ifx-apdu.h"

Go to the source code of this file.

Data Structures

struct  ifx_apdu_error_map_t
 Struct that holds APDU Error's message with respective to the INS and SW. More...
 

Macros

#define IFX_ERROR_GET_APDU   0x05u
 IFX error encoding function identifier for apdu_response_get_error_message().
 
#define IFX_ERRORS_NOT_REGISTERED   0x07u
 IFX register error message identifier if errors are not register.
 
#define IFX_ERROR_MSG_EMPTY_MAP_LIST    "Invalid error map list input. Cannot extract the error message."
 IFX error message error map list is empty or null.
 
#define IFX_ERROR_MSG_UNAVAILABLE   "Error description unavailable"
 IFX error message error map list is empty or null.
 
#define IFX_EMPTY_STRING   ""
 Defines empty string ("\n")
 

Functions

uint8_t * ifx_apdu_error_get_message (ifx_apdu_error_map_t *apdu_error_map_list, uint8_t apdu_error_map_list_length, const ifx_apdu_t *apdu, const ifx_apdu_response_t *response)
 Returns the error message with respect to the INS and SW.
 

Detailed Description

APDU (response) error utility.

Definition in file ifx-apdu-error.h.

Macro Definition Documentation

◆ IFX_EMPTY_STRING

#define IFX_EMPTY_STRING   ""

Defines empty string ("\n")

Definition at line 45 of file ifx-apdu-error.h.

◆ IFX_ERROR_GET_APDU

#define IFX_ERROR_GET_APDU   0x05u

IFX error encoding function identifier for apdu_response_get_error_message().

Definition at line 24 of file ifx-apdu-error.h.

◆ IFX_ERROR_MSG_EMPTY_MAP_LIST

#define IFX_ERROR_MSG_EMPTY_MAP_LIST    "Invalid error map list input. Cannot extract the error message."

IFX error message error map list is empty or null.

Definition at line 34 of file ifx-apdu-error.h.

34#define IFX_ERROR_MSG_EMPTY_MAP_LIST \
35 "Invalid error map list input. Cannot extract the error message."

◆ IFX_ERROR_MSG_UNAVAILABLE

#define IFX_ERROR_MSG_UNAVAILABLE   "Error description unavailable"

IFX error message error map list is empty or null.

Definition at line 40 of file ifx-apdu-error.h.

◆ IFX_ERRORS_NOT_REGISTERED

#define IFX_ERRORS_NOT_REGISTERED   0x07u

IFX register error message identifier if errors are not register.

Definition at line 29 of file ifx-apdu-error.h.

Function Documentation

◆ ifx_apdu_error_get_message()

uint8_t * ifx_apdu_error_get_message ( ifx_apdu_error_map_t * apdu_error_map_list,
uint8_t apdu_error_map_list_length,
const ifx_apdu_t * apdu,
const ifx_apdu_response_t * response )

Returns the error message with respect to the INS and SW.

Parameters
[in]apdu_error_map_listpointer to apdu error map
[in]apdu_error_map_list_lengthlength of the apdu error map list list
[in]apdupointer to APDU command for which the error message to be return.
[in]responsepointer to ifx_apdu_response_t for which the error message to be return.
Returns
uint8_t Error message with null terminated string. it will return empty string ("\n") if status word is 0x9000.