mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 20:21:04 +00:00
Make it easier to look up error messages
tools/gen_esp_err_to_name.py generates components/esp32/esp_err_to_name.c for lookup of the error codes from all of the IDF project and easily identify all codes in one place
This commit is contained in:
@@ -42,6 +42,39 @@ typedef int32_t esp_err_t;
|
||||
|
||||
#define ESP_ERR_WIFI_BASE 0x3000 /*!< Starting number of WiFi error codes */
|
||||
|
||||
/**
|
||||
* @brief Returns string for esp_err_t error codes
|
||||
*
|
||||
* This function finds the error code in a pre-generated lookup-table and
|
||||
* returns its string representation.
|
||||
*
|
||||
* The function is generated by the Python script
|
||||
* tools/gen_esp_err_to_name.py which should be run each time an esp_err_t
|
||||
* error is modified, created or removed from the IDF project.
|
||||
*
|
||||
* @param code esp_err_t error code
|
||||
* @return string error message
|
||||
*/
|
||||
const char *esp_err_to_name(esp_err_t code);
|
||||
|
||||
/**
|
||||
* @brief Returns string for esp_err_t and system error codes
|
||||
*
|
||||
* This function finds the error code in a pre-generated lookup-table of
|
||||
* esp_err_t errors and returns its string representation. If the error code
|
||||
* is not found then it is attempted to be found among system errors.
|
||||
*
|
||||
* The function is generated by the Python script
|
||||
* tools/gen_esp_err_to_name.py which should be run each time an esp_err_t
|
||||
* error is modified, created or removed from the IDF project.
|
||||
*
|
||||
* @param code esp_err_t error code
|
||||
* @param[out] buf buffer where the error message should be written
|
||||
* @param buflen Size of buffer buf. At most buflen bytes are written into the buf buffer (including the terminating null byte).
|
||||
* @return buf containing the string error message
|
||||
*/
|
||||
const char *esp_err_to_name_r(esp_err_t code, char *buf, size_t buflen);
|
||||
|
||||
void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression) __attribute__((noreturn));
|
||||
|
||||
#ifndef __ASSERT_FUNC
|
||||
|
Reference in New Issue
Block a user