From 7bba2b941a27eb5aec7d2951eae6a3b70fd12909 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 20 Sep 2023 10:46:53 +0200 Subject: [PATCH] fix(modem): Fix netif to set PPP config in C++ way If the config struct contains more items (or more items will be added in future) this init will not compile cleanly --- components/esp_modem/src/esp_modem_netif.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_modem/src/esp_modem_netif.cpp b/components/esp_modem/src/esp_modem_netif.cpp index 3027179fae2..65bddb43b7c 100644 --- a/components/esp_modem/src/esp_modem_netif.cpp +++ b/components/esp_modem/src/esp_modem_netif.cpp @@ -49,9 +49,9 @@ esp_err_t Netif::esp_modem_post_attach(esp_netif_t *esp_netif, void *args) ESP_ERROR_CHECK(esp_netif_set_driver_config(esp_netif, &driver_ifconfig)); // check if PPP error events are enabled, if not, do enable the error occurred/state changed // to notify the modem layer when switching modes - esp_netif_ppp_config_t ppp_config = { .ppp_phase_event_enabled = true, // assuming phase enabled, as earlier IDFs - .ppp_error_event_enabled = false - }; // don't provide cfg getters so we enable both events + esp_netif_ppp_config_t ppp_config = { }; + ppp_config.ppp_phase_event_enabled = true; // assuming phase enabled, as earlier IDFs + ppp_config.ppp_error_event_enabled = false; // don't provide cfg getters so we enable both events #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0) esp_netif_ppp_get_params(esp_netif, &ppp_config); #endif // ESP-IDF >= v4.4