Merge branch 'lwip/esp_netif_def_iface' into 'master'

esp-lwip: Added API to return default esp-netif.

See merge request espressif/esp-idf!22124
This commit is contained in:
Abhik Roy 2023-01-27 21:07:27 +08:00
commit b44f9d6b6f
2 changed files with 13 additions and 0 deletions

View File

@ -275,6 +275,14 @@ void esp_netif_action_remove_ip6_address(void *esp_netif, esp_event_base_t base,
*/
esp_err_t esp_netif_set_default_netif(esp_netif_t *esp_netif);
/**
* @brief Getter function of the default netif
*
* This API returns the selected default netif.
*
* @return Handle to esp-netif instance of the default netif.
*/
esp_netif_t* esp_netif_get_default_netif(void);
#if CONFIG_ESP_NETIF_BRIDGE_EN
/**

View File

@ -381,6 +381,11 @@ esp_err_t esp_netif_set_default_netif(esp_netif_t *esp_netif)
return esp_netif_update_default_netif(esp_netif, ESP_NETIF_SET_DEFAULT);
}
esp_netif_t *esp_netif_get_default_netif(void)
{
return s_last_default_esp_netif;
}
static inline esp_netif_t* lwip_get_esp_netif(struct netif *netif)
{
#if LWIP_ESP_NETIF_DATA