improved tecs driver M.Z.

This commit is contained in:
cvs
2004-03-09 15:18:01 +00:00
parent 7422a261ea
commit 55848218a4
23 changed files with 1372 additions and 713 deletions

View File

@@ -161,6 +161,7 @@ char *SerCmd(SerChannel *serch, char *cmnd) {
AsynSrvChan *aser;
TermSrvChan *tser;
char *result, *pos, *trm;
char junk[256];
int iret, incomplete;
l=strlen(cmnd);
@@ -181,6 +182,18 @@ char *SerCmd(SerChannel *serch, char *cmnd) {
if (result==NULL) ERR_MSG("empty result");
} else if (serch->type==TERMSRV_TYPE) {
tser=(TermSrvChan *)serch;
ERR_I(iret=SerWait(0, tser->fd));
while (iret>0) { /* skip contents in type-ahead buffer */
ERR_SI(l=recv(tser->fd, junk, sizeof(junk)-1, 0));
if (l==0) {
ErrMsg("disconnected");
SerClose(serch);
goto OnError;
}
junk[l]='\0';
logfileOut(LOG_MAIN, "skipped: '%s'\n", junk);
ERR_I(iret=SerWait(0, tser->fd));
}
iret=send(tser->fd, cmnd, l, 0);
if (iret<0) {
ErrMsg("disconnected");