forked from espressif/esp-protocols
Introduce isInBullshitState() to restart the modem stack quicker when it breaks
This commit is contained in:
@@ -202,6 +202,7 @@ bool CMux::on_recovery(CMuxFrame &frame)
|
||||
frame.ptr = recover_ptr;
|
||||
state = cmux_state::INIT;
|
||||
ESP_LOGI("CMUX", "Protocol recovered");
|
||||
m_isInBullshitState = true;
|
||||
if (frame.len > 1 && frame.ptr[1] == SOF_MARKER) {
|
||||
// empty frame
|
||||
frame.advance();
|
||||
|
||||
@@ -394,6 +394,13 @@ bool DTE::recover()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DTE::isInBullshitState()
|
||||
{
|
||||
if (!cmux_term)
|
||||
return false;
|
||||
return cmux_term->isInBullshitState();
|
||||
}
|
||||
|
||||
void DTE::handle_error(terminal_error err)
|
||||
{
|
||||
if (err == terminal_error::BUFFER_OVERFLOW ||
|
||||
|
||||
Reference in New Issue
Block a user