@@ -279,7 +279,7 @@ int WiFiClient::setOption(int option, int *value)
279279{
280280 int res = setsockopt (fd (), IPPROTO_TCP, option, (char *) value, sizeof (int ));
281281 if (res < 0 ) {
282- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
282+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
283283 }
284284 return res;
285285}
@@ -289,7 +289,7 @@ int WiFiClient::getOption(int option, int *value)
289289 size_t size = sizeof (int );
290290 int res = getsockopt (fd (), IPPROTO_TCP, option, (char *)value, &size);
291291 if (res < 0 ) {
292- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
292+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
293293 }
294294 return res;
295295}
@@ -362,7 +362,7 @@ size_t WiFiClient::write(const uint8_t *buf, size_t size)
362362 }
363363 }
364364 else if (res < 0 ) {
365- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
365+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
366366 if (errno != EAGAIN) {
367367 // if resource was busy, can try again, otherwise give up
368368 stop ();
@@ -406,7 +406,7 @@ int WiFiClient::read(uint8_t *buf, size_t size)
406406 int res = -1 ;
407407 res = _rxBuffer->read (buf, size);
408408 if (_rxBuffer->failed ()) {
409- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
409+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
410410 stop ();
411411 }
412412 return res;
@@ -416,7 +416,7 @@ int WiFiClient::peek()
416416{
417417 int res = _rxBuffer->peek ();
418418 if (_rxBuffer->failed ()) {
419- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
419+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
420420 stop ();
421421 }
422422 return res;
@@ -430,7 +430,7 @@ int WiFiClient::available()
430430 }
431431 int res = _rxBuffer->available ();
432432 if (_rxBuffer->failed ()) {
433- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
433+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
434434 stop ();
435435 }
436436 return res;
@@ -452,7 +452,7 @@ void WiFiClient::flush() {
452452 toRead = (a>WIFI_CLIENT_FLUSH_BUFFER_SIZE)?WIFI_CLIENT_FLUSH_BUFFER_SIZE:a;
453453 res = recv (fd (), buf, toRead, MSG_DONTWAIT);
454454 if (res < 0 ) {
455- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
455+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
456456 stop ();
457457 break ;
458458 }
0 commit comments