From a98dc5126cd3533a4672cdd3d82c717851c7aadd Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 25 Feb 2025 18:14:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E7=A7=BB=E9=99=A4=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=87=8D=E5=90=AF=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 766079a6..abb9cf7a 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1157,10 +1157,14 @@ bool CPhoneDevice::Reboot(int resetType, bool manually, const std::string& reaso return false; } } - std::thread t([]() + std::thread t([manually, timeout]() { - std::this_thread::sleep_for(std::chrono::milliseconds(1000)); - GpioControl::reboot(); + XYLOG(XYLOG_SEVERITY_WARNING, "Recv REBOOT command Manually=%d", manually ? 1 : 0); + std::this_thread::sleep_for(std::chrono::milliseconds(timeout)); + if (manually) + { + GpioControl::reboot(); + } }); t.detach(); }