From 0dbf5833faf49b32b24a1c8e0a8ae92f0f20806d Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sun, 5 Sep 2021 14:11:21 +0200 Subject: [PATCH] fixes for ethernet --- src/espwifistack.cpp | 9 ++++++++- src/espwifistack.h | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/espwifistack.cpp b/src/espwifistack.cpp index e6c72e5..98a9bbc 100644 --- a/src/espwifistack.cpp +++ b/src/espwifistack.cpp @@ -630,7 +630,7 @@ void update(const config &config) } } -#ifdef XXXX +#ifdef CONFIG_ETH_ENABLED if (eth_initialized) { bool justStarted{}; @@ -803,6 +803,13 @@ tl::expected get_ip_info(tcpip_adapter_if_ } } +#ifdef CONFIG_ETH_ENABLED +esp_eth_handle_t getEthHandle() +{ + return eth_handle; +} +#endif + namespace { int wifi_set_status_bits(int bits) { diff --git a/src/espwifistack.h b/src/espwifistack.h index 0543682..54bf25c 100644 --- a/src/espwifistack.h +++ b/src/espwifistack.h @@ -1,5 +1,7 @@ #pragma once +#include "sdkconfig.h" + // system includes #include #include @@ -63,4 +65,8 @@ tl::expected get_default_mac_addr(); tl::expected get_base_mac_addr(); tl::expected set_base_mac_addr(wifi_stack::mac_t mac_addr); tl::expected get_ip_info(tcpip_adapter_if_t tcpip_if); + +#ifdef CONFIG_ETH_ENABLED +esp_eth_handle_t getEthHandle(); +#endif } // namespace wifi_stack