const char *name;
} nullcheck[]={
{&phone,"destination phone number"},
-#if 0
{&logoname,"logo filename"},
+#if 0
{&gsmnet,"GSM operator network code"},
{&device,"device for communication"},
#endif
s=devcmd(NULL,"\n+CSCA:","\r\nAT+CSCA?");
while (isspace(*s)) s++;
if (!*s || !strcmp(s,"EMPTY"))
- error("!No SMS set in Nokia found");
+ error("!No SMS set in Nokia found, please use option \"-s\"");
if (verbose>=1) error("\nFound default SMSC in Nokia: %s",s);
if (*s!='"') error("!No left-quote found in: %s",s);
if (!(t=strrchr(s+1,'"'))) error("!No right-quote found in: %s",s);
+ if (s+1==t)
+ error("!No SMS set in Nokia found, please use option \"-s\"");
e=t++;
while (isspace(*t)) t++;
if (*t++!=',') error("!No comma found after quotes in: %s",s);
logoname,WORD(4));
}
else error("!Unknown file format of logo file \"%s\"",logoname);
- if (!strcasecmp(gsmnet,WORD_NET)) {
+ if (gsmnet && !strcasecmp(gsmnet,WORD_NET)) {
if (!*gsmnetf) error("!NOL network code detection requested but NOL file not loaded, please specify network code");
gsmnet=gsmnetf;
}
- if (!strcasecmp(gsmnet,WORD_GROUP) || !*gsmnet) {
+ if (!gsmnet || !strcasecmp(gsmnet,WORD_GROUP) || !*gsmnet) {
error("\nSending logo as: group graphics");
gsmnet=NULL;
}
error("^!Unable to set initial termios device settings");
setalarm();
- do {
- devcmd("",NULL,"\r\nAT\033");
- devcmd(NULL,NULL,"\r\nAT");
- smscset();
- devcmd(NULL,NULL,"\r\nAT+CSMP=81,,0,245");
- devcmd("\n> ",NULL,"\r\nAT+CMGS=\"%s\"",phone);
- if (!(s=devcmd(NULL,"\n+CMGS:","!%s\032",hexdata))) {
- retrying();
- continue;
- }
- devcmd(NULL,NULL,"\r\nAT+CSMP=17,,0,0");
- devcmd(NULL,NULL,"\r\nAT");
- } while (0);
+
+retryall:
+ devcmd("",NULL,"\r\nAT\033");
+ devcmd(NULL,NULL,"\r\nAT");
+
+ smscset();
+ devcmd(NULL,NULL,"\r\nAT+CSMP=81,,0,245");
+ devcmd("\n> ",NULL,"\r\nAT+CMGS=\"%s\"",phone);
+ if (!(s=devcmd(NULL,"\n+CMGS:","!%s\032",hexdata))) {
+ retrying();
+ goto retryall;
+ }
+ devcmd(NULL,NULL,"\r\nAT+CSMP=17,,0,0");
+ devcmd(NULL,NULL,"\r\nAT");
+
while (isspace(*s)) s++;
if (verbose>=1) error("\nMessage successfuly sent with MR: %s",s);
devcmd(NULL,NULL,"\r\nAT");