mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-16 12:02:11 +02:00
fix(esp_modem): CMUX to ignore MSC frames
Otherwise it gets confused with DISC frame and causes trouble when entering CMUX mode (if device sends MSC requests) Closes https://github.com/espressif/esp-protocols/issues/140
This commit is contained in:
@ -143,6 +143,10 @@ void CMux::data_available(uint8_t *data, size_t len)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else if ((type&FT_UIH) == FT_UIH && dlci == 0) { // notify the internal DISC command
|
} else if ((type&FT_UIH) == FT_UIH && dlci == 0) { // notify the internal DISC command
|
||||||
|
if (len > 0 && (data[0] & 0xE1) == 0xE1) {
|
||||||
|
// Not a DISC, ignore (MSC frame)
|
||||||
|
return;
|
||||||
|
}
|
||||||
Scoped<Lock> l(lock);
|
Scoped<Lock> l(lock);
|
||||||
sabm_ack = dlci;
|
sabm_ack = dlci;
|
||||||
}
|
}
|
||||||
@ -385,6 +389,9 @@ bool CMux::init()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (i > 1) { // wait for each virtual terminal to settle MSC (no need for control term, DLCI=0)
|
||||||
|
usleep(100'000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user