예제 #1
0
 public void SetBaudRate(int baudrate)
 {
     try
     {
         GetErrorCode(WinApi.sio_ioctl(PortIndex, baudrate, DataBit | StopBit | Parity));
         this.BaudRate = baudrate;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
 public void Open()
 {
     try
     {
         GetErrorCode(WinApi.sio_open(PortIndex));
         GetErrorCode(WinApi.sio_ioctl(PortIndex, _BaudRate, _DataBit | _StopBit | _Parity));
         SetDataReceived();
         IsOpen = true;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
 public void Open()
 {
     try
     {
         GetErrorCode(WinApi.sio_open(PortIndex));
         GetErrorCode(WinApi.sio_ioctl(PortIndex, BaudRate, DataBit | StopBit | Parity));
         SetWriteTimeouts(200);
         SetDataReceived();
         IsOpen = true;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }