Mbed OS Reference
|
Error code layout. More...
Macros | |
#define | MBEDTLS_ERR_ERROR_GENERIC_ERROR -0x0001 |
Generic error. More... | |
#define | MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED -0x006E |
This is a bug in the library. More... | |
Functions | |
void | mbedtls_strerror (int errnum, char *buffer, size_t buflen) |
Translate a mbed TLS error code into a string representation, Result is truncated if necessary and always includes a terminating null byte. More... | |
const char * | mbedtls_high_level_strerr (int error_code) |
Translate the high-level part of an Mbed TLS error code into a string representation. More... | |
const char * | mbedtls_low_level_strerr (int error_code) |
Translate the low-level part of an Mbed TLS error code into a string representation. More... | |
Error code layout.
Currently we try to keep all error codes within the negative space of 16 bits signed integers to support all platforms (-0x0001 - -0x7FFF). In addition we'd like to give two layers of information on the error if possible.
For that purpose the error codes are segmented in the following manner:
16 bit error code bit-segmentation
For historical reasons, low-level error codes are divided in even and odd, even codes were assigned first, and -1 is reserved for other errors.
#define MBEDTLS_ERR_ERROR_GENERIC_ERROR -0x0001 |
Generic error.
Definition at line 125 of file connectivity/mbedtls/include/mbedtls/error.h.
#define MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED -0x006E |
This is a bug in the library.
Definition at line 126 of file connectivity/mbedtls/include/mbedtls/error.h.
void mbedtls_strerror | ( | int | errnum, |
char * | buffer, | ||
size_t | buflen | ||
) |
Translate a mbed TLS error code into a string representation, Result is truncated if necessary and always includes a terminating null byte.
errnum | error code |
buffer | buffer to place representation in |
buflen | length of the buffer |
const char * mbedtls_high_level_strerr | ( | int | error_code | ) |
Translate the high-level part of an Mbed TLS error code into a string representation.
This function returns a const pointer to an un-modifiable string. The caller must not try to modify the string. It is intended to be used mostly for logging purposes.
error_code | error code |
NULL
if the error code is unknown. const char * mbedtls_low_level_strerr | ( | int | error_code | ) |
Translate the low-level part of an Mbed TLS error code into a string representation.
This function returns a const pointer to an un-modifiable string. The caller must not try to modify the string. It is intended to be used mostly for logging purposes.
error_code | error code |
NULL
if the error code is unknown.