Just want to know how do we clear the receive buffer of my serial port in C#. Seems like the data in the receive buffer just keep accumulating. For example, the flow of inc
you can use like
port.DiscardOutBuffer(); port.DiscardInBuffer(); port.Close(); port.DataReceived -= new SerialDataReceivedEventHandler(onDataReceived); port = null;