@@ -49,10 +49,18 @@ extern "C" int lwip_hook_ip6_input(struct pbuf *p, struct netif *inp) {
49
49
static void _ip_event_cb (void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) {
50
50
if (event_base == IP_EVENT) {
51
51
NetworkInterface *netif = NULL ;
52
- if (event_id == IP_EVENT_STA_GOT_IP || event_id == IP_EVENT_ETH_GOT_IP || event_id == IP_EVENT_PPP_GOT_IP) {
52
+ if (event_id == IP_EVENT_STA_GOT_IP
53
+ #if CONFIG_ETH_ENABLED
54
+ || event_id == IP_EVENT_ETH_GOT_IP
55
+ #endif
56
+ || event_id == IP_EVENT_PPP_GOT_IP) {
53
57
ip_event_got_ip_t *event = (ip_event_got_ip_t *)event_data;
54
58
netif = getNetifByEspNetif (event->esp_netif );
55
- } else if (event_id == IP_EVENT_STA_LOST_IP || event_id == IP_EVENT_PPP_LOST_IP || event_id == IP_EVENT_ETH_LOST_IP) {
59
+ } else if (event_id == IP_EVENT_STA_LOST_IP || event_id == IP_EVENT_PPP_LOST_IP
60
+ #if CONFIG_ETH_ENABLED
61
+ || event_id == IP_EVENT_ETH_LOST_IP
62
+ #endif
63
+ ) {
56
64
ip_event_got_ip_t *event = (ip_event_got_ip_t *)event_data;
57
65
netif = getNetifByEspNetif (event->esp_netif );
58
66
} else if (event_id == IP_EVENT_GOT_IP6) {
@@ -88,9 +96,12 @@ void NetworkInterface::_onIpEvent(int32_t event_id, void *event_data) {
88
96
#endif
89
97
if (_interface_id == ESP_NETIF_ID_PPP) {
90
98
arduino_event.event_id = ARDUINO_EVENT_PPP_GOT_IP;
99
+ #if CONFIG_ETH_ENABLED
91
100
} else if (_interface_id >= ESP_NETIF_ID_ETH && _interface_id < ESP_NETIF_ID_MAX) {
92
101
arduino_event.event_id = ARDUINO_EVENT_ETH_GOT_IP;
102
+ #endif
93
103
}
104
+
94
105
} else if (event_id == _lost_ip_event_id) {
95
106
clearStatusBits (ESP_NETIF_HAS_IP_BIT);
96
107
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
@@ -103,8 +114,10 @@ void NetworkInterface::_onIpEvent(int32_t event_id, void *event_data) {
103
114
#endif
104
115
if (_interface_id == ESP_NETIF_ID_PPP) {
105
116
arduino_event.event_id = ARDUINO_EVENT_PPP_LOST_IP;
117
+ #if CONFIG_ETH_ENABLED
106
118
} else if (_interface_id >= ESP_NETIF_ID_ETH && _interface_id < ESP_NETIF_ID_MAX) {
107
119
arduino_event.event_id = ARDUINO_EVENT_ETH_LOST_IP;
120
+ #endif
108
121
}
109
122
#if CONFIG_LWIP_IPV6
110
123
} else if (event_id == IP_EVENT_GOT_IP6) {
@@ -132,8 +145,10 @@ void NetworkInterface::_onIpEvent(int32_t event_id, void *event_data) {
132
145
#endif
133
146
if (_interface_id == ESP_NETIF_ID_PPP) {
134
147
arduino_event.event_id = ARDUINO_EVENT_PPP_GOT_IP6;
148
+ #if CONFIG_ETH_ENABLED
135
149
} else if (_interface_id >= ESP_NETIF_ID_ETH && _interface_id < ESP_NETIF_ID_MAX) {
136
150
arduino_event.event_id = ARDUINO_EVENT_ETH_GOT_IP6;
151
+ #endif
137
152
}
138
153
#endif /* CONFIG_LWIP_IPV6 */
139
154
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
0 commit comments