Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/ttcomtester/teraterm/teraterm/commlib.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 10585 by zmatsuo, Fri Jan 20 16:03:38 2023 UTC revision 10586 by zmatsuo, Mon Feb 6 13:26:02 2023 UTC
# Line 33  Line 33 
33  #include "tttypes.h"  #include "tttypes.h"
34  #include "tt_res.h"  #include "tt_res.h"
35  #include <process.h>  #include <process.h>
36    #include <assert.h>
37    
38  #include "ttcommon.h"  #include "ttcommon.h"
39  #include "ttwsk.h"  #include "ttwsk.h"
# Line 203  void CommResetSerial(PTTSet ts, PComVar Line 204  void CommResetSerial(PTTSet ts, PComVar
204    
205          dcb.fDtrControl = DTR_CONTROL_ENABLE;          dcb.fDtrControl = DTR_CONTROL_ENABLE;
206          dcb.fRtsControl = RTS_CONTROL_ENABLE;          dcb.fRtsControl = RTS_CONTROL_ENABLE;
207    #if 1
208            dcb.XonChar = XON;
209            dcb.XoffChar = XOFF;
210    #endif
211          switch (ts->Flow) {          switch (ts->Flow) {
212                  case IdFlowX:                  case IdFlowX:
213                            dcb.XonChar = XON;
214                            dcb.XoffChar = XOFF;
215                          dcb.fOutX = TRUE;                          dcb.fOutX = TRUE;
216                          dcb.fInX = TRUE;                          dcb.fInX = TRUE;
217                          dcb.XonLim = CommXonLim;                          dcb.XonLim = CommXonLim;
218                          dcb.XoffLim = CommXoffLim;                          dcb.XoffLim = CommXoffLim;
                         dcb.XonChar = XON;  
                         dcb.XoffChar = XOFF;  
219                          break;                          break;
220                  case IdFlowHard:  // RTS/CTS                  case IdFlowHard:  // RTS/CTS
221                          dcb.fOutxCtsFlow = TRUE;                          dcb.fOutxCtsFlow = TRUE;
# Line 239  void CommResetSerial(PTTSet ts, PComVar Line 244  void CommResetSerial(PTTSet ts, PComVar
244                          break;                          break;
245          }          }
246    
247          SetCommState(cv->ComID, &dcb);          if (SetCommState(cv->ComID, &dcb) == 0) {
248                    // 設定エラー
249                    assert(0);
250            }
251    #if !defined(NDEBUG)
252            {
253                    DCB dcb_read;
254                    GetCommState(cv->ComID, &dcb_read);
255                    if (memcmp(&dcb, &dcb_read, sizeof(dcb)) != 0) {
256                            assert(0);
257                    }
258            }
259    #endif
260    
261          /* enable receive request */          /* enable receive request */
262          SetCommMask(cv->ComID,0);          SetCommMask(cv->ComID,0);

Legend:
Removed from v.10585  
changed lines
  Added in v.10586

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26