添加延时开启串口函数
This commit is contained in:
parent
a64832cb5d
commit
45a14b5d19
@ -83,6 +83,12 @@ class Serial {
|
|||||||
|
|
||||||
bool IsOpen() { return ser.isDeviceOpen(); }
|
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>
|
template <SupportString T>
|
||||||
bool OpenDevice(T portName, unsigned int bauds = 115200) {
|
bool OpenDevice(T portName, unsigned int bauds = 115200) {
|
||||||
std::string reallyPortName;
|
std::string reallyPortName;
|
||||||
|
Loading…
Reference in New Issue
Block a user