Skip to content

Commit

Permalink
fix(esp_modem): Exit data mode only after state change
Browse files Browse the repository at this point in the history
Previously, we set the notification also for  event
causing permature PPP mode exit
  • Loading branch information
david-cermak committed Dec 1, 2022
1 parent 4314c78 commit 9a7bd90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/esp_modem/src/esp_modem_netif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ 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);
if (event_id < NETIF_PP_PHASE_OFFSET) {
if (event_id > NETIF_PPP_ERRORNONE && event_id < NETIF_PP_PHASE_OFFSET) {
ESP_LOGI("esp_modem_netif", "PPP state changed event %" PRId32, event_id);
// only notify the modem on state/error events, ignoring phase transitions
ppp->signal.set(PPP_EXIT);
Expand Down

0 comments on commit 9a7bd90

Please sign in to comment.