From 45a14b5d191122d4a5ba458441871fe3a717de7d Mon Sep 17 00:00:00 2001 From: JIe Date: Mon, 30 Sep 2024 10:49:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BB=B6=E6=97=B6=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E4=B8=B2=E5=8F=A3=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/serial.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/serial.h b/include/serial.h index 1f76971..050c8e4 100644 --- a/include/serial.h +++ b/include/serial.h @@ -83,6 +83,12 @@ class Serial { bool IsOpen() { return ser.isDeviceOpen(); } + template + bool OpenDeviceDelay(T portName, unsigned int baudRate, int delay){ + std::this_thread::sleep_for(std::chrono::seconds(delay)); + return OpenDevice(portName, baudRate); + } + template bool OpenDevice(T portName, unsigned int bauds = 115200) { std::string reallyPortName;