INtime SDK Help
WriteComm (Serial Communications)
INtime SDK v6 > About INtime > Networking and I/O > Serial Communications (COMM) > WriteComm (Serial Communications)

Writes data to a communication device.

BOOLEAN WriteComm(
  COMMHANDLE hComm,                // handle to device
  LPCVOID lpBuffer,                // data buffer
  DWORD nNumberOfBytesToWrite,     // number of bytes to write
  LPDWORD lpNumberOfBytesWritten,  // number of bytes written
  LPVOID lpOverlapped              // unused buffer
);

Parameters

hComm
[in] Handle to the device to write to.
lpBuffer
[in] Pointer to the buffer that contains the data to write to the device.
nNumberOfBytesToWrite
[in] Specifies the number of bytes to write to the device.
lpNumberOfBytesWritten
[out] Pointer to the variable that receives the number of bytes written. WriteComm sets this value to zero before doing any work or error checking.
lpOverlapped
[in] unused

Return Values

Non-zero
Success.
0 (zero)
Failure. To determine the status, call GetLastRtError.

Status

E_BUSY
A write operation is already in progress.
E_DISCONNECTED
COMM channel is closed.
E_IO
A hardware error occurred.
E_PARAM
Invalid parameter.

Remarks

WriteComm terminates if an error occurs and fAbortOnError is set to TRUE in the DCB. WriteComm does not send data after fEof in the COMSTAT structure become TRUE.

Requirements

Versions Defined in Include Link to
INtime 3.1 intime/rt/include/comm.h comm.h comm.lib
See Also