Examples/PPPoS: Fixed missed NETIF_PPP_STATUS event unregister

NETIF_PPP_STATUS is registerd while modem gets attached to the related netif.
we don't have any network detach functionality in the modem component, so we
unregister the event during esp_modem_netif_clear_default_handlers().

Related https://esp32.com/viewtopic.php?f=13&t=23632
Related https://github.com/espressif/esp-idf/issues/7469
pull/7868/head
David Cermak 2021-10-18 12:58:24 +02:00
rodzic 28d534ad33
commit 12f4f8f7f8
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -153,6 +153,10 @@ esp_err_t esp_modem_netif_clear_default_handlers(void *h)
goto clear_event_failed; goto clear_event_failed;
} }
// this event is registered while modem gets attached to netif.
// we don't have any detach functionality, so we unregister here and ignore potential error
esp_event_handler_unregister(NETIF_PPP_STATUS, ESP_EVENT_ANY_ID, on_ppp_changed);
return ESP_OK; return ESP_OK;
clear_event_failed: clear_event_failed: