home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-4.ZIP / GSAMP / GSAMP.ZIP / EXAMP21.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-17  |  1.0 KB  |  41 lines

  1. /*
  2.  *  EXAMP21.C
  3.  *
  4.  *  The Greenleaf Comm Library
  5.  *
  6.  *  Copyright (C) 1989 Greenleaf Software Inc.  All Rights Reserved.
  7.  *
  8.  *  This example program demonstrates the use of isbstat().  This program
  9.  *  will overrun the receive buffer.
  10.  *
  11.  *
  12.  */
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include "asiports.h"
  16. #include "ibmkeys.h"
  17. #include "gf.h"
  18.  
  19. void main( void );
  20.  
  21. void main()
  22. {
  23.     int status;
  24.  
  25.     status = asiopen( COM1, ASINOUT | BINARY | NORMALRX, 10, 10,
  26.                       1200L, P_NONE, 1, 8, ON, ON);
  27.     if ( status < ASSUCCESS ) {
  28.         printf( "Failed to open the port.  Status = %d\n", status );
  29.         exit( 1 );
  30.     }
  31.     asiputs( COM1, "ATS11?\r", -1 );
  32.     timer( 18 );
  33.     asiputs( COM1, "ATS11?\r", -1 );
  34.     timer( 18 );
  35.     status = asibstat( COM1 );
  36.     printf( "COM1 receive buffer overflow: %s\n", status & RXOVFLOW ? "ON" : "OFF" );
  37.     asierst( COM1 );
  38.     status = asibstat( COM1 );
  39.     printf( "COM1 receive buffer overflow: %s\n", status & RXOVFLOW ? "ON" : "OFF" );
  40. }
  41.