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?
Asked
Active
Viewed 243 times
0

Medinoc
- 6,577
- 20
- 42
1 Answers
1
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.
-
By "CRT", I mean the one from Visual C++, which contains standard C90 functions + some ersatz of POSIX functions + some Microsoft extensions. – Medinoc May 31 '13 at 12:10
-
I just confirmed that there is no reference to `SetCommState()` whatsoever in the CRT source code, so I'll accept your answer. – Medinoc Jan 22 '15 at 16:08