[DllImport("kernel32.dll")]
private static extern bool ClearCommError(
[In] IntPtr hFile, // not int, convert int to IntPtr: new IntPtr(12)
[Out, Optional] out uint lpErrors,
[Out, Optional] out COMSTAT lpStat
);
None.
Please add some!
The following code:
COMSTAT stats = new COMSTAT();
uint flags = 0;
ClearCommError(hComm, out flags, out stats);
will get you the statistics of the com port passed with hComm.
Do you know one? Please contribute it!