Specifications

Appendix A Register Structure and Format
79
*/
if (cmd[i] == 0x0d)
flag=0
i++;
}
/* Receive data on Port 2 (COM2) */
i=0;
flag=1;
timeout=TIME_OUT;
whole (flag)
{
rec[i]=inportb(base1); /* Receive data*/
if (rec[i] == 0x0d)
{
rec[i=1]='\0';
flag=0;
printf("\nReceived data: %s\n", rec);
}
i++;
}
else
{ /I Check timeout */
timeout-;
if(timeout == 0)
{
flag=0;
print("\nTimeout error\n");
}
}
} /* End of receive data while() */
printf("\nEnter string (max 15 char) or Q to
quit:");
gets(cmd);
} /*End of "Enter string"while() */
} /*End of main() */