How can I change the speed (bits per second) of the COM port on my machine using C# or the Win32 API via PInvoke?
I would like to do this instead of going into the properties of the COM port in device manager.
How can I change the speed (bits per second) of the COM port on my machine using C# or the Win32 API via PInvoke?
I would like to do this instead of going into the properties of the COM port in device manager.
as SB said, using the C# SerialPort class:
class Run
{
public static void main(string[] args)
{
SerialPort port = new SerialPort("COM2", 115200);
port.BaudRate = 115200; // set it elsewhere.
port.Open();
port.Write("ABCDE");
}
}