- Reworked the connection object and the IO system

- Reworked the support for TRICS
- Added a second generation motor
This commit is contained in:
koennecke
2009-02-03 08:05:39 +00:00
parent f6d595665e
commit 361ee9ebea
119 changed files with 16455 additions and 3674 deletions

20
danu.c
View File

@ -95,14 +95,19 @@ static int writeDataNumber(pDataNumber self, int iNum)
return 1;
}
/*------------------- The CallBack function for interest ------------------*/
static int InterestCallback(int iEvent, void *pEvent, void *pUser,
commandContext cc)
static int InterestCallback(int iEvent, void *pEvent, void *pUser)
{
pDataNumber self = NULL;
SConnection *pCon = NULL;
char pBueffel[132];
int iNum;
pCon = (SConnection *)pUser;
if(pCon == NULL || !SCisConnected(pCon))
{
return -1;
}
if(iEvent != VALUECHANGE)
{
return 1;
@ -111,7 +116,6 @@ static int writeDataNumber(pDataNumber self, int iNum)
assert(pEvent);
assert(pUser);
pCon = (SConnection *)pUser;
self = (pDataNumber)pEvent;
/*
@ -121,7 +125,7 @@ static int writeDataNumber(pDataNumber self, int iNum)
if(iNum > 0)
{
snprintf(pBueffel,131,"sicsdatanumber = %d", iNum);
SCWriteInContext(pCon,pBueffel,eValue,cc);
SCWrite(pCon,pBueffel,eValue);
}
return 1;
}
@ -331,16 +335,16 @@ int NewThousand(pDataNumber self)
}
if(strcmp(argv[1],"interest") == 0)
{
lID = RegisterCallback(self->pCall, SCGetContext(pCon),
lID = RegisterCallback(self->pCall,
VALUECHANGE, InterestCallback,
pCon, NULL);
SCRegister(pCon,pSics, self->pCall,lID);
SCCopyConnection(pCon),
SCDeleteConnection);
SCSendOK(pCon);
return 1;
}
if(strcmp(argv[1],"uninterest") == 0)
{
RemoveCallback2(self->pCall,pCon);
RemoveCallbackCon(self->pCall,pCon);
SCSendOK(pCon);
}