Siemens M20 Terminal Technical Description page 190

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

Advertisement

Siemens Information and Communication Products
8.4.2.15 int TransmitCommChar(idComDev, chTransmit)
int idComDev;
char chTransmit;
The TransmitCommChar function places the specified character at the head of the transmission queue for the specified
device.
int TransmitCommChar(idComDev, chTransmit
Parameter
Description
idComDev
Specifies the communications device to transmit the character. The OpenComm function returns
this value.
chTransmit
Specifies the character to be transmitted.
Return value
0 if the function is successful.
< 0 if the character cannot be transmitted.
Example
The following example uses the TransmitCommChar function to send characters from the key-
board to the communications port:
case WM_CHAR:
ch = (char)wParam;
TransmitCommChar(idComDev, ch);
/* Add a linefeed for every carriage return. */
if (ch == 0x0d)
TransmitCommChar(idComDev, 0x0a);
break;
Comments
The TransmitCommChar function cannot be called repeatedly if the device is not transmitting.
Once TransmitCommChar places a character in the transmission queue, the character must be
transmitted before the function can be called again. TransmitCommChar returns an error if the pre-
vious character has not yet been sent.
See also
OpenComm, WriteComm
8.4.2.16 int UngetCommChar(idComDev, chUnget)
int idComDev;
char chUnget;
The UngetCommChar function places the specified character back in the receiving queue. The next read operation will
return this character first.
int UngetCommChar(idComDev, chUnget
Parameter
Description
idComDev
Specifies the communications device that will receive the character. The OpenComm function re-
turns this value.
chUnget
Specifies the character to be placed in the receiving queue.
Return value
0 if the function is successful.
Otherwise < 0
Example
None
Comments
Consecutive calls to the UngetCommChar function are not permitted. The character placed in the
queue must be read before this function can be called again.
See also
Version 8 dated 15.03.00
/* communications device
/* character to transmit
/* communications device
/* character to place in queue
*/
*/
*/
*/
Application notes
A
190

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents