From 8d5947e5f19e78607890a0541134f04ad133ead0 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Tue, 26 Sep 2023 15:14:53 +0200 Subject: [PATCH] fix(modem): Fix to allow MSC frame (SIM800 CMUX) after v1.0.2 Fixes the regression from 8edbac69 that added more strict conditions for CMUX protocol, but didn't allow MSC frames that might be sent during initializaiton by SIM800. Closes https://github.com/espressif/esp-protocols/issues/366 --- components/esp_modem/src/esp_modem_cmux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_modem/src/esp_modem_cmux.cpp b/components/esp_modem/src/esp_modem_cmux.cpp index 1ce67a61f..a04c1808d 100644 --- a/components/esp_modem/src/esp_modem_cmux.cpp +++ b/components/esp_modem/src/esp_modem_cmux.cpp @@ -144,7 +144,7 @@ bool CMux::data_available(uint8_t *data, size_t len) return false; } } else if ((type & FT_UIH) == FT_UIH && dlci == 0) { // notify the internal DISC command - if (len > 0 && (data[0] & 0xE1) == 0xE1) { + if ((len > 0 && (data[0] & 0xE1) == 0xE1) || (data == nullptr)) { // Not a DISC, ignore (MSC frame) return true; }