home *** CD-ROM | disk | FTP | other *** search
- /*
- * EXAMP48.C
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1989 Greenleaf Software Inc. All Rights Reserved.
- *
- * This example program demonstrates the use of the HMSetAutoAnswerRingCount
- * function. It sets this value to the parameter specified in the
- * function call.
- *
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "asiports.h"
- #include "ibmkeys.h"
- #include "gf.h"
-
- void my_putc( char c );
- void main( void );
-
- void main()
- {
- int status;
- int value;
-
- status = asiopen( COM1, ASINOUT | BINARY | NORMALRX, 100, 100,
- 1200L, P_NONE, 1, 8, ON, ON);
- if ( status < ASSUCCESS ) {
- printf( "Failed to open the port. Status = %d\n", status );
- exit( 1 );
- }
-
- HMWaitForOK( TICKS_PER_SECOND, NULL );
- HMSetUpEchoRoutine( my_putc );
-
- HMReset(COM1);
- HMSetAutoAnswerRingCount( COM1, 3 );
- value = HMGetRegister( COM1, 0 );
- printf( "The Auto Answer Ring Count is now %d\n", value );
- }
-
- void my_putc( char c )
- {
- putc( c, stdout );
- }