main()
{
WORD rc;
WORD idx;
WORD bytesSent;
WORD bytesRead;
WORD len;
BYTE inBuffer[1024];
BOOL GO = TRUE;
DWORD threadId;
WORD totalCount = 0;
HANDLE hWriteCom;
rc = RtOpenComPort( (BYTE)COM1, 0,0,0,0 );
if( rc )
{
printf("failed to open com port. error = %d\n", rc );
exit(0);
}
printf( "Com port opened\n");
//---------------------------------------
// full duplex test
//---------------------------------------
if ( totalCount >= 585 )
{
GO = FALSE;
}
}
// printf("test program ended.....");
RtCloseComPort( COM1 );
}
int RTFCNDCL ComWrite( PVOID junk )
//--------------------------------------------
// Thread to write to COM port
//--------------------------------------------
{
WORD len;
WORD rc;
WORD bytesSent;
BYTE outbuffer[1024]={"HELLO\n"};
BOOL GO = TRUE;
printf("entering xmit thread\n");
while( GO )
{
len = strlen ( outbuffer );
printf("writing %d characters\n",len );