X-Git-Url: https://git.jankratochvil.net/?p=mdsms.git;a=blobdiff_plain;f=mdsms.c;h=68917a50ba728488ccb21827e6a9d03e1b70ca2b;hp=48eb8f5df8b523d6260d23d1ee7b5ed339c4b147;hb=3b73c0669dc0a5f327e8bf10971f898f1bca0f9f;hpb=25f8b04f0bb7af6a2bb1b73d50762de53b87663c diff --git a/mdsms.c b/mdsms.c index 48eb8f5..68917a5 100644 --- a/mdsms.c +++ b/mdsms.c @@ -5,6 +5,12 @@ static char rcsid[] ATTR_UNUSED = "$Id$"; /* * $Log$ + * Revision 1.5 1999/07/19 10:02:51 short + * Removed '\xXY' chars for compatibility with Digital UNIX vendor "cc". + * + * Revision 1.4 1999/07/14 01:01:11 short + * Termios made compatible with Digital UNIX 4.0, cfset[io]speed() missing. + * * Revision 1.3 1999/06/03 11:46:41 short * Logging (--log) implemented. * @@ -84,7 +90,7 @@ static size_t bodylen; static char *devicename; /* path stripped */ static char lockreal[512],locked; -static struct termios restios; +static struct termios restios,tios; static char restios_yes; static FILE *logf; @@ -787,7 +793,6 @@ char *s,*finame; FILE *fin; int i; unsigned fatal=0; -struct termios tios; if ((s=strrchr((pname=*argv),'/'))) pname=s+1; atexit(cleanup); @@ -902,19 +907,22 @@ time_t start,end; memset(tios.c_cc,_POSIX_VDISABLE,sizeof(tios.c_cc)); tios.c_cc[VTIME]=0; tios.c_cc[VMIN ]=1; + cfsetispeed(&tios,B19200); + if (cfsetospeed(&tios,B19200)|cfsetispeed(&tios,B19200)) + error("Error setting termios baudrate on device: %m"); if (tcflush(devfd,TCIOFLUSH)) error("Error flushing termios (TCIOFLUSH) on device: %m"); if (tcsetattr(devfd,TCSANOW,&tios)) - error("!Unable to set initial termios device settings"); + error("!Unable to set initial termios device settings: %m"); signal(SIGALRM,(RETSIGTYPE (*)(int))sigalarm); do { - devcmd("",NULL,"\r\nAT\x1A"); + devcmd("",NULL,"\r\nAT\032"); devcmd(NULL,NULL,"\r\nAT"); smscset(); devcmd(NULL,NULL,"\r\nAT+CMGF=0"); devcmd("\n> ",NULL,"\r\nAT+CMGS=%d",(strlen(pdusmsc)+strlen(pdudata))/2); - if (!(s=devcmd(NULL,"\n+CMGS:","!%s%s\x1A",pdusmsc,pdudata))) retrying(); + if (!(s=devcmd(NULL,"\n+CMGS:","!%s%s\032",pdusmsc,pdudata))) retrying(); } while (!s); while (isspace(*s)) s++; if (verbose>=1) error("\nMessage successfuly sent with MR: %s",s);