Siemens M20 Terminal Technical Description page 187

Cellular engine
Hide thumbs Also See for M20 Terminal:
Table of Contents

Advertisement

Siemens Information and Communication Products
8.4.2.11 int ReadComm(idComDev, lpvBuf, cbRead)
int idComDev;/* identifier of device to read from
void FAR* lpvBuf;
int cbRead;
The ReadComm function reads up to a specified number of bytes from the given communications device.
int ReadComm(idComDev, lpvBuf, cbRead)
Parameter
Description
idComDev
Specifies the communications device to be read from. The OpenComm function returns this value.
lpvBuf
Points to the buffer for the read bytes.
cbRead
Specifies the number of bytes to be read.
≥ 0 the number of bytes read, if the function is successful.
Return value
0 For parallel I/O ports, the return value is always zero.
Otherwise < 0, its absolute value is the number of bytes read
Example
None
Comments
When an error occurs, the cause of the error can be determined by using the GetCommError
function to retrieve the error value and status. Since errors can occur when no bytes are present (if
the return value is zero), the GetCommError function should be used to ensure that no error occur-
red.
The return value is less than the number specified by the cbRead parameter only if the number of
bytes in the receiving queue is less than that specified by cbRead. If the return value is equal to
cbRead, additional bytes may be queued for the device. If the return value is zero, no bytes are pre-
sent.
See also
GetCommError, OpenComm
8.4.2.12 int SetCommBreak(idComDev)
int idComDev;
The SetCommBreak function suspends character transmission and places the communications device in a break state.
int SetCommBreak(idComDev)
Parameter
Description
idComDev
Specifies the communications device to be suspended. The OpenComm function returns this value.
Return value
0 if the function is successful.
Otherwise < 0
Example
None
Comments
The communications device remains suspended until the application calls the ClearCommBreak
function.
See also
ClearCommBreak, OpenComm
Version 8 dated 15.03.00
/* address of buffer for read bytes
/* number of bytes to read
/* device to suspend
*/
*/
*/
*/
Application notes
A
187

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents