C Language Development Kit/Functions/PutCom
From OptiWiki
| Availability | All terminals |
| Description | putcom() transmits a character through the serial communications port that was last opened by comopen(). |
| Syntax | H 13, OPH 100x, OPL 97xx, DCL 153x
int putcom( int c ); void putcom( int c ); |
| Arguments |
int c
|
| Returns | For H 13, OPH 100x, OPL 97xx, DCL 153x series OK or ERROR. |
| Remarks | When the COM port was not opened previously, ERROR will be returned. |
| Example | #include "lib.h" #include <stdio.h> void main( void ) { int ch; comopen( COM2 ); // Open the COM port for the cradle for(;;) { if( (ch = getcom( 0 )) != -1) { putchar( ch ); putcom( ch ); } if( (ch = getchar()) != EOF) { putchar( ch ); putcom( ch ); } idle(); // Very important to lower the power consumption } } |
