fix: 当minitouch断开时自动重连

This commit is contained in:
MistEO
2023-10-13 20:48:42 +08:00
parent b396fa1cae
commit c8ed85b7ae
2 changed files with 7 additions and 2 deletions

View File

@@ -111,7 +111,12 @@ std::optional<std::string> asst::MinitouchController::reconnect(const std::strin
bool asst::MinitouchController::input_to_minitouch(const std::string& cmd)
{
return m_minitouch_handler->write(cmd);
if (!m_minitouch_handler->write(cmd)) {
Log.error("Failed to write to minitouch, try again");
call_and_hup_minitouch();
return m_minitouch_handler->write(cmd);
}
return true;
}
void asst::MinitouchController::set_swipe_with_pause(bool enable) noexcept