mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-18 13:02:21 +02:00
Update examples
This commit is contained in:
@ -56,15 +56,23 @@ command_result DTE::command(const std::string &command, got_line_cb got_line, ui
|
||||
return res;
|
||||
}
|
||||
|
||||
void DTE::setup_cmux()
|
||||
bool DTE::setup_cmux()
|
||||
{
|
||||
auto original_term = std::move(term);
|
||||
if (original_term == nullptr)
|
||||
return false;
|
||||
auto cmux_term = std::make_shared<CMux>(std::move(original_term), std::move(buffer), buffer_size);
|
||||
if (cmux_term == nullptr)
|
||||
return false;
|
||||
buffer_size = 0;
|
||||
cmux_term->init();
|
||||
if (!cmux_term->init())
|
||||
return false;
|
||||
term = std::make_unique<CMuxInstance>(cmux_term, 0);
|
||||
if (term == nullptr)
|
||||
return false;
|
||||
command_term = term.get(); // use command terminal as previously
|
||||
other_term = std::make_unique<CMuxInstance>(cmux_term, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
command_result DTE::command(const std::string &cmd, got_line_cb got_line, uint32_t time_ms)
|
||||
|
Reference in New Issue
Block a user