From 46b4c970d160816e91e933a3f6af402b1812e86a Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Sun, 3 Oct 2021 22:21:45 +0200 Subject: [PATCH] Fix socket abstraction for ESP-IDF v4 (#2434) --- esphome/components/socket/bsd_sockets_impl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/esphome/components/socket/bsd_sockets_impl.cpp b/esphome/components/socket/bsd_sockets_impl.cpp index aca15f118e..dcf4ea1f4e 100644 --- a/esphome/components/socket/bsd_sockets_impl.cpp +++ b/esphome/components/socket/bsd_sockets_impl.cpp @@ -96,6 +96,9 @@ class BSDSocketImpl : public Socket { break; } return ret; +#elif defined(ARDUINO_ARCH_ESP32) + // ESP-IDF v4 only has symbol lwip_readv + return ::lwip_readv(fd_, iov, iovcnt); #else return ::readv(fd_, iov, iovcnt); #endif @@ -120,6 +123,9 @@ class BSDSocketImpl : public Socket { break; } return ret; +#elif defined(ARDUINO_ARCH_ESP32) + // ESP-IDF v4 only has symbol lwip_writev + return ::lwip_writev(fd_, iov, iovcnt); #else return ::writev(fd_, iov, iovcnt); #endif