添加延时开启串口函数

This commit is contained in:
JIe 2024-09-30 10:49:51 +08:00
parent a64832cb5d
commit 45a14b5d19

View File

@ -83,6 +83,12 @@ class Serial {
bool IsOpen() { return ser.isDeviceOpen(); }
template<SupportString T>
bool OpenDeviceDelay(T portName, unsigned int baudRate, int delay){
std::this_thread::sleep_for(std::chrono::seconds(delay));
return OpenDevice(portName, baudRate);
}
template <SupportString T>
bool OpenDevice(T portName, unsigned int bauds = 115200) {
std::string reallyPortName;