- More debugging of scriptcontext, mostly working now
- Created driveable SICSobj for standalone and as an adapter
This commit is contained in:
9
devser.c
9
devser.c
@ -74,6 +74,7 @@ DevAction *DevNextAction(DevSer *devser) {
|
||||
double now;
|
||||
SchedHeader *header;
|
||||
|
||||
|
||||
devser->current = NULL;
|
||||
if (devser->actions) {
|
||||
prio = devser->actions->prio;
|
||||
@ -125,6 +126,7 @@ int DevQueueTask(void *ds) {
|
||||
if (action == NULL) {
|
||||
action = DevNextAction(devser);
|
||||
}
|
||||
|
||||
while (action != NULL) {
|
||||
status = AsconTask(devser->asyncConn);
|
||||
if (status == AsconFailure) {
|
||||
@ -226,7 +228,7 @@ void DevQueue(DevSer *devser, void *actionData, DevPrio prio,
|
||||
ptr2Last = &devser->actions;
|
||||
for (action = devser->actions; action != NULL && action->prio >= prio; action = action->next) {
|
||||
if (action->hdl == hdl && matchFunc(actionData, action->data)) {
|
||||
return; /* there is already an identic action */
|
||||
return; /* there is already an identical action */
|
||||
}
|
||||
ptr2Last = &action->next;
|
||||
}
|
||||
@ -241,7 +243,7 @@ int DevUnschedule(DevSer *devser, void *actionData,
|
||||
DevAction **ptr2Last = NULL;
|
||||
DevAction *action = NULL;
|
||||
int cnt=0;
|
||||
|
||||
|
||||
/* scan through all headers */
|
||||
for (header = devser->headers; header != NULL; header = header->next) {
|
||||
ptr2Last = &header->actions;
|
||||
@ -279,7 +281,7 @@ int DevSchedule(DevSer *devser, void *actionData,
|
||||
DevAction **ptr2Last = NULL;
|
||||
DevAction *newAction;
|
||||
int ret;
|
||||
|
||||
|
||||
if (prio <= NullPRIO) prio = NullPRIO + 1;
|
||||
if (prio >= NumberOfPRIO) prio = NumberOfPRIO - 1;
|
||||
ret = DevUnschedule(devser, actionData, hdl, matchFunc);
|
||||
@ -330,6 +332,7 @@ int DevRemoveAction(DevSer *devser, void *actionData) {
|
||||
DevAction *action = NULL;
|
||||
int cnt=0;
|
||||
|
||||
|
||||
/* Remove current action, if matched. If a reply is pending, the next action will
|
||||
get the reply. But as in the inital state no reply is expected, this should not harm. */
|
||||
action = devser->current;
|
||||
|
Reference in New Issue
Block a user