mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-20 22:12:27 +02:00
fix(esp-modem): Improve PPP exit sequence
* Implement retry mechanism if escape PPP mode failed * Stop networking and checking for NO-CARRIER manually on PPP exit Closes https://github.com/espressif/esp-protocols/issues/47
This commit is contained in:
@ -79,8 +79,17 @@ public:
|
||||
}
|
||||
return true;
|
||||
} else if (mode == modem_mode::COMMAND_MODE) {
|
||||
Task::Delay(1000); // Mandatory 1s pause
|
||||
return set_command_mode() == command_result::OK;
|
||||
Task::Delay(1000); // Mandatory 1s pause before
|
||||
int retry = 0;
|
||||
while (retry++ < 3) {
|
||||
if (set_command_mode() == command_result::OK)
|
||||
return true;
|
||||
Task::Delay(1000); // Mandatory 1s pause after escape
|
||||
if (sync() == command_result::OK)
|
||||
return true;
|
||||
Task::Delay(1000); // Mandatory 1s pause before escape
|
||||
}
|
||||
return false;
|
||||
} else if (mode == modem_mode::CMUX_MODE) {
|
||||
return set_cmux() == command_result::OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user