Skip to content

Commit 024ba74

Browse files
Register Ethernet netif in WiFiGeneric to (#7632)
Co-authored-by: Me No Dev <[email protected]>
1 parent 211ba18 commit 024ba74

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: libraries/Ethernet/src/ETH.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "lwip/dns.h"
4242

4343
extern void tcpipInit();
44+
extern void add_esp_interface_netif(esp_interface_t interface, esp_netif_t* esp_netif); /* from WiFiGeneric */
4445

4546
#if ESP_IDF_VERSION_MAJOR > 3
4647

@@ -327,6 +328,9 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ
327328
return false;
328329
}
329330

331+
/* attach to WiFiGeneric to receive events */
332+
add_esp_interface_netif(ESP_IF_ETH, eth_netif);
333+
330334
if(esp_eth_start(eth_handle) != ESP_OK){
331335
log_e("esp_eth_start failed");
332336
return false;

0 commit comments

Comments
 (0)