]> granicus.if.org Git - esp-idf/blob - components/esp32/esp_err_to_name.c
aee804b05327b987970a5351bf30819d216319b7
[esp-idf] / components / esp32 / esp_err_to_name.c
1 //Do not edit this file because it is autogenerated by gen_esp_err_to_name.py
2
3 #include <string.h>
4 #if __has_include("soc/soc.h")
5 #include "soc/soc.h"
6 #endif
7 #if __has_include("apps/ping/esp_ping.h")
8 #include "apps/ping/esp_ping.h"
9 #endif
10 #if __has_include("esp32/ulp.h")
11 #include "esp32/ulp.h"
12 #endif
13 #if __has_include("esp_err.h")
14 #include "esp_err.h"
15 #endif
16 #if __has_include("esp_http_client.h")
17 #include "esp_http_client.h"
18 #endif
19 #if __has_include("esp_image_format.h")
20 #include "esp_image_format.h"
21 #endif
22 #if __has_include("esp_mesh.h")
23 #include "esp_mesh.h"
24 #endif
25 #if __has_include("esp_now.h")
26 #include "esp_now.h"
27 #endif
28 #if __has_include("esp_ota_ops.h")
29 #include "esp_ota_ops.h"
30 #endif
31 #if __has_include("esp_spi_flash.h")
32 #include "esp_spi_flash.h"
33 #endif
34 #if __has_include("esp_wifi.h")
35 #include "esp_wifi.h"
36 #endif
37 #if __has_include("esp_wps.h")
38 #include "esp_wps.h"
39 #endif
40 #if __has_include("http_server.h")
41 #include "http_server.h"
42 #endif
43 #if __has_include("nvs.h")
44 #include "nvs.h"
45 #endif
46 #if __has_include("tcpip_adapter.h")
47 #include "tcpip_adapter.h"
48 #endif
49
50 #ifdef CONFIG_ESP_ERR_TO_NAME_LOOKUP
51 #define ERR_TBL_IT(err)    {err, #err}
52
53 typedef struct {
54     esp_err_t code;
55     const char *msg;
56 } esp_err_msg_t;
57
58 static const esp_err_msg_t esp_err_msg_table[] = {
59     // components/esp32/include/esp_err.h
60 #   ifdef      ESP_FAIL
61     ERR_TBL_IT(ESP_FAIL),                                   /*    -1 Generic esp_err_t code indicating failure */
62 #   endif
63 #   ifdef      ESP_OK
64     ERR_TBL_IT(ESP_OK),                                     /*     0 esp_err_t value indicating success (no error) */
65 #   endif
66 #   ifdef      ESP_ERR_NO_MEM
67     ERR_TBL_IT(ESP_ERR_NO_MEM),                             /*   257 0x101 Out of memory */
68 #   endif
69 #   ifdef      ESP_ERR_INVALID_ARG
70     ERR_TBL_IT(ESP_ERR_INVALID_ARG),                        /*   258 0x102 Invalid argument */
71 #   endif
72 #   ifdef      ESP_ERR_INVALID_STATE
73     ERR_TBL_IT(ESP_ERR_INVALID_STATE),                      /*   259 0x103 Invalid state */
74 #   endif
75 #   ifdef      ESP_ERR_INVALID_SIZE
76     ERR_TBL_IT(ESP_ERR_INVALID_SIZE),                       /*   260 0x104 Invalid size */
77 #   endif
78 #   ifdef      ESP_ERR_NOT_FOUND
79     ERR_TBL_IT(ESP_ERR_NOT_FOUND),                          /*   261 0x105 Requested resource not found */
80 #   endif
81 #   ifdef      ESP_ERR_NOT_SUPPORTED
82     ERR_TBL_IT(ESP_ERR_NOT_SUPPORTED),                      /*   262 0x106 Operation or feature not supported */
83 #   endif
84 #   ifdef      ESP_ERR_TIMEOUT
85     ERR_TBL_IT(ESP_ERR_TIMEOUT),                            /*   263 0x107 Operation timed out */
86 #   endif
87 #   ifdef      ESP_ERR_INVALID_RESPONSE
88     ERR_TBL_IT(ESP_ERR_INVALID_RESPONSE),                   /*   264 0x108 Received response was invalid */
89 #   endif
90 #   ifdef      ESP_ERR_INVALID_CRC
91     ERR_TBL_IT(ESP_ERR_INVALID_CRC),                        /*   265 0x109 CRC or checksum was invalid */
92 #   endif
93 #   ifdef      ESP_ERR_INVALID_VERSION
94     ERR_TBL_IT(ESP_ERR_INVALID_VERSION),                    /*   266 0x10a Version was invalid */
95 #   endif
96 #   ifdef      ESP_ERR_INVALID_MAC
97     ERR_TBL_IT(ESP_ERR_INVALID_MAC),                        /*   267 0x10b MAC address was invalid */
98 #   endif
99     // components/nvs_flash/include/nvs.h
100 #   ifdef      ESP_ERR_NVS_BASE
101     ERR_TBL_IT(ESP_ERR_NVS_BASE),                           /*  4352 0x1100 Starting number of error codes */
102 #   endif
103 #   ifdef      ESP_ERR_NVS_NOT_INITIALIZED
104     ERR_TBL_IT(ESP_ERR_NVS_NOT_INITIALIZED),                /*  4353 0x1101 The storage driver is not initialized */
105 #   endif
106 #   ifdef      ESP_ERR_NVS_NOT_FOUND
107     ERR_TBL_IT(ESP_ERR_NVS_NOT_FOUND),                      /*  4354 0x1102 Id namespace doesn’t exist yet and mode is
108                                                                             NVS_READONLY */
109 #   endif
110 #   ifdef      ESP_ERR_NVS_TYPE_MISMATCH
111     ERR_TBL_IT(ESP_ERR_NVS_TYPE_MISMATCH),                  /*  4355 0x1103 The type of set or get operation doesn't
112                                                                             match the type of value stored in NVS */
113 #   endif
114 #   ifdef      ESP_ERR_NVS_READ_ONLY
115     ERR_TBL_IT(ESP_ERR_NVS_READ_ONLY),                      /*  4356 0x1104 Storage handle was opened as read only */
116 #   endif
117 #   ifdef      ESP_ERR_NVS_NOT_ENOUGH_SPACE
118     ERR_TBL_IT(ESP_ERR_NVS_NOT_ENOUGH_SPACE),               /*  4357 0x1105 There is not enough space in the underlying
119                                                                             storage to save the value */
120 #   endif
121 #   ifdef      ESP_ERR_NVS_INVALID_NAME
122     ERR_TBL_IT(ESP_ERR_NVS_INVALID_NAME),                   /*  4358 0x1106 Namespace name doesn’t satisfy constraints */
123 #   endif
124 #   ifdef      ESP_ERR_NVS_INVALID_HANDLE
125     ERR_TBL_IT(ESP_ERR_NVS_INVALID_HANDLE),                 /*  4359 0x1107 Handle has been closed or is NULL */
126 #   endif
127 #   ifdef      ESP_ERR_NVS_REMOVE_FAILED
128     ERR_TBL_IT(ESP_ERR_NVS_REMOVE_FAILED),                  /*  4360 0x1108 The value wasn’t updated because flash write
129                                                                             operation has failed. The value was written
130                                                                             however, and update will be finished after
131                                                                             re-initialization of nvs, provided that
132                                                                             flash operation doesn’t fail again. */
133 #   endif
134 #   ifdef      ESP_ERR_NVS_KEY_TOO_LONG
135     ERR_TBL_IT(ESP_ERR_NVS_KEY_TOO_LONG),                   /*  4361 0x1109 Key name is too long */
136 #   endif
137 #   ifdef      ESP_ERR_NVS_PAGE_FULL
138     ERR_TBL_IT(ESP_ERR_NVS_PAGE_FULL),                      /*  4362 0x110a Internal error; never returned by nvs API
139                                                                             functions */
140 #   endif
141 #   ifdef      ESP_ERR_NVS_INVALID_STATE
142     ERR_TBL_IT(ESP_ERR_NVS_INVALID_STATE),                  /*  4363 0x110b NVS is in an inconsistent state due to a
143                                                                             previous error. Call nvs_flash_init and
144                                                                             nvs_open again, then retry. */
145 #   endif
146 #   ifdef      ESP_ERR_NVS_INVALID_LENGTH
147     ERR_TBL_IT(ESP_ERR_NVS_INVALID_LENGTH),                 /*  4364 0x110c String or blob length is not sufficient to
148                                                                             store data */
149 #   endif
150 #   ifdef      ESP_ERR_NVS_NO_FREE_PAGES
151     ERR_TBL_IT(ESP_ERR_NVS_NO_FREE_PAGES),                  /*  4365 0x110d NVS partition doesn't contain any empty
152                                                                             pages. This may happen if NVS partition was
153                                                                             truncated. Erase the whole partition and
154                                                                             call nvs_flash_init again. */
155 #   endif
156 #   ifdef      ESP_ERR_NVS_VALUE_TOO_LONG
157     ERR_TBL_IT(ESP_ERR_NVS_VALUE_TOO_LONG),                 /*  4366 0x110e String or blob length is longer than
158                                                                             supported by the implementation */
159 #   endif
160 #   ifdef      ESP_ERR_NVS_PART_NOT_FOUND
161     ERR_TBL_IT(ESP_ERR_NVS_PART_NOT_FOUND),                 /*  4367 0x110f Partition with specified name is not found
162                                                                             in the partition table */
163 #   endif
164 #   ifdef      ESP_ERR_NVS_NEW_VERSION_FOUND
165     ERR_TBL_IT(ESP_ERR_NVS_NEW_VERSION_FOUND),              /*  4368 0x1110 NVS partition contains data in new format
166                                                                             and cannot be recognized by this version of
167                                                                             code */
168 #   endif
169     // components/ulp/include/esp32/ulp.h
170 #   ifdef      ESP_ERR_ULP_BASE
171     ERR_TBL_IT(ESP_ERR_ULP_BASE),                           /*  4608 0x1200 Offset for ULP-related error codes */
172 #   endif
173 #   ifdef      ESP_ERR_ULP_SIZE_TOO_BIG
174     ERR_TBL_IT(ESP_ERR_ULP_SIZE_TOO_BIG),                   /*  4609 0x1201 Program doesn't fit into RTC memory reserved
175                                                                             for the ULP */
176 #   endif
177 #   ifdef      ESP_ERR_ULP_INVALID_LOAD_ADDR
178     ERR_TBL_IT(ESP_ERR_ULP_INVALID_LOAD_ADDR),              /*  4610 0x1202 Load address is outside of RTC memory
179                                                                             reserved for the ULP */
180 #   endif
181 #   ifdef      ESP_ERR_ULP_DUPLICATE_LABEL
182     ERR_TBL_IT(ESP_ERR_ULP_DUPLICATE_LABEL),                /*  4611 0x1203 More than one label with the same number was
183                                                                             defined */
184 #   endif
185 #   ifdef      ESP_ERR_ULP_UNDEFINED_LABEL
186     ERR_TBL_IT(ESP_ERR_ULP_UNDEFINED_LABEL),                /*  4612 0x1204 Branch instructions references an undefined label */
187 #   endif
188 #   ifdef      ESP_ERR_ULP_BRANCH_OUT_OF_RANGE
189     ERR_TBL_IT(ESP_ERR_ULP_BRANCH_OUT_OF_RANGE),            /*  4613 0x1205 Branch target is out of range of B
190                                                                             instruction (try replacing with BX) */
191 #   endif
192     // components/app_update/include/esp_ota_ops.h
193 #   ifdef      ESP_ERR_OTA_BASE
194     ERR_TBL_IT(ESP_ERR_OTA_BASE),                           /*  5376 0x1500 Base error code for ota_ops api */
195 #   endif
196 #   ifdef      ESP_ERR_OTA_PARTITION_CONFLICT
197     ERR_TBL_IT(ESP_ERR_OTA_PARTITION_CONFLICT),             /*  5377 0x1501 Error if request was to write or erase the
198                                                                             current running partition */
199 #   endif
200 #   ifdef      ESP_ERR_OTA_SELECT_INFO_INVALID
201     ERR_TBL_IT(ESP_ERR_OTA_SELECT_INFO_INVALID),            /*  5378 0x1502 Error if OTA data partition contains invalid
202                                                                             content */
203 #   endif
204 #   ifdef      ESP_ERR_OTA_VALIDATE_FAILED
205     ERR_TBL_IT(ESP_ERR_OTA_VALIDATE_FAILED),                /*  5379 0x1503 Error if OTA app image is invalid */
206 #   endif
207     // components/bootloader_support/include/esp_image_format.h
208 #   ifdef      ESP_ERR_IMAGE_BASE
209     ERR_TBL_IT(ESP_ERR_IMAGE_BASE),                         /*  8192 0x2000 */
210 #   endif
211 #   ifdef      ESP_ERR_IMAGE_FLASH_FAIL
212     ERR_TBL_IT(ESP_ERR_IMAGE_FLASH_FAIL),                   /*  8193 0x2001 */
213 #   endif
214 #   ifdef      ESP_ERR_IMAGE_INVALID
215     ERR_TBL_IT(ESP_ERR_IMAGE_INVALID),                      /*  8194 0x2002 */
216 #   endif
217     // components/esp32/include/esp_err.h
218 #   ifdef      ESP_ERR_WIFI_BASE
219     ERR_TBL_IT(ESP_ERR_WIFI_BASE),                          /* 12288 0x3000 Starting number of WiFi error codes */
220 #   endif
221     // components/esp32/include/esp_wifi.h
222 #   ifdef      ESP_ERR_WIFI_NOT_INIT
223     ERR_TBL_IT(ESP_ERR_WIFI_NOT_INIT),                      /* 12289 0x3001 WiFi driver was not installed by esp_wifi_init */
224 #   endif
225 #   ifdef      ESP_ERR_WIFI_NOT_STARTED
226     ERR_TBL_IT(ESP_ERR_WIFI_NOT_STARTED),                   /* 12290 0x3002 WiFi driver was not started by esp_wifi_start */
227 #   endif
228 #   ifdef      ESP_ERR_WIFI_NOT_STOPPED
229     ERR_TBL_IT(ESP_ERR_WIFI_NOT_STOPPED),                   /* 12291 0x3003 WiFi driver was not stopped by esp_wifi_stop */
230 #   endif
231 #   ifdef      ESP_ERR_WIFI_IF
232     ERR_TBL_IT(ESP_ERR_WIFI_IF),                            /* 12292 0x3004 WiFi interface error */
233 #   endif
234 #   ifdef      ESP_ERR_WIFI_MODE
235     ERR_TBL_IT(ESP_ERR_WIFI_MODE),                          /* 12293 0x3005 WiFi mode error */
236 #   endif
237 #   ifdef      ESP_ERR_WIFI_STATE
238     ERR_TBL_IT(ESP_ERR_WIFI_STATE),                         /* 12294 0x3006 WiFi internal state error */
239 #   endif
240 #   ifdef      ESP_ERR_WIFI_CONN
241     ERR_TBL_IT(ESP_ERR_WIFI_CONN),                          /* 12295 0x3007 WiFi internal control block of station or
242                                                                             soft-AP error */
243 #   endif
244 #   ifdef      ESP_ERR_WIFI_NVS
245     ERR_TBL_IT(ESP_ERR_WIFI_NVS),                           /* 12296 0x3008 WiFi internal NVS module error */
246 #   endif
247 #   ifdef      ESP_ERR_WIFI_MAC
248     ERR_TBL_IT(ESP_ERR_WIFI_MAC),                           /* 12297 0x3009 MAC address is invalid */
249 #   endif
250 #   ifdef      ESP_ERR_WIFI_SSID
251     ERR_TBL_IT(ESP_ERR_WIFI_SSID),                          /* 12298 0x300a SSID is invalid */
252 #   endif
253 #   ifdef      ESP_ERR_WIFI_PASSWORD
254     ERR_TBL_IT(ESP_ERR_WIFI_PASSWORD),                      /* 12299 0x300b Password is invalid */
255 #   endif
256 #   ifdef      ESP_ERR_WIFI_TIMEOUT
257     ERR_TBL_IT(ESP_ERR_WIFI_TIMEOUT),                       /* 12300 0x300c Timeout error */
258 #   endif
259 #   ifdef      ESP_ERR_WIFI_WAKE_FAIL
260     ERR_TBL_IT(ESP_ERR_WIFI_WAKE_FAIL),                     /* 12301 0x300d WiFi is in sleep state(RF closed) and wakeup fail */
261 #   endif
262 #   ifdef      ESP_ERR_WIFI_WOULD_BLOCK
263     ERR_TBL_IT(ESP_ERR_WIFI_WOULD_BLOCK),                   /* 12302 0x300e The caller would block */
264 #   endif
265 #   ifdef      ESP_ERR_WIFI_NOT_CONNECT
266     ERR_TBL_IT(ESP_ERR_WIFI_NOT_CONNECT),                   /* 12303 0x300f Station still in disconnect status */
267 #   endif
268     // components/esp32/include/esp_wps.h
269 #   ifdef      ESP_ERR_WIFI_REGISTRAR
270     ERR_TBL_IT(ESP_ERR_WIFI_REGISTRAR),                     /* 12339 0x3033 WPS registrar is not supported */
271 #   endif
272 #   ifdef      ESP_ERR_WIFI_WPS_TYPE
273     ERR_TBL_IT(ESP_ERR_WIFI_WPS_TYPE),                      /* 12340 0x3034 WPS type error */
274 #   endif
275 #   ifdef      ESP_ERR_WIFI_WPS_SM
276     ERR_TBL_IT(ESP_ERR_WIFI_WPS_SM),                        /* 12341 0x3035 WPS state machine is not initialized */
277 #   endif
278     // components/esp32/include/esp_now.h
279 #   ifdef      ESP_ERR_ESPNOW_BASE
280     ERR_TBL_IT(ESP_ERR_ESPNOW_BASE),                        /* 12388 0x3064 ESPNOW error number base. */
281 #   endif
282 #   ifdef      ESP_ERR_ESPNOW_NOT_INIT
283     ERR_TBL_IT(ESP_ERR_ESPNOW_NOT_INIT),                    /* 12389 0x3065 ESPNOW is not initialized. */
284 #   endif
285 #   ifdef      ESP_ERR_ESPNOW_ARG
286     ERR_TBL_IT(ESP_ERR_ESPNOW_ARG),                         /* 12390 0x3066 Invalid argument */
287 #   endif
288 #   ifdef      ESP_ERR_ESPNOW_NO_MEM
289     ERR_TBL_IT(ESP_ERR_ESPNOW_NO_MEM),                      /* 12391 0x3067 Out of memory */
290 #   endif
291 #   ifdef      ESP_ERR_ESPNOW_FULL
292     ERR_TBL_IT(ESP_ERR_ESPNOW_FULL),                        /* 12392 0x3068 ESPNOW peer list is full */
293 #   endif
294 #   ifdef      ESP_ERR_ESPNOW_NOT_FOUND
295     ERR_TBL_IT(ESP_ERR_ESPNOW_NOT_FOUND),                   /* 12393 0x3069 ESPNOW peer is not found */
296 #   endif
297 #   ifdef      ESP_ERR_ESPNOW_INTERNAL
298     ERR_TBL_IT(ESP_ERR_ESPNOW_INTERNAL),                    /* 12394 0x306a Internal error */
299 #   endif
300 #   ifdef      ESP_ERR_ESPNOW_EXIST
301     ERR_TBL_IT(ESP_ERR_ESPNOW_EXIST),                       /* 12395 0x306b ESPNOW peer has existed */
302 #   endif
303 #   ifdef      ESP_ERR_ESPNOW_IF
304     ERR_TBL_IT(ESP_ERR_ESPNOW_IF),                          /* 12396 0x306c Interface error */
305 #   endif
306     // components/esp32/include/esp_err.h
307 #   ifdef      ESP_ERR_MESH_BASE
308     ERR_TBL_IT(ESP_ERR_MESH_BASE),                          /* 16384 0x4000 Starting number of MESH error codes */
309 #   endif
310     // components/esp32/include/esp_mesh.h
311 #   ifdef      ESP_ERR_MESH_WIFI_NOT_START
312     ERR_TBL_IT(ESP_ERR_MESH_WIFI_NOT_START),                /* 16385 0x4001 */
313 #   endif
314 #   ifdef      ESP_ERR_MESH_NOT_INIT
315     ERR_TBL_IT(ESP_ERR_MESH_NOT_INIT),                      /* 16386 0x4002 */
316 #   endif
317 #   ifdef      ESP_ERR_MESH_NOT_CONFIG
318     ERR_TBL_IT(ESP_ERR_MESH_NOT_CONFIG),                    /* 16387 0x4003 */
319 #   endif
320 #   ifdef      ESP_ERR_MESH_NOT_START
321     ERR_TBL_IT(ESP_ERR_MESH_NOT_START),                     /* 16388 0x4004 */
322 #   endif
323 #   ifdef      ESP_ERR_MESH_NOT_SUPPORT
324     ERR_TBL_IT(ESP_ERR_MESH_NOT_SUPPORT),                   /* 16389 0x4005 */
325 #   endif
326 #   ifdef      ESP_ERR_MESH_NOT_ALLOWED
327     ERR_TBL_IT(ESP_ERR_MESH_NOT_ALLOWED),                   /* 16390 0x4006 */
328 #   endif
329 #   ifdef      ESP_ERR_MESH_NO_MEMORY
330     ERR_TBL_IT(ESP_ERR_MESH_NO_MEMORY),                     /* 16391 0x4007 */
331 #   endif
332 #   ifdef      ESP_ERR_MESH_ARGUMENT
333     ERR_TBL_IT(ESP_ERR_MESH_ARGUMENT),                      /* 16392 0x4008 */
334 #   endif
335 #   ifdef      ESP_ERR_MESH_EXCEED_MTU
336     ERR_TBL_IT(ESP_ERR_MESH_EXCEED_MTU),                    /* 16393 0x4009 */
337 #   endif
338 #   ifdef      ESP_ERR_MESH_TIMEOUT
339     ERR_TBL_IT(ESP_ERR_MESH_TIMEOUT),                       /* 16394 0x400a */
340 #   endif
341 #   ifdef      ESP_ERR_MESH_DISCONNECTED
342     ERR_TBL_IT(ESP_ERR_MESH_DISCONNECTED),                  /* 16395 0x400b */
343 #   endif
344 #   ifdef      ESP_ERR_MESH_QUEUE_FAIL
345     ERR_TBL_IT(ESP_ERR_MESH_QUEUE_FAIL),                    /* 16396 0x400c */
346 #   endif
347 #   ifdef      ESP_ERR_MESH_QUEUE_FULL
348     ERR_TBL_IT(ESP_ERR_MESH_QUEUE_FULL),                    /* 16397 0x400d */
349 #   endif
350 #   ifdef      ESP_ERR_MESH_NO_PARENT_FOUND
351     ERR_TBL_IT(ESP_ERR_MESH_NO_PARENT_FOUND),               /* 16398 0x400e */
352 #   endif
353 #   ifdef      ESP_ERR_MESH_NO_ROUTE_FOUND
354     ERR_TBL_IT(ESP_ERR_MESH_NO_ROUTE_FOUND),                /* 16399 0x400f */
355 #   endif
356 #   ifdef      ESP_ERR_MESH_OPTION_NULL
357     ERR_TBL_IT(ESP_ERR_MESH_OPTION_NULL),                   /* 16400 0x4010 */
358 #   endif
359 #   ifdef      ESP_ERR_MESH_OPTION_UNKNOWN
360     ERR_TBL_IT(ESP_ERR_MESH_OPTION_UNKNOWN),                /* 16401 0x4011 */
361 #   endif
362 #   ifdef      ESP_ERR_MESH_XON_NO_WINDOW
363     ERR_TBL_IT(ESP_ERR_MESH_XON_NO_WINDOW),                 /* 16402 0x4012 */
364 #   endif
365 #   ifdef      ESP_ERR_MESH_INTERFACE
366     ERR_TBL_IT(ESP_ERR_MESH_INTERFACE),                     /* 16403 0x4013 */
367 #   endif
368 #   ifdef      ESP_ERR_MESH_DISCARD_DUPLICATE
369     ERR_TBL_IT(ESP_ERR_MESH_DISCARD_DUPLICATE),             /* 16404 0x4014 */
370 #   endif
371 #   ifdef      ESP_ERR_MESH_DISCARD
372     ERR_TBL_IT(ESP_ERR_MESH_DISCARD),                       /* 16405 0x4015 */
373 #   endif
374 #   ifdef      ESP_ERR_MESH_VOTING
375     ERR_TBL_IT(ESP_ERR_MESH_VOTING),                        /* 16406 0x4016 */
376 #   endif
377     // components/tcpip_adapter/include/tcpip_adapter.h
378 #   ifdef      ESP_ERR_TCPIP_ADAPTER_BASE
379     ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_BASE),                 /* 20480 0x5000 */
380 #   endif
381 #   ifdef      ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS
382     ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS),       /* 20481 0x5001 */
383 #   endif
384 #   ifdef      ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY
385     ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY),         /* 20482 0x5002 */
386 #   endif
387 #   ifdef      ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED
388     ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED),   /* 20483 0x5003 */
389 #   endif
390 #   ifdef      ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED
391     ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED), /* 20484 0x5004 */
392 #   endif
393 #   ifdef      ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED
394     ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED), /* 20485 0x5005 */
395 #   endif
396 #   ifdef      ESP_ERR_TCPIP_ADAPTER_NO_MEM
397     ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_NO_MEM),               /* 20486 0x5006 */
398 #   endif
399 #   ifdef      ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED
400     ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED),     /* 20487 0x5007 */
401 #   endif
402     // components/lwip/include/apps/ping/esp_ping.h
403 #   ifdef      ESP_ERR_PING_BASE
404     ERR_TBL_IT(ESP_ERR_PING_BASE),                          /* 24576 0x6000 */
405 #   endif
406 #   ifdef      ESP_ERR_PING_INVALID_PARAMS
407     ERR_TBL_IT(ESP_ERR_PING_INVALID_PARAMS),                /* 24577 0x6001 */
408 #   endif
409 #   ifdef      ESP_ERR_PING_NO_MEM
410     ERR_TBL_IT(ESP_ERR_PING_NO_MEM),                        /* 24578 0x6002 */
411 #   endif
412     // components/esp_http_client/include/esp_http_client.h
413 #   ifdef      ESP_ERR_HTTP_BASE
414     ERR_TBL_IT(ESP_ERR_HTTP_BASE),                          /* 28672 0x7000 Starting number of HTTP error codes */
415 #   endif
416 #   ifdef      ESP_ERR_HTTP_MAX_REDIRECT
417     ERR_TBL_IT(ESP_ERR_HTTP_MAX_REDIRECT),                  /* 28673 0x7001 The error exceeds the number of HTTP redirects */
418 #   endif
419 #   ifdef      ESP_ERR_HTTP_CONNECT
420     ERR_TBL_IT(ESP_ERR_HTTP_CONNECT),                       /* 28674 0x7002 Error open the HTTP connection */
421 #   endif
422 #   ifdef      ESP_ERR_HTTP_WRITE_DATA
423     ERR_TBL_IT(ESP_ERR_HTTP_WRITE_DATA),                    /* 28675 0x7003 Error write HTTP data */
424 #   endif
425 #   ifdef      ESP_ERR_HTTP_FETCH_HEADER
426     ERR_TBL_IT(ESP_ERR_HTTP_FETCH_HEADER),                  /* 28676 0x7004 Error read HTTP header from server */
427 #   endif
428 #   ifdef      ESP_ERR_HTTP_INVALID_TRANSPORT
429     ERR_TBL_IT(ESP_ERR_HTTP_INVALID_TRANSPORT),             /* 28677 0x7005 There are no transport support for the input
430                                                                             scheme */
431 #   endif
432     // components/http_server/include/http_server.h
433 #   ifdef      ESP_ERR_HTTPD_BASE
434     ERR_TBL_IT(ESP_ERR_HTTPD_BASE),                         /* 32768 0x8000 Starting number of HTTPD error codes */
435 #   endif
436 #   ifdef      ESP_ERR_HTTPD_HANDLERS_FULL
437     ERR_TBL_IT(ESP_ERR_HTTPD_HANDLERS_FULL),                /* 32769 0x8001 All slots for registering URI handlers have
438                                                                             been consumed */
439 #   endif
440 #   ifdef      ESP_ERR_HTTPD_HANDLER_EXISTS
441     ERR_TBL_IT(ESP_ERR_HTTPD_HANDLER_EXISTS),               /* 32770 0x8002 URI handler with same method and target URI
442                                                                             already registered */
443 #   endif
444 #   ifdef      ESP_ERR_HTTPD_INVALID_REQ
445     ERR_TBL_IT(ESP_ERR_HTTPD_INVALID_REQ),                  /* 32771 0x8003 Invalid request pointer */
446 #   endif
447 #   ifdef      ESP_ERR_HTTPD_RESULT_TRUNC
448     ERR_TBL_IT(ESP_ERR_HTTPD_RESULT_TRUNC),                 /* 32772 0x8004 Result string truncated */
449 #   endif
450 #   ifdef      ESP_ERR_HTTPD_RESP_HDR
451     ERR_TBL_IT(ESP_ERR_HTTPD_RESP_HDR),                     /* 32773 0x8005 Response header field larger than supported */
452 #   endif
453 #   ifdef      ESP_ERR_HTTPD_RESP_SEND
454     ERR_TBL_IT(ESP_ERR_HTTPD_RESP_SEND),                    /* 32774 0x8006 Error occured while sending response packet */
455 #   endif
456 #   ifdef      ESP_ERR_HTTPD_ALLOC_MEM
457     ERR_TBL_IT(ESP_ERR_HTTPD_ALLOC_MEM),                    /* 32775 0x8007 Failed to dynamically allocate memory for
458                                                                             resource */
459 #   endif
460 #   ifdef      ESP_ERR_HTTPD_TASK
461     ERR_TBL_IT(ESP_ERR_HTTPD_TASK),                         /* 32776 0x8008 Failed to launch server task/thread */
462 #   endif
463     // components/spi_flash/include/esp_spi_flash.h
464 #   ifdef      ESP_ERR_FLASH_BASE
465     ERR_TBL_IT(ESP_ERR_FLASH_BASE),                         /* 65552 0x10010 */
466 #   endif
467 #   ifdef      ESP_ERR_FLASH_OP_FAIL
468     ERR_TBL_IT(ESP_ERR_FLASH_OP_FAIL),                      /* 65553 0x10011 */
469 #   endif
470 #   ifdef      ESP_ERR_FLASH_OP_TIMEOUT
471     ERR_TBL_IT(ESP_ERR_FLASH_OP_TIMEOUT),                   /* 65554 0x10012 */
472 #   endif
473 };
474 #endif //CONFIG_ESP_ERR_TO_NAME_LOOKUP
475
476 static const char esp_unknown_msg[] =
477 #ifdef CONFIG_ESP_ERR_TO_NAME_LOOKUP
478     "ERROR";
479 #else
480     "UNKNOWN ERROR";
481 #endif //CONFIG_ESP_ERR_TO_NAME_LOOKUP
482
483 const char *esp_err_to_name(esp_err_t code)
484 {
485 #ifdef CONFIG_ESP_ERR_TO_NAME_LOOKUP
486     int i;
487
488     for (i = 0; i < sizeof(esp_err_msg_table)/sizeof(esp_err_msg_table[0]); ++i) {
489         if (esp_err_msg_table[i].code == code) {
490             return esp_err_msg_table[i].msg;
491         }
492     }
493 #endif //CONFIG_ESP_ERR_TO_NAME_LOOKUP
494
495     return esp_unknown_msg;
496 }
497
498 const char *esp_err_to_name_r(esp_err_t code, char *buf, size_t buflen)
499 {
500 #ifdef CONFIG_ESP_ERR_TO_NAME_LOOKUP
501     int i;
502
503     for (i = 0; i < sizeof(esp_err_msg_table)/sizeof(esp_err_msg_table[0]); ++i) {
504         if (esp_err_msg_table[i].code == code) {
505             strlcpy(buf, esp_err_msg_table[i].msg, buflen);
506             return buf;
507         }
508     }
509 #endif //CONFIG_ESP_ERR_TO_NAME_LOOKUP
510
511     if (strerror_r(code, buf, buflen) == 0) {
512         return buf;
513     }
514
515     snprintf(buf, buflen, "%s 0x%x(%d)", esp_unknown_msg, code, code);
516
517     return buf;
518 }