常用小代码——串口初始化

常用小代码

 1     m_comScanner.put_CommPort(m_dwScannerPortID);
 2     m_comScanner.put_InputMode(1);
 3     m_comScanner.put_InBufferSize(1024);
 4     m_comScanner.put_OutBufferSize(1024);
 5 
 6     m_comScanner.put_Settings(TEXT("9600,n,8,1"));
 7     if (!m_comScanner.get_PortOpen())
 8     {
 9         m_comScanner.put_PortOpen(TRUE);
10     }
11 
12     m_comScanner.put_RThreshold(1);
13     m_comScanner.put_InputLen(0);
14     m_comScanner.get_Input();

 

你可能感兴趣的:(初始化)