- bug fixes and improvements

This commit is contained in:
zolliker
2011-03-25 14:28:45 +00:00
parent ccae9f0d16
commit 1384d9034a
12 changed files with 366 additions and 242 deletions

View File

@@ -49,7 +49,7 @@ char *LscCmd(SerChannel *ser, const char *cmds) {
char cmd[SER_BUF_LEN];
char varname[32];
DeclStrBuf(sbuf, SER_BUF_LEN);
int nres, i, response;
int nres, i, response, try;
nres=0;
response=0;
@@ -111,8 +111,18 @@ char *LscCmd(SerChannel *ser, const char *cmds) {
} else {
sbuf.buf[sbuf.wrpos-1]='\0'; /* strip off trailing ";" */
}
ERR_P(res=SerCmd(ser, sbuf.buf));
if (0==strncmp("?TMO", res, 4)) ERR_MSG("timeout");
try = 3;
while (1) {
ERR_P(res=SerCmd(ser, sbuf.buf));
if (0!=strncmp("?TMO", res, 4)) {
break;
}
try--;
if (try <= 0) {
ERR_MSG("timeout");
}
}
/*
list[0..nres-1] contains a now:
for a command with return request: