- Added a protocol driver for the munich sputter machine
- Added a multicountsersec to teplace hmcontrol and multicounter - Fixed a case sensitivity bug in haddcheck - Made oscillate work with second generation motors for POLDI - Added a time stamper to trace. Now there will be time stamps in trace files which allow to correlate things from the master log with the trace. - Updated polterwrite. - Updated testprot to work with the behave test SKIPPED: psi/make_gen psi/polterwrite.c psi/psi.c psi/sputterprot.c
This commit is contained in:
49
conman.c
49
conman.c
@ -1543,6 +1543,55 @@ int SCPrompt(SConnection * pCon, char *pPrompt, char *pResult, int iLen)
|
||||
CostaLock(master->pStack);
|
||||
return 0;
|
||||
}
|
||||
/*----------------------------------------------------------------------------*/
|
||||
int SCPromptTMO(SConnection * pCon, char *pPrompt, char *pResult, int iLen, int timeout)
|
||||
{
|
||||
|
||||
int iRet, i;
|
||||
char *pPtr = NULL;
|
||||
char pFrom[50];
|
||||
Status eOld;
|
||||
int oldMode;
|
||||
SConnection *master = NULL;
|
||||
|
||||
if (!VerifyConnection(pCon)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
SCWrite(pCon, pPrompt, eWarning);
|
||||
master = SCfindMaster(pCon);
|
||||
eOld = GetStatus();
|
||||
SetStatus(eInput);
|
||||
CostaUnlock(master->pStack);
|
||||
for(i = 0; i < timeout; i++) {
|
||||
/*
|
||||
wait a second. We want to wait even in a simulation, otherwise
|
||||
we go into an endless loop. This is why there is the hack with
|
||||
oldMode and pServ->simMode.
|
||||
*/
|
||||
oldMode = pServ->simMode;
|
||||
pServ->simMode = 0;
|
||||
SicsWait(1);
|
||||
pServ->simMode = oldMode;
|
||||
|
||||
/* is there an interrupt pending ? */
|
||||
if (SCGetInterrupt(pCon) != eContinue) {
|
||||
break;
|
||||
}
|
||||
/* do we have data ? */
|
||||
iRet = CostaPop(master->pStack, &pPtr);
|
||||
if (iRet == 1) {
|
||||
SetStatus(eOld);
|
||||
CostaLock(master->pStack);
|
||||
strlcpy(pResult, pPtr, iLen);
|
||||
WriteToCommandLogId(" prompted>", pCon->sockHandle, pPtr);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
SetStatus(eOld);
|
||||
CostaLock(master->pStack);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int SCGetRights(SConnection * self)
|
||||
|
Reference in New Issue
Block a user