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; } }
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; } }