home *** CD-ROM | disk | FTP | other *** search
- /*
- * EXAMP21.C
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1989 Greenleaf Software Inc. All Rights Reserved.
- *
- * This example program demonstrates the use of isbstat(). This program
- * will overrun the receive buffer.
- *
- *
- */
- #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, 10, 10,
- 1200L, P_NONE, 1, 8, ON, ON);
- if ( status < ASSUCCESS ) {
- printf( "Failed to open the port. Status = %d\n", status );
- exit( 1 );
- }
- asiputs( COM1, "ATS11?\r", -1 );
- timer( 18 );
- asiputs( COM1, "ATS11?\r", -1 );
- timer( 18 );
- status = asibstat( COM1 );
- printf( "COM1 receive buffer overflow: %s\n", status & RXOVFLOW ? "ON" : "OFF" );
- asierst( COM1 );
- status = asibstat( COM1 );
- printf( "COM1 receive buffer overflow: %s\n", status & RXOVFLOW ? "ON" : "OFF" );
- }