home *** CD-ROM | disk | FTP | other *** search
- /*
- * EXAMP39.C
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1989 Greenleaf Software Inc. All Rights Reserved.
- *
- * This example program is used to demonstrate the use of getrxcnt();
- *
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include "asiports.h"
- #include "ibmkeys.h"
- #include "gf.h"
-
- void main( void );
-
- void main()
- {
- int status;
-
- status = asiopen( COM1, ASINOUT | BINARY | NORMALRX, 150, 150,
- 1200L, P_NONE, 1, 8, OFF, ON);
- if ( status < ASSUCCESS ) {
- printf( "Failed to open the port. Status = %d\n", status );
- exit( 1 );
- }
- asiputs( COM1, "ATS11?\r", -1 );
- timer( TICKS_PER_SECOND * 2 );
- printf( "There are %d characters in the receive buffer\n", getrxcnt( COM1 ) );
- while ( !isrxempty( COM1 ) )
- putc( asigetc( COM1 ), stdout );
- }
-