Skip to content

Commit d1f28ff

Browse files
authored
Merge pull request me-no-dev#46 from atanisoft/patch-1
Update AsyncClient::errorToString for esp-lwip constants
2 parents 1ad1280 + f9e107c commit d1f28ff

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

src/AsyncTCP.cpp

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ extern "C"{
2727
#include "lwip/tcp.h"
2828
#include "lwip/inet.h"
2929
#include "lwip/dns.h"
30+
#include "lwip/err.h"
3031
}
3132
#include "esp_task_wdt.h"
3233

@@ -1089,22 +1090,22 @@ bool AsyncClient::canSend(){
10891090

10901091
const char * AsyncClient::errorToString(int8_t error){
10911092
switch(error){
1092-
case 0: return "OK";
1093-
case -1: return "Out of memory error";
1094-
case -2: return "Buffer error";
1095-
case -3: return "Timeout";
1096-
case -4: return "Routing problem";
1097-
case -5: return "Operation in progress";
1098-
case -6: return "Illegal value";
1099-
case -7: return "Operation would block";
1100-
case -8: return "Connection aborted";
1101-
case -9: return "Connection reset";
1102-
case -10: return "Connection closed";
1103-
case -11: return "Not connected";
1104-
case -12: return "Illegal argument";
1105-
case -13: return "Address in use";
1106-
case -14: return "Low-level netif error";
1107-
case -15: return "Already connected";
1093+
case ERR_OK: return "OK";
1094+
case ERR_MEM: return "Out of memory error";
1095+
case ERR_BUF: return "Buffer error";
1096+
case ERR_TIMEOUT: return "Timeout";
1097+
case ERR_RTE: return "Routing problem";
1098+
case ERR_INPROGRESS: return "Operation in progress";
1099+
case ERR_VAL: return "Illegal value";
1100+
case ERR_WOULDBLOCK: return "Operation would block";
1101+
case ERR_USE: return "Address in use";
1102+
case ERR_ALREADY: return "Already connected";
1103+
case ERR_CONN: return "Not connected";
1104+
case ERR_IF: return "Low-level netif error";
1105+
case ERR_ABRT: return "Connection aborted";
1106+
case ERR_RST: return "Connection reset";
1107+
case ERR_CLSD: return "Connection closed";
1108+
case ERR_ARG: return "Illegal argument";
11081109
case -55: return "DNS failed";
11091110
default: return "UNKNOWN";
11101111
}

0 commit comments

Comments
 (0)