Siemens M20 Terminal Technical Description page 189

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

Advertisement

Siemens Information and Communication Products
8.4.2.14 int SetCommState(lpdcb)
const DCB FAR* lpdcb;
The SetCommState function sets a communications device to the state specified by a device control block.
int SetCommState(lpdcb)
Parameter
Description
lpdcb
Indicates a DCB structure that contains the desired communications settings for the device. The
ID member of the DCB structure must identify the device.
Return value
0 if the function is successful.
Otherwise < 0
Example
The following example uses the BuildCommDCB and SetCommState functions to set up COM1
at 9600 baud, no parity, 8 data bits, and 1 stop bit:
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;
}
Comments
This function reinitializes all hardware and controls as defined by the DCB structure, but it does
not empty transmission or receiving queues.
See also
GetCommState, DCB
Version 8 dated 15.03.00
/* address of device control block
*/
Application notes
A
189

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents