mirror of
https://github.com/espressif/esp-protocols.git
synced 2026-07-06 00:20:49 +02:00
feat(modem): Add Delay after netif stop prior sending disconnect to CMUX virtual terminals
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user