- Reworked the connection object and the IO system
- Reworked the support for TRICS - Added a second generation motor
This commit is contained in:
29
SCinter.c
29
SCinter.c
@ -270,10 +270,10 @@ extern char *SkipSpace(char *pPtr);
|
||||
assert(pCon);
|
||||
|
||||
/* write info to Log */
|
||||
if(pCon->pSock)
|
||||
if(pCon->sockHandle >= 0)
|
||||
{
|
||||
sprintf(pBueffel,"Executing -> %s <- from socket %d",pText,
|
||||
pCon->pSock->sockid);
|
||||
pCon->sockHandle);
|
||||
SICSLogWrite(pBueffel,eCommand);
|
||||
}
|
||||
else
|
||||
@ -282,6 +282,7 @@ extern char *SkipSpace(char *pPtr);
|
||||
SICSLogWrite(pBueffel,eCommand);
|
||||
}
|
||||
|
||||
|
||||
/* convert to argc, argv */
|
||||
argc = 0;
|
||||
argv = NULL;
|
||||
@ -315,7 +316,7 @@ extern char *SkipSpace(char *pPtr);
|
||||
|
||||
|
||||
/* invoke the command */
|
||||
self->eOut = eStatus;
|
||||
self->eOut = eValue;
|
||||
Tcl_ResetResult((Tcl_Interp *)self->pTcl);
|
||||
MacroPush(pCon);
|
||||
pCon->conStatus = 0;
|
||||
@ -324,8 +325,8 @@ extern char *SkipSpace(char *pPtr);
|
||||
StatisticsEnd(old);
|
||||
/* If a task is registered with the dev exec then conStatus is HWBusy*/
|
||||
if (pCon->conStatus != HWBusy) {
|
||||
comCon = SCGetContext(pCon);
|
||||
if (0 != strcmp("contextdo",comCon.deviceID))
|
||||
/*comCon = SCGetContext(pCon);*/
|
||||
if (0 != strcmp("contextdo",pCon->deviceID))
|
||||
SCWrite(pCon,"",eFinish);
|
||||
}
|
||||
MacroPop();
|
||||
@ -552,7 +553,7 @@ static void printAll(SicsInterp *pSics, SConnection *pCon)
|
||||
strcat(pBueffel," ");
|
||||
strcat(pBueffel,pCurrent->pName);
|
||||
strcat(pBueffel,"\r\n");
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
iNum = 0;
|
||||
pBueffel[0]='\0';
|
||||
}
|
||||
@ -563,7 +564,7 @@ static void printAll(SicsInterp *pSics, SConnection *pCon)
|
||||
if(strlen(pBueffel) > 2)
|
||||
{
|
||||
strcat(pBueffel,"\r\n");
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
@ -597,7 +598,7 @@ static void printAllTypes(SicsInterp *pSics, SConnection *pCon, int iFiltered)
|
||||
if(-1==typeListID)
|
||||
{
|
||||
strcpy(pBueffel,"ERROR: Cannot generate list of object types\r\n");
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -679,7 +680,7 @@ static void printInterface(SicsInterp *pSics, SConnection *pCon, int id)
|
||||
strcat(pBueffel," ");
|
||||
strcat(pBueffel,pCurrent->pName);
|
||||
strcat(pBueffel,"\r\n");
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
iNum = 0;
|
||||
pBueffel[0]='\0';
|
||||
}
|
||||
@ -690,7 +691,7 @@ static void printInterface(SicsInterp *pSics, SConnection *pCon, int id)
|
||||
|
||||
/* write final entries */
|
||||
strcat(pBueffel,"\r\n");
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
}
|
||||
/*-----------------------------------------------------------------------
|
||||
printMatch prints only those objects which match the wildcard string given
|
||||
@ -732,7 +733,7 @@ static void printMatch(SicsInterp *pSics, SConnection *pCon, char *mask)
|
||||
strcat(pBueffel," ");
|
||||
strcat(pBueffel,pCurrent->pName);
|
||||
strcat(pBueffel,"\r\n");
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
pBueffel[0]='\0';
|
||||
iNum = 0;
|
||||
}
|
||||
@ -743,7 +744,7 @@ static void printMatch(SicsInterp *pSics, SConnection *pCon, char *mask)
|
||||
|
||||
/* write final entries */
|
||||
strcat(pBueffel,"\r\n");
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
}
|
||||
/*-----------------------------------------------------------------------
|
||||
printType prints only those objects whose descriptor match the type given
|
||||
@ -794,7 +795,7 @@ static void printType(SicsInterp *pSics, SConnection *pCon, char *typeName)
|
||||
|
||||
/* write final entries */
|
||||
strcat(pBueffel,"\r\n");
|
||||
SCWrite(pCon,Tcl_DStringValue(&txt),eStatus);
|
||||
SCWrite(pCon,Tcl_DStringValue(&txt),eValue);
|
||||
Tcl_DStringFree(&txt);
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@ -1042,7 +1043,7 @@ static void printList(SConnection *pCon, int listID)
|
||||
if ((MAXBUF-3) > retCode) {
|
||||
retCode = LLDstringData(listID,pBueffel);
|
||||
strcat(pBueffel,"\r\n");
|
||||
SCWrite(pCon,pBueffel,eStatus);
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
}
|
||||
} while(0!=LLDnodePtr2Next(listID));
|
||||
}
|
||||
|
Reference in New Issue
Block a user