Skip to content

Commit

Permalink
fix(modem): Fix netif to set PPP config in C++ way
Browse files Browse the repository at this point in the history
If the config struct contains more items (or more items will be added in
future) this init will not compile cleanly
  • Loading branch information
david-cermak committed Sep 20, 2023
1 parent 7e17d44 commit 7bba2b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/esp_modem/src/esp_modem_netif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7bba2b9

Please sign in to comment.