feat(modem): Add Delay after netif stop prior sending disconnect to CMUX virtual terminals

This commit is contained in:
Thiker Shreah
2026-04-27 15:21:41 +03:00
parent dc5efaebaf
commit 55f670ab69
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -36,6 +36,12 @@ menu "esp-modem"
The typical reason for failing SABM request without a delay is that
some devices (SIM800) send MSC requests just after opening a new DLCI.
config ESP_MODEM_CMUX_DELAY_AFTER_NETIF_DISCONNECT
int "Delay in ms to wait before closing virtual terminal abd rigt after PPP disconnect(NETIF)"
default 0
help
Some devices might need a pause before sending disconnect command that closes
virtual terminal. This delay applies only in CMUX mode.
config ESP_MODEM_CMUX_USE_SHORT_PAYLOADS_ONLY
bool "CMUX to support only short payloads (<128 bytes)"
default n
@@ -160,6 +160,7 @@ bool DCE_Mode::set_unsafe(DTE *dte, ModuleIf *device, Netif &netif, modem_mode m
if (mode == modem_mode::CMUX_MODE) {
netif.stop();
netif.wait_until_ppp_exits();
usleep(CONFIG_ESP_MODEM_CMUX_DELAY_AFTER_NETIF_DISCONNECT * 1'000);
if (!dte->set_mode(modem_mode::COMMAND_MODE)) {
return false;
}