Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m_SerialPort = new SerialPort("COM3", 2400);
- m_SerialPort.DataReceived += new SerialDataReceivedEventHandler(this.ReceiveChars);
- try
- {
- m_SerialPort.Open();
- m_SerialPort.DiscardInBuffer();
- m_SerialPort.DiscardOutBuffer();
- }
- catch (Exception e)
- {
- // die gracefully
- }
- finally
- {
- m_SerialPort.DtrEnable = true;
- }
Add Comment
Please, Sign In to add comment