mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-19 05:22:21 +02:00
Added C API example
This commit is contained in:
@ -26,7 +26,6 @@ namespace esp_modem {
|
||||
void Netif::on_ppp_changed(void *arg, esp_event_base_t event_base,
|
||||
int32_t event_id, void *event_data) {
|
||||
auto *ppp = static_cast<Netif *>(arg);
|
||||
ESP_LOGW("TAG", "PPP state changed event %d", event_id);
|
||||
if (event_id < NETIF_PP_PHASE_OFFSET) {
|
||||
ESP_LOGI("TAG", "PPP state changed event %d", event_id);
|
||||
// only notify the modem on state/error events, ignoring phase transitions
|
||||
@ -54,7 +53,7 @@ esp_err_t Netif::esp_modem_post_attach(esp_netif_t *esp_netif, void *args) {
|
||||
// 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;
|
||||
// esp_netif_ppp_get_params(esp_netif, &ppp_config);
|
||||
esp_netif_ppp_get_params(esp_netif, &ppp_config);
|
||||
if (!ppp_config.ppp_error_event_enabled) {
|
||||
ppp_config.ppp_error_event_enabled = true;
|
||||
esp_netif_ppp_set_params(esp_netif, &ppp_config);
|
||||
@ -88,7 +87,7 @@ void Netif::start() {
|
||||
receive(data, actual_len);
|
||||
return false;
|
||||
});
|
||||
esp_netif_action_start(driver.base.netif, 0, 0, 0);
|
||||
esp_netif_action_start(driver.base.netif, nullptr, 0, nullptr);
|
||||
signal.set(PPP_STARTED);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user