Explorar o código

添加设置IO模式:同步或异步。

sat23 %!s(int64=3) %!d(string=hai) anos
pai
achega
4fa340bcdd
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      TCLCommand/TCLCommand/Serial.h

+ 2 - 0
TCLCommand/TCLCommand/Serial.h

@@ -44,6 +44,8 @@ public:
     inline HANDLE GetHandle() { return _hCommHandle; }
     // 获得串口句炳
     operator HANDLE() { return _hCommHandle; }
+    // 设置IO模式:同步(TRUE)或异步(FALSE);
+    inline void SetIOMode(BOOL bSync=TRUE){ _dwIOMode = bSync ? 0 : FILE_FLAG_OVERLAPPED; };
     
     // 获得串口参数 DCB
     DCB *GetState();