|
hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
|
Infineon specific error code creation and parsing. More...
#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | IFX_MODULE(library_id, module_id) (uint16_t) (((library_id & 0x7F) << 8) | (module_id & 0xFF)) |
| Encoding of module id and library id into 2 bytes. Bit: 15 Set in macro IFX_ERROR to denote error identifier. Bits: 14-8 Library identifier code Bits: 7-0 Module identifier code. | |
| #define | IFX_SUCCESS ((ifx_status_t) 0x00000000) |
| Default status code for successful calls to any function. | |
| #define | IFX_ERROR_INDICATOR ((ifx_status_t) 0x80000000u) |
| Error indicator bitmask. | |
| #define | IFX_UNSPECIFIED_ERROR ((uint8_t) 0xffu) |
| Function independent error reason for unspecified errors. | |
| #define | IFX_OUT_OF_MEMORY ((uint8_t) 0xfeu) |
| Function independent error reason for out of memory errors. | |
| #define | IFX_ILLEGAL_ARGUMENT ((uint8_t) 0xfdu) |
| Function independent error reason for illegal argument value. | |
| #define | IFX_TOO_LITTLE_DATA ((uint8_t) 0xfcu) |
| Function independent error reason if too little data available. | |
| #define | IFX_INVALID_STATE ((uint8_t) 0xfbu) |
| Function independent error reason if any object is in an invalid state. | |
| #define | IFX_PROGRAMMING_ERROR ((uint8_t) 0xfau) |
| Function independent error reason for errors that should not occur because they should be prevented by the code. | |
| #define | IFX_ERROR(module, function, reason) |
| Creates IFX encoded error code for given module, function and reason. | |
Typedefs | |
| typedef uint32_t | ifx_status_t |
| Custom return code type used by all Infineon host software libraries. | |
Functions | |
| bool | ifx_error_check (ifx_status_t status_code) |
| Checks if status code indicates error. | |
| uint8_t | ifx_error_get_library (ifx_status_t error_code) |
| Extracts library identifier from error code. | |
| uint8_t | ifx_error_get_module (ifx_status_t error_code) |
| Extracts module identifier from error code. | |
| uint8_t | ifx_error_get_function (ifx_status_t error_code) |
| Extracts function identifier from error code. | |
| uint8_t | ifx_error_get_reason (ifx_status_t error_code) |
| Extracts function specific reason from error code. | |
Infineon specific error code creation and parsing.
Definition in file ifx-error.h.
| #define IFX_ERROR | ( | module, | |
| function, | |||
| reason ) |
Creates IFX encoded error code for given module, function and reason.
IFX error codes have the following schema:
| [in] | module | Library and module identifier. |
| [in] | function | Function identifier. |
| [in] | reason | Function specific reason. |
Definition at line 83 of file ifx-error.h.
| #define IFX_ERROR_INDICATOR ((ifx_status_t) 0x80000000u) |
Error indicator bitmask.
Definition at line 34 of file ifx-error.h.
| #define IFX_ILLEGAL_ARGUMENT ((uint8_t) 0xfdu) |
Function independent error reason for illegal argument value.
Definition at line 49 of file ifx-error.h.
| #define IFX_INVALID_STATE ((uint8_t) 0xfbu) |
Function independent error reason if any object is in an invalid state.
Definition at line 60 of file ifx-error.h.
| #define IFX_MODULE | ( | library_id, | |
| module_id ) (uint16_t) (((library_id & 0x7F) << 8) | (module_id & 0xFF)) |
Encoding of module id and library id into 2 bytes. Bit: 15 Set in macro IFX_ERROR to denote error identifier. Bits: 14-8 Library identifier code Bits: 7-0 Module identifier code.
Definition at line 23 of file ifx-error.h.
| #define IFX_OUT_OF_MEMORY ((uint8_t) 0xfeu) |
Function independent error reason for out of memory errors.
Definition at line 44 of file ifx-error.h.
| #define IFX_PROGRAMMING_ERROR ((uint8_t) 0xfau) |
Function independent error reason for errors that should not occur because they should be prevented by the code.
Definition at line 66 of file ifx-error.h.
| #define IFX_SUCCESS ((ifx_status_t) 0x00000000) |
Default status code for successful calls to any function.
Definition at line 29 of file ifx-error.h.
| #define IFX_TOO_LITTLE_DATA ((uint8_t) 0xfcu) |
Function independent error reason if too little data available.
Definition at line 54 of file ifx-error.h.
| #define IFX_UNSPECIFIED_ERROR ((uint8_t) 0xffu) |
Function independent error reason for unspecified errors.
Definition at line 39 of file ifx-error.h.
| typedef uint32_t ifx_status_t |
Custom return code type used by all Infineon host software libraries.
Definition at line 91 of file ifx-error.h.
| bool ifx_error_check | ( | ifx_status_t | status_code | ) |
Checks if status code indicates error.
| [in] | status_code | Status code to be checked. |
true if status_code indicates error. | uint8_t ifx_error_get_function | ( | ifx_status_t | error_code | ) |
Extracts function identifier from error code.
No checks for error indicator are performed, so ifx_error_check() must have been called beforehand.
| [in] | error_code | Error code to extract function identifier from. |
| uint8_t ifx_error_get_library | ( | ifx_status_t | error_code | ) |
Extracts library identifier from error code.
No checks for error indicator are performed, so ifx_error_check() must have been called beforehand.
| [in] | error_code | Error code to extract module identifier from. |
| uint8_t ifx_error_get_module | ( | ifx_status_t | error_code | ) |
Extracts module identifier from error code.
No checks for error indicator are performed, so ifx_error_check() must have been called beforehand.
| [in] | error_code | Error code to extract module identifier from. |
| uint8_t ifx_error_get_reason | ( | ifx_status_t | error_code | ) |
Extracts function specific reason from error code.
No checks for error indicator are performed, so ifx_error_check() must have been called beforehand.
| [in] | error_code | Error code to extract function specific reason from. |