/// <summary>
 ///     Close the serial port and stop processing data.
 /// </summary>
 /// <remarks>
 ///     This method clears the buffer and destroys any pending text.
 /// </remarks>
 public void Close()
 {
     if (IsEnabled)
     {
         serialPort.Disable();
         IsEnabled = false;
     }
     buffer = string.Empty;
 }
Example #2
0
 void CloseComPort()
 {
     if (serialPort != null)
     {
         serialPort.Disable();
         serialPort.Dispose();
         serialPort = null;
     }
 }
Example #3
0
 public void Stop()
 {
     _port.Disable();
     _port.DataReceived -= _port_DataReceived;
     // _port.DataReceived -= PortOnDataReceived;
 }