Skip to content

Commit 52d2ec2

Browse files
committed
Allow to add Delay to CMUX DISC
1 parent c6e2eb2 commit 52d2ec2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

components/esp_modem/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ menu "esp-modem"
3636
The typical reason for failing SABM request without a delay is that
3737
some devices (SIM800) send MSC requests just after opening a new DLCI.
3838

39+
config ESP_MODEM_CMUX_DELAY_AFTER_DLCI_DISCONNECT
40+
int "Delay in ms to wait after closing virtual terminal"
41+
default 0
42+
help
43+
Some devices might need a pause before sending disconnect command that closes
44+
virtual terminal. This delay applies only to close DLCI in CMUX mode.
45+
3946
config ESP_MODEM_CMUX_USE_SHORT_PAYLOADS_ONLY
4047
bool "CMUX to support only short payloads (<128 bytes)"
4148
default n

components/esp_modem/src/esp_modem_cmux.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ uint8_t CMux::fcs_crc(const uint8_t frame[6])
8181

8282
void CMux::send_disconnect(size_t i)
8383
{
84+
usleep(CONFIG_ESP_MODEM_CMUX_DELAY_AFTER_DLCI_DISCONNECT * 1'000);
8485
if (i == 0) { // control terminal
8586
uint8_t frame[] = {
8687
SOF_MARKER, 0x3, 0xEF, 0x5, 0xC3, 0x1, 0xF2, SOF_MARKER

0 commit comments

Comments
 (0)