Siemens M20 Terminal Technical Description page 185

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

Advertisement

Siemens Information and Communication Products
8.4.2.10 int OpenComm(lpszDevControl, cbInQueue, cbOutQueue)
LPCSTR lpszDevControl;/* address of device-control information */
UINT cbInQueue;
UINT cbOutQueue;
The OpenComm function opens a communications device.
int OpenComm(lpszDevControl, cbInQueue, cbOutQueue
Parameter
Description
lpszDevControl
Points to a null-terminated string that specifies the device in the form COMn or LPTn, where n is
the device number.
cbInQueue
Specifies the size, in bytes, of the receiving queue. This parameter is ignored for LPT devices.
cbOutQueue
Specifies the size, in bytes, of the transmission queue. This parameter is ignored for LPT devices.
≥ 0 the return value identifies the open device if the function is successful.
Return value
Otherwise < 0
Errors:
If the function fails, it may return one of the following error values:
Value Meaning
IE_BADID the device identifier is invalid or unsupported.
IE_BAUDRATE the device's baud rate is unsupported.
IE_BYTESIZE the specified byte size is invalid.
IE_DEFAULT the default parameters are in error.
IE_HARDWARE the hardware is not available (is locked by another device).
IE_MEMORY the function cannot allocate the queues.
IE_NOPEN the device is not open.
IE_OPEN the device is already open.
If this function is called with both queue sizes set to zero, the return value is:
IE_OPEN if the device is already open or
IE_MEMORY if the device is not open.
Example
The following example uses the OpenComm function to open communications port 1:
idComDev = OpenComm("COM1", 1024, 128);
if (idComDev < 0)
{ ShowError(idComDev, "OpenComm");
return 0;
}
err = BuildCommDCB("COM1:9600,n,8,1", &dcb);
if (err < 0)
{ ShowError(err, "BuildCommDCB");
return 0;
}
err = SetCommState(&dcb);
if (err < 0)
{ ShowError(err, "SetCommState");
return 0;
}
Version 8 dated 15.03.00
/* size of receiving queue
/* size of transmission queue
*/
*/
Application notes
A
185

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents