From 684fc27f6389f44102b5a3b31f62badc35a9a9ce Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Wed, 1 Apr 2015 20:32:27 -0400 Subject: as of 2013-12-04 --- comdrtst.c | 125 ------------------------------------------------------------- 1 file changed, 125 deletions(-) delete mode 100644 comdrtst.c (limited to 'comdrtst.c') diff --git a/comdrtst.c b/comdrtst.c deleted file mode 100644 index e5fd8c6..0000000 --- a/comdrtst.c +++ /dev/null @@ -1,125 +0,0 @@ -/*********************************************************************** -* -* Name: comdrtst -* -* Purpose: Test program for comdrive read and write -* -* Algorithm: Tests both comdrive for both input (com_read) -* and output (com_write) -* -***************************************************************************/ - -#include -#include - -extern int com_read(char far *buff, int far *len); -extern int com_write(char far *buff, int far *len); - - -int main() -{ - int e_flag; - int tmp; - int rc; - char buffer[100]; - char prompt[20]; - - int length; - - rc = com_open(&e_flag,1200); - - /* if bad return code, display value and exit */ - if (rc != 0) - { - printf("\nrc(com_open) = %d",rc); - exit(); - } - - strcpy(buffer,""); - while (strcmp(buffer,"quit") != 0) - { - /* command prompt on com port */ - length = 16; - e_flag = 0; - rc = com_write("\015\012Enter string: ",&length); - - /* if bad return code, display value and exit */ - if (rc != 0) - { - printf("\nrc(com_write) = %x",rc); - exit(); - } - - /* loop until write complete */ - while (e_flag == 0) - printf("wait for write\n"); - - /* read string */ - length = 30; - e_flag = 0; - rc = com_read(buffer,&length); - - /* if bad return code, display value and exit */ - - if (rc != 0) - { - printf("\nrc(com_read) = %x",rc); - exit(); - } - - /* loop until read is done */ - while (e_flag == 0) - printf("wait - reading\n"); - - - - /* display string entered */ - e_flag = 0; - tmp = 22; - rc = com_write("\015\012string entered was: ",&tmp); - - /* if bad return code, display value and exit */ - if (rc != 0) - { - printf("\nrc(com_write) = %x",rc); - exit(); - } - - /* loop until write is done */ - while (e_flag == 0) - printf("wait for string to be written\n"); - - - e_flag = 0; - rc = com_write(buffer,&length); - - /* if bad return code, display value and exit */ - if (rc != 0) - { - printf("\nrc(com_write) = %x",rc); - } - /* loop until write is done */ - while (e_flag == 0); -} - - length = 29; - e_flag = 0; - rc = com_write ("\015\012Com Driver Test Completed\015\012",&length); - - /* if bad return code, display value and exit */ - if (rc != 0) - { - printf("\nrc(com_write) = %x",rc); - } - - /* loop until last write is done */ - while (e_flag == 0); - - com_close(); - return 0; - } - -int IO_complete(int device, int *stkptr) -{ - return 0; -} -- cgit v1.2.3