| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <cstdint> | ||
| 4 | #include <cstring> | ||
| 5 | |||
| 6 | typedef int32_t esp_err_t; | ||
| 7 | |||
| 8 | #define ESP_OK 0 | ||
| 9 | #define ESP_FAIL -1 | ||
| 10 | #define ESP_ERR_INVALID_ARG -2 | ||
| 11 | #define ESP_ERR_INVALID_STATE -3 | ||
| 12 | |||
| 13 | ✗ | inline const char* esp_err_to_name(esp_err_t error) { | |
| 14 | ✗ | switch (error) { | |
| 15 | ✗ | case ESP_OK: | |
| 16 | ✗ | return "ESP_OK"; | |
| 17 | ✗ | case ESP_FAIL: | |
| 18 | ✗ | return "ESP_FAIL"; | |
| 19 | ✗ | case ESP_ERR_INVALID_ARG: | |
| 20 | ✗ | return "ESP_ERR_INVALID_ARG"; | |
| 21 | ✗ | case ESP_ERR_INVALID_STATE: | |
| 22 | ✗ | return "ESP_ERR_INVALID_STATE"; | |
| 23 | ✗ | default: | |
| 24 | ✗ | return "UNKNOWN_ERROR"; | |
| 25 | } | ||
| 26 | } | ||
| 27 |