Do you mean "
how to write to multiple COM ports at the same time"?
Your code might open the ports and write the same data to all of them.
naraayanan wrote:
What is mean by INVALID_HANDLE_VALUE?
It is a special return value the
CreateFile
function uses to inform you that the call failed. You have to immediately call
GetLastError
to obtain a meaningful error code.
naraayanan wrote:
what is mean by SetupComm(hCom,16000,16000)?
Sets the sizes of the I/O buffers to 16000 bytes.
naraayanan wrote:
what is mean by GetCommState(hCom,&dcb)?
Retrieves the current value of the
DCB[
^] configuration struct.
naraayanan wrote:
what is mean by GetCommTimeouts(hCom,&commtime)?
naraayanan wrote:
what is mean by SetCommTimeouts(hCom,&commtime)?
Respectively gets and sets the current value of the
COMMTIMEOUTS[
^] struct. The struct contains the send/receive timeout parameters.
Serial port configuration (suggested) process works this way: retrieve all the current configuration parameters in a struct, change (on the struct) the values of the few parameters you are interested in, then, using such struct set all the parameters back.
BTW serial port programming on
Windows
isn't really a daunting task,
however you have to read the documentation.
MSDN
provides some nice code samples as well, see, for instance:
"Using Communications Resources"[
^].