home *** CD-ROM | disk | FTP | other *** search
- /*
- * EXAMP08.C
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1989 Greenleaf Software Inc. All Rights Reserved.
- *
- * This example program demonstrates the use of asicheck().
- *
- */
- #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 | WIDETRACKRX, 100, 100,
- 1200L, P_NONE, 1, 8, ON, ON);
- if ( status < ASSUCCESS ) {
- printf( "Failed to open the port. Status = %d\n", status );
- exit( 1 );
- }
- asicheck( COM1, ALERT_FLAG_STOPS_RX_AND_TX, ON );
- asicheck( COM1, CTS_LOW_STOPS_TX_INTERRUPTS, OFF );
- asicheck( COM1, DSR_LOW_DISCARDS_RX_DATA, OFF );
- asicheck( COM1, CD_LOW_DISCARDS_RX_DATA, ON );
- asicheck( COM1, MODEM_STATUS_CHANGES_SET_ALERT, OFF );
- asicheck( COM1, LINE_STATUS_ERRORS_SET_ALERT, ON );
- printf("Alert flag stops interrupts: %s\n",
- AlertFlagStopsRXAndTX( COM1 ) ? "YES" : "NO" );
- printf("CTS Low holds TX interrupts: %s\n",
- CTSLowHoldsTXInterrupts( COM1 ) ? "YES" : "NO" );
- printf("DSR Low discards RX data: %s\n",
- DSRLowDiscardsRXData( COM1 ) ? "YES" : "NO" );
- printf("CD Low discards RX data: %s\n",
- CDLowDiscardsRXData( COM1 ) ? "YES" : "NO" );
- printf("Modem Status Changes Set the Alert Flag: %s\n",
- ModemStatusChangesSetAlert( COM1 ) ? "YES" : "NO" );
- printf("Line Status Errors Set the Alert Flag: %s\n",
- LineStatusErrorsSetAlert( COM1 ) ? "YES" : "NO" );
- }