Casio IT-2000W Technical Reference Manual page 134

Casio pda technical reference manual
Table of Contents

Advertisement

WriteComm
int WriteComm(idComDev, lpvBuf, cbWrite)
/* Communication device ID */
int idComDev;
/* Address of the data buffer */
const void FAR * lpvBuf;
/* Number of bytes to write */
int cbWrite;
The WriteComm function will write to the specified communication device.
< Parameter >
idComDev: Specifies the device that receives the data. The OpenComm function returns this
value.
Pointer to the buffer that stores the bytes to write.
lpvBuf:
cbWrite: Specifies the number of bytes to write.
< Return value >
This function returns the number of bytes written if the function is terminated normally. Otherwise it
returns a value less than zero, and the absolute value of the return value indicates the number of
bytes that were written.
Note:
To judge if an error occurred, use the GetCommError function to acquire the error value and error
status. In the case of a serial port, the WriteComm function will delete the data in the transmission
queue, if it is full and has no space for more byte data. Therefore, before calling the WriteComm
function, the application should call the GetCommError function to check for available memory
space in the transmission queue. In addition, use the OpenComm function to set the size of the
transmission queue to a value greater than the maximum possible size of the outputted character
string.
Note on IrDA:
Even if the transmission queue contains zero bytes of transmission characters, untransmitted data
remain in the IrDA driver.
134

Advertisement

Table of Contents
loading

Table of Contents