Question

Is it possible to configure a COM port (bitrate, parity) on Windows using only CRT functions? Or must I use Win32 functions (CreateFile, SetCommState, ReadFile, WriteFile), to use it with the bitrate and parity I want?

Was it helpful?

Solution

If by "CRT" you mean "standard C functions", then I would not expect it to be possible, no.

Serial ports are not something covered by the C language, so their configuration and management must be system-specific.

In Linux, it's the termios POSIX API that you use for this, but as clarified in this question it's not available in Windows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top