Merge branch 'feature/add_eth_lost_ip_event' into 'master'

event: Add IP_EVENT_ETH_LOST_IP event

Closes IDFGH-5198

See merge request espressif/esp-idf!13466
This commit is contained in:
David Čermák 2021-05-10 07:27:16 +00:00
commit 2e4d5d8765
5 changed files with 9 additions and 1 deletions

View File

@ -121,6 +121,9 @@ static system_event_id_t esp_event_legacy_ip_event_id(int32_t event_id)
case IP_EVENT_ETH_GOT_IP:
return SYSTEM_EVENT_ETH_GOT_IP;
case IP_EVENT_ETH_LOST_IP:
return SYSTEM_EVENT_ETH_LOST_IP;
default:
ESP_LOGE(TAG, "invalid ip event id %d", event_id);
return SYSTEM_EVENT_MAX;

View File

@ -58,6 +58,7 @@ typedef enum {
SYSTEM_EVENT_ETH_CONNECTED, /*!< ESP32 ethernet phy link up */
SYSTEM_EVENT_ETH_DISCONNECTED, /*!< ESP32 ethernet phy link down */
SYSTEM_EVENT_ETH_GOT_IP, /*!< ESP32 ethernet got IP from connected AP */
SYSTEM_EVENT_ETH_LOST_IP, /*!< ESP32 ethernet lost IP and the IP is reset to 0 */
SYSTEM_EVENT_MAX /*!< Number of members in this enum */
} system_event_id_t;

View File

@ -55,7 +55,7 @@ extern "C" {
ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(mac) \
ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(ip_info) \
.get_ip_event = IP_EVENT_ETH_GOT_IP, \
.lost_ip_event = 0, \
.lost_ip_event = IP_EVENT_ETH_LOST_IP, \
.if_key = "ETH_DEF", \
.if_desc = "eth", \
.route_prio = 50 \

View File

@ -88,6 +88,7 @@ typedef enum {
IP_EVENT_AP_STAIPASSIGNED, /*!< soft-AP assign an IP to a connected station */
IP_EVENT_GOT_IP6, /*!< station or ap or ethernet interface v6IP addr is preferred */
IP_EVENT_ETH_GOT_IP, /*!< ethernet got IP from connected AP */
IP_EVENT_ETH_LOST_IP, /*!< ethernet lost IP and the IP is reset to 0 */
IP_EVENT_PPP_GOT_IP, /*!< PPP interface got IP */
IP_EVENT_PPP_LOST_IP, /*!< PPP interface lost IP */
} ip_event_t;

View File

@ -123,6 +123,9 @@ Event IDs and Corresponding Data Structures
| IP_EVENT_ETH_GOT_IP | :cpp:class:`ip_event_got_ip_t` |
| (SYSTEM_EVENT_ETH_GOT_IP) | |
+------------------------------------+-----------------------------------------------+
| IP_EVENT_ETH_LOST_IP | n/a |
| (SYSTEM_EVENT_ETH_LOST_IP) | |
+------------------------------------+-----------------------------------------------+
Mesh Events
-----------