Siemens M20 Terminal Technical Description page 178

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

Advertisement

Siemens Information and Communication Products
CD).
8.4.1
General information
The following functions are available under Windows 95. When using these functions, the user has to include windows.h
which is available under Microsoft Visual (MSVC) or Borland C, for example.
To send an AT command within your program, use WriteComm, to receive the response from the mobile equipment, use
the ReadComm function.
For further details, e.g. initializing the serial interface, see below.
8.4.2
List of functions
8.4.2.1
int BuildCommDCB(lpszDef, lpdcb)
LPCSTR lpszDef;
DCB FAR* lpdcb;
The BuildCommDCB function translates a device definition string into appropriate serial device control block (DCB) co-
des.
int BuildCommDCB(lpszDef, lpdcb)
Parameter
Description
lpszDef
Points to a null-terminated string that specifies device control information. The string must
have the same form as the parameters used in the MS-DOS mode command.
lpdcb
Indicates a DCB structure that will receive the translated string. The structure defines the
control settings for the serial communications device.
Return value
0 if the function is successful.
Otherwise –1.
Example
The following example uses the BuildCommDCB and SetCommState functions to set up
COM1 to operate at 9600 bauds, with 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
The BuildCommDCB function only fills the buffer. To apply the settings to a port, an ap-
plication should use the SetCommState function.
By default, BuildCommDCB specifies XON/XOFF and hardware flow control as disabled.
To enable flow control, an application should set the appropriate members in the DCB
structure.
Version 8 dated 15.03.00
/* address of device control string
/* address of device control block
*/
*/
Application notes
A
178

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents