@@ -234,3 +234,35 @@ this patch to adapt the exit sequence https://github.com/espressif/esp-protocols
234
234
if ((frame_header[3] & 1) == 0) {
235
235
if (frame_header_offset + frame.len <= 4) {
236
236
frame_header_offset += frame.len;
237
+
238
+ 4) Device CAVLI C16QS does not correctly enter CMUX mode with esp_modem.
239
+ The CMUX as defined in 3GPP TS 27.010: SABM response (paragraph 5.4.1)
240
+ should be a UA frame (upon success, DM frame on failure).
241
+ This device however responds with 0x3F, which is neither UA nor DM.
242
+ You can apply the below patch to adapt the entry sequence
243
+
244
+ ::
245
+
246
+ diff --git a/components/esp_modem/src/esp_modem_cmux.cpp b/components/esp_modem/src/esp_modem_cmux.cpp
247
+ index c47e13b..7afbf73 100644
248
+ --- a/components/esp_modem/src/esp_modem_cmux.cpp
249
+ +++ b/components/esp_modem/src/esp_modem_cmux.cpp
250
+ @@ -137,7 +137,8 @@ bool CMux::data_available(uint8_t *data, size_t len)
251
+ } else {
252
+ return false;
253
+ }
254
+ - } else if (data == nullptr && type == (FT_UA | PF) && len == 0) { // notify the initial SABM command
255
+ + } else if (data == nullptr && (type == (FT_UA | PF) || type == 0x3f) && len == 0) { // notify the initial SABM command
256
+ Scoped<Lock> l(lock);
257
+ sabm_ack = dlci;
258
+ } else if (data == nullptr && dlci > 0) {
259
+ @@ -238,8 +239,7 @@ bool CMux::on_header(CMuxFrame &frame)
260
+ type = frame_header[2];
261
+ // Sanity check for expected values of DLCI and type,
262
+ // since CRC could be evaluated after the frame payload gets received
263
+ - if (dlci > MAX_TERMINALS_NUM || (frame_header[1] & 0x01) == 0 ||
264
+ - (((type & FT_UIH) != FT_UIH) && type != (FT_UA | PF) ) ) {
265
+ + if (dlci > MAX_TERMINALS_NUM) {
266
+ recover_protocol(protocol_mismatch_reason::UNEXPECTED_HEADER);
267
+ return true;
268
+ }
0 commit comments