Register Ethernet netif in WiFiGeneric to (#7632)

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
This commit is contained in:
s-hadinger 2023-02-15 13:22:04 +01:00 committed by GitHub
parent 211ba18fa5
commit 024ba74068
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,7 @@
#include "lwip/dns.h"
extern void tcpipInit();
extern void add_esp_interface_netif(esp_interface_t interface, esp_netif_t* esp_netif); /* from WiFiGeneric */
#if ESP_IDF_VERSION_MAJOR > 3
@ -327,6 +328,9 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ
return false;
}
/* attach to WiFiGeneric to receive events */
add_esp_interface_netif(ESP_IF_ETH, eth_netif);
if(esp_eth_start(eth_handle) != ESP_OK){
log_e("esp_eth_start failed");
return false;