Skip to content

Commit

Permalink
Register Ethernet netif in WiFiGeneric to (#7632)
Browse files Browse the repository at this point in the history
Co-authored-by: Me No Dev <[email protected]>
  • Loading branch information
s-hadinger and me-no-dev authored Feb 15, 2023
1 parent 211ba18 commit 024ba74
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/Ethernet/src/ETH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 024ba74

Please sign in to comment.