esp-netif-ppp: support for setting ppp netif up and down

calling esp_netif_up() and esp_netif_down() was not supported if the
underlying netif wos of ppp type. Updated the code to enable setting
these interfaces up/down and registered actions in moden_netif glue for
connection/disconnection events to set the netif up/down.
This commit is contained in:
David Cermak
2020-03-04 12:41:32 +01:00
committed by bot
parent e8ff22b5fb
commit fffdc1d789
3 changed files with 18 additions and 3 deletions
@@ -146,6 +146,14 @@ esp_err_t esp_modem_netif_set_default_handlers(void *h, esp_netif_t * esp_netif)
if (ret != ESP_OK) {
goto set_event_failed;
}
ret = esp_event_handler_register(IP_EVENT, IP_EVENT_PPP_GOT_IP, esp_netif_action_connected, esp_netif);
if (ret != ESP_OK) {
goto set_event_failed;
}
ret = esp_event_handler_register(IP_EVENT, IP_EVENT_PPP_LOST_IP, esp_netif_action_disconnected, esp_netif);
if (ret != ESP_OK) {
goto set_event_failed;
}
return ESP_OK;
set_event_failed: