restore RemoveCallback3 as RemoveCallbackUsr to get (un)interest working again
This commit is contained in:
@ -36,9 +36,10 @@
|
||||
#include "confvirtmot.i"
|
||||
|
||||
#define BAD_VALUE (-9999.99)
|
||||
extern double DoubleTime(void);
|
||||
|
||||
extern char *stptok(char *s, char *t, int len, char *brk);
|
||||
extern int CheckMotiMatch(const void* context, const void* pUserData);
|
||||
extern double DoubleTime(void);
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
An internal data structure which holds information required to control
|
||||
@ -299,13 +300,13 @@ static int InterestCallback(int iEvent, void *pEvent, void *pUser)
|
||||
assert(pEvent);
|
||||
assert(pUser);
|
||||
|
||||
pEventData = (EventInfo *) pEvent;
|
||||
pInfo = (RegisteredInfo *) pUser;
|
||||
|
||||
if (!SCisConnected(pInfo->pCon)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
pEventData = (EventInfo *) pEvent;
|
||||
pInfo = (RegisteredInfo *) pUser;
|
||||
|
||||
if (pInfo->lastValue != pEventData->fVal) {
|
||||
pInfo->lastValue = pEventData->fVal;
|
||||
(pInfo->pCon)->conEventType = POSITION;
|
||||
@ -713,13 +714,13 @@ int ConfigurableVirtualMotorAction(SConnection * pCon, SicsInterp * pSics,
|
||||
}
|
||||
pRegInfo->lastValue = value;
|
||||
|
||||
RemoveCallbackCon(self->pCall, pCon);
|
||||
RemoveCallbackUsr(self->pCall, InterestCallback, CheckMotiMatch, pCon); /* only this one */
|
||||
lID = RegisterCallback(self->pCall, MOTDRIVE,
|
||||
InterestCallback, pRegInfo, KillInfo);
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
} else if(strcmp(argv[1],"uninterest") == 0) {
|
||||
RemoveCallbackCon(self->pCall, pCon);
|
||||
RemoveCallbackUsr(self->pCall, InterestCallback, CheckMotiMatch, pCon);
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user