Skip to content

Allow to add Delay to CMUX DISC (IDFGH-15937) #604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions components/esp_modem/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ 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_DLCI_DISCONNECT
int "Delay in ms to wait after closing virtual terminal"
default 0
help
Some devices might need a pause before sending disconnect command that closes
virtual terminal. This delay applies only to close DLCI in CMUX mode.

config ESP_MODEM_CMUX_USE_SHORT_PAYLOADS_ONLY
bool "CMUX to support only short payloads (<128 bytes)"
default n
Expand Down
1 change: 1 addition & 0 deletions components/esp_modem/src/esp_modem_cmux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ uint8_t CMux::fcs_crc(const uint8_t frame[6])

void CMux::send_disconnect(size_t i)
{
usleep(CONFIG_ESP_MODEM_CMUX_DELAY_AFTER_DLCI_DISCONNECT * 1'000);
if (i == 0) { // control terminal
uint8_t frame[] = {
SOF_MARKER, 0x3, 0xEF, 0x5, 0xC3, 0x1, 0xF2, SOF_MARKER
Expand Down