Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3f96364

Browse filesBrowse files
committed
WiFiGeneric: Add ETH_LOST_IP event.
1 parent cb807c3 commit 3f96364
Copy full SHA for 3f96364

File tree

2 files changed

+8
-1
lines changed
Filter options

2 files changed

+8
-1
lines changed

‎libraries/WiFi/src/WiFiGeneric.cpp

Copy file name to clipboardExpand all lines: libraries/WiFi/src/WiFiGeneric.cpp
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,13 @@ static void _arduino_event_cb(void* arg, esp_event_base_t event_base, int32_t ev
354354
} else if (event_base == ETH_EVENT && event_id == ETHERNET_EVENT_STOP) {
355355
log_v("Ethernet Stopped");
356356
arduino_event.event_id = ARDUINO_EVENT_ETH_STOP;
357-
} else if (event_base == IP_EVENT && event_id == IP_EVENT_ETH_GOT_IP) {
357+
} else if (event_base == IP_EVENT && event_id == IP_EVENT_ETH_LOST_IP) {
358+
ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;
359+
log_v("Ethernet lost ip.");
360+
arduino_event.event_id = ARDUINO_EVENT_ETH_LOST_IP;
361+
}
362+
363+
else if (event_base == IP_EVENT && event_id == IP_EVENT_ETH_GOT_IP) {
358364
ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;
359365
log_v("Ethernet got %sip:" IPSTR, event->ip_changed?"new":"", IP2STR(&event->ip_info.ip));
360366
arduino_event.event_id = ARDUINO_EVENT_ETH_GOT_IP;

‎libraries/WiFi/src/WiFiGeneric.h

Copy file name to clipboardExpand all lines: libraries/WiFi/src/WiFiGeneric.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ typedef enum {
5858
ARDUINO_EVENT_ETH_DISCONNECTED,
5959
ARDUINO_EVENT_ETH_GOT_IP,
6060
ARDUINO_EVENT_ETH_GOT_IP6,
61+
ARDUINO_EVENT_ETH_LOST_IP,
6162
ARDUINO_EVENT_WPS_ER_SUCCESS,
6263
ARDUINO_EVENT_WPS_ER_FAILED,
6364
ARDUINO_EVENT_WPS_ER_TIMEOUT,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.