EasyManuals Logo

Siemens M20 Terminal User Manual

Siemens M20 Terminal
234 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #178 background imageLoading...
Page #178 background image
Application notes
Version 8 dated 15.03.00 178
Siemens Information and Communication Products
A
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; /* address of device control string */
DCB FAR* lpdcb; /* address of device control block */
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.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens M20 Terminal and is the answer not in the manual?

Siemens M20 Terminal Specifications

General IconGeneral
BrandSiemens
ModelM20 Terminal
CategoryEngine
LanguageEnglish

Related product manuals