www.pudn.com > tcpipstack.rar > TEST.C


/* TEST.C - test for XSIO 
 
|===================================================================| 
|  My changes can be considered public domain.  Geof's statement    | 
|  will cover everything.                                           | 
|              - Rick Rodman 09/02/97                               | 
|===================================================================| 
 
	940925	rr	initial file 
*/ 
 
#include "stdio.h" 
#include "options.h" 
#include "casyncms.h" 
 
int main( argc, argv ) int argc; char *argv[]; { 
	int	l, n; 
	char	c; 
 
	printf( "Put loopback plug on serial port, press enter\n" ); 
	getchar(); 
 
	init_comm(); 
	printf( "Comm initialized\n" ); 
 
	for( l = 0; l < 50; ++l ) { 
 
		outp_char( '1' ); 
		outp_char( '2' ); 
		outp_char( '3' ); 
		outp_char( '4' ); 
		outp_char( '5' ); 
		outp_char( '6' ); 
		outp_char( '7' ); 
		outp_char( '\r' ); 
		outp_char( '\n' ); 
 
		printf( "Outputted 9 chars\n" ); 
 
		n = 0; 
		while( inp_status() ) { 
			c = ( char ) inp_char(); 
			putchar( c ); 
			++n; 
		} 
 
		printf( "Received %d chars\n", n ); 
	} 
 
	uninit_comm(); 
 
	return 0; 
} 
 
/* end of test.c */