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 / EXAMP48.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-09  |  1.1 KB  |  48 lines

  1. /*
  2.  *  EXAMP48.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 the HMSetAutoAnswerRingCount
  9.  *  function.  It sets this value to the parameter specified in the
  10.  *  function call.
  11.  *
  12.  */
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <string.h>
  16. #include "asiports.h"
  17. #include "ibmkeys.h"
  18. #include "gf.h"
  19.  
  20. void my_putc( char c );
  21. void main( void );
  22.  
  23. void main()
  24. {
  25.     int status;
  26.     int value;
  27.  
  28.     status = asiopen( COM1, ASINOUT | BINARY | NORMALRX, 100, 100,
  29.                       1200L, P_NONE, 1, 8, ON, ON);
  30.     if ( status < ASSUCCESS ) {
  31.         printf( "Failed to open the port.  Status = %d\n", status );
  32.         exit( 1 );
  33.     }
  34.  
  35.     HMWaitForOK( TICKS_PER_SECOND, NULL );
  36.     HMSetUpEchoRoutine( my_putc );
  37.  
  38.     HMReset(COM1);
  39.     HMSetAutoAnswerRingCount( COM1, 3 );
  40.     value = HMGetRegister( COM1, 0 );
  41.     printf( "The Auto Answer Ring Count is now %d\n", value );
  42. }
  43.  
  44. void my_putc( char c )
  45. {
  46.     putc( c, stdout );
  47. }
  48.