/// <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; }
void CloseComPort() { if (serialPort != null) { serialPort.Disable(); serialPort.Dispose(); serialPort = null; } }
public void Stop() { _port.Disable(); _port.DataReceived -= _port_DataReceived; // _port.DataReceived -= PortOnDataReceived; }