|
hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
|
This library offers utilities to create and decode C style ifx_status_t error codes.
In complex library chains it is often difficult to track exactly where errors come from. All Infineon host software libraries therefore encode their errors according to the following schema:
| Bits | Information |
|---|---|
31 | Error indicator set to 1 in case of error |
30-24 | Library identifier (e.g. 0x01 for hsw-apdu library) |
23-16 | Module identifier (e.g. 0x10 for apdu-response module) |
15-8 | Function identifier in module (e.g. 0x03 for ifx_apdu_response_decode in hsw-apdu library) |
7-0 | Function-specific error reason (e.g. 0xFE out of memory). Values between 0xF0 and 0xFF are reserved for reusable error codes defined here. |
A return value of 0x811003FE would therefore indicate:
31 is set -> error.30-24 are set to 0x01 -> hsw-apdu library23-16 are set to 0x10 -> apdu-response module15-8 are set to 0x03 -> ifx_apdu_response_decode function7-0 are set to 0xFE -> Out of memoryThis library offers a set of reusable error reasons similar to standard exceptions in other languages.
The following table gives an overview of these values and a quick description for each.
| Value | Name | Description |
|---|---|---|
0xFF | IFX_UNSPECIFIED_ERROR | Error without any further information |
0xFE | IFX_OUT_OF_MEMORY | Could not allocate memory |
0xFD | IFX_ILLEGAL_ARGUMENT | Illegal argument given to function call |
0xFC | IFX_TOO_LITTLE_DATA | Too little data available (e.g. in decoding functions) |
0xFB | IFX_INVALID_STATE | Program (currently) in invalid state |
0xFA | IFX_PROGRAMMING_ERROR | Error that should have already been caught by the programmer occurred |