/*** MODEM_IO.C ***/ #include #include #include "pcl4c.h" #include "ascii.h" #include "term.cfg" #include "modem_io.h" #define FALSE 0 #define TRUE !FALSE #define ONE_SECOND 18 /* NOTE: Requires AT COMMAND SET for all functions in this file */ #if AT_COMMAND_SET #include #include #include "term_io.h" int BreakTest(void); /*** send string to modem & get echo ***/ int SendTo( int Port, /* port to talk to */ char *String) /* string to send to modem */ {int i; char c; int Code; SioRxFlush(Port); SioDelay(ONE_SECOND/4); for(i=0;i0) SioCrtWrite((char)Code); } return(TRUE); } /* end SendTo */ void SayChar(char TheChar) {if((TheChar>=' ')&&(TheChar<='~')) printf("'%c'",TheChar); else printf("%xH",TheChar); } int GetModemChar(int Port, int Tics) {int Code; /* get next char not a CR or LF */ while(1) {Code = GetChar(Port,Tics); if((Code>=0)&&((char)Code!=CR)&&((char)Code!=LF)) break; } return Code; } /*** wait for incoming string from modem ***/ int WaitFor( int Port, /* Port to talk to */ char *String, /* string to wait for */ int WaitTics) /* wait for 1st char */ {int i, k; char c; int Code; /* wait for string */ SioCrtWrite(CR); SioCrtWrite(LF); for(i=0;i