static void queueItDelayed(CALLBACK * pvt) { devPvt *pdevPvt; asynStatus status; dbCommon *precord; asynUser *pasynUser; callbackGetUser(pdevPvt,pvt); precord = pdevPvt->precord; pasynUser = pdevPvt->pasynUser; precord = pdevPvt->precord; status = pasynManager->queueRequest(pasynUser,asynQueuePriorityMedium,0.0); if(status!=asynSuccess) { asynPrint(pdevPvt->pasynUser, ASYN_TRACE_ERROR, "%s queueRequest failed %s\n", precord->name,pasynUser->errorMessage); recGblSetSevr(precord,READ_ALARM,INVALID_ALARM); status = pasynManager->unblockProcessCallback(pasynUser,pdevPvt->blockAll); if(status!=asynSuccess) { asynPrint(pdevPvt->pasynUser, ASYN_TRACE_ERROR, "%s queueRequest failed %s\n", precord->name,pasynUser->errorMessage); } callbackRequestProcessCallback( &pdevPvt->processCallback,precord->prio,precord); } }
static void doneCallback(processNotify *ppn) { stringinRecord *prec = (stringinRecord *)ppn->usrPvt; devPvt *pdevPvt = (devPvt *)prec->dpvt; callbackRequestProcessCallback(&pdevPvt->callback, prec->prio, prec); }
static void processCallbackOutput(asynUser *pasynUser) { devInt32Pvt *pPvt = (devInt32Pvt *)pasynUser->userPvt; dbCommon *pr = pPvt->pr; pPvt->result.status = pPvt->pint32->write(pPvt->int32Pvt, pPvt->pasynUser,pPvt->result.value); if(pPvt->result.status == asynSuccess) { asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, "%s devAsynInt32 process value %d\n",pr->name,pPvt->result.value); } else { asynPrint(pasynUser, ASYN_TRACE_ERROR, "%s devAsynInt32 process error %s\n", pr->name, pasynUser->errorMessage); } if(pr->pact) callbackRequestProcessCallback(&pPvt->callback,pr->prio,pr); }
static void processCallbackInput(asynUser *pasynUser) { devPvt *pPvt = (devPvt *)pasynUser->userPvt; dbCommon *pr = (dbCommon *)pPvt->pr; pPvt->result.status = pPvt->pfloat64->read(pPvt->float64Pvt, pPvt->pasynUser, &pPvt->result.value); pPvt->result.time = pPvt->pasynUser->timestamp; if (pPvt->result.status == asynSuccess) { asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, "%s devAsynFloat64 process value=%f\n",pr->name,pPvt->result.value); } else { asynPrint(pasynUser, ASYN_TRACE_ERROR, "%s devAsynFloat64 process read error %s\n", pr->name, pasynUser->errorMessage); } if(pr->pact) callbackRequestProcessCallback(&pPvt->callback,pr->prio,pr); }
static void processCallback(asynUser *pasynUser) { devBusyPvt *pPvt = (devBusyPvt *)pasynUser->userPvt; busyRecord *pr = pPvt->pr; int status=asynSuccess; status = pPvt->pint32->write(pPvt->int32Pvt, pPvt->pasynUser,pPvt->value); if(status == asynSuccess) { asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, "%s devAsynBusy process value %d\n",pr->name,pPvt->value); } else { asynPrint(pasynUser, ASYN_TRACE_ERROR, "%s devAsynBusy process error %s\n", pr->name, pasynUser->errorMessage); recGblSetSevr(pr, WRITE_ALARM, INVALID_ALARM); } if(pr->pact) callbackRequestProcessCallback(&pPvt->callback,pr->prio,pr); }
static void processCallbackOutput(asynUser *pasynUser) { devPvt *pPvt = (devPvt *)pasynUser->userPvt; dbCommon *pr = pPvt->pr; pPvt->result.status = pPvt->pfloat64->write(pPvt->float64Pvt, pPvt->pasynUser,pPvt->result.value); pPvt->result.time = pPvt->pasynUser->timestamp; pPvt->result.alarmStatus = pPvt->pasynUser->alarmStatus; pPvt->result.alarmSeverity = pPvt->pasynUser->alarmSeverity; if(pPvt->result.status == asynSuccess) { asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, "%s devAsynFloat64 process val %f\n",pr->name,pPvt->result.value); } else { asynPrint(pasynUser, ASYN_TRACE_ERROR, "%s devAsynFloat64 pPvt->result.status=%d, process error %s\n", pr->name, pPvt->result.status, pasynUser->errorMessage); } if(pr->pact) callbackRequestProcessCallback(&pPvt->callback,pr->prio,pr); }
static void processCallbackInput(asynUser *pasynUser) { devInt32Pvt *pPvt = (devInt32Pvt *)pasynUser->userPvt; dbCommon *pr = (dbCommon *)pPvt->pr; int status=asynSuccess; status = pPvt->pint32->read(pPvt->int32Pvt, pPvt->pasynUser, &pPvt->value); if (pPvt->bipolar && (pPvt->value & pPvt->signBit)) pPvt->value |= ~pPvt->mask; if (status == asynSuccess) { asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, "%s devAsynInt32 process value=%d\n",pr->name,pPvt->value); } else { asynPrint(pasynUser, ASYN_TRACE_ERROR, "%s devAsynInt32 process read error %s\n", pr->name, pasynUser->errorMessage); recGblSetSevr(pr, READ_ALARM, INVALID_ALARM); } if(pr->pact) callbackRequestProcessCallback(&pPvt->callback,pr->prio,pr); }
static void processCallbackInput(asynUser *pasynUser) { devPvt *pPvt = (devPvt *)pasynUser->userPvt; dbCommon *pr = (dbCommon *)pPvt->pr; static const char *functionName="processCallbackInput"; pPvt->result.status = pPvt->pfloat64->read(pPvt->float64Pvt, pPvt->pasynUser, &pPvt->result.value); pPvt->result.time = pPvt->pasynUser->timestamp; pPvt->result.alarmStatus = pPvt->pasynUser->alarmStatus; pPvt->result.alarmSeverity = pPvt->pasynUser->alarmSeverity; if (pPvt->result.status == asynSuccess) { asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, "%s %s::%s process value=%f\n",pr->name, driverName, functionName,pPvt->result.value); } else { asynPrint(pasynUser, ASYN_TRACE_ERROR, "%s %s::%s process read error %s\n", pr->name, driverName, functionName,pasynUser->errorMessage); } if(pr->pact) callbackRequestProcessCallback(&pPvt->processCallback,pr->prio,pr); }
static void processCallbackInput(asynUser *pasynUser) { devInt32Pvt *pPvt = (devInt32Pvt *)pasynUser->userPvt; dbCommon *pr = (dbCommon *)pPvt->pr; pPvt->result.status = pPvt->pint32->read(pPvt->int32Pvt, pPvt->pasynUser, &pPvt->result.value); pPvt->result.time = pPvt->pasynUser->timestamp; if (pPvt->mask) { pPvt->result.value &= pPvt->mask; if (pPvt->bipolar && (pPvt->result.value & pPvt->signBit)) pPvt->result.value |= ~pPvt->mask; } if (pPvt->result.status == asynSuccess) { asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, "%s devAsynInt32 process value=%d\n",pr->name,pPvt->result.value); } else { asynPrint(pasynUser, ASYN_TRACE_ERROR, "%s devAsynInt32 process read error %s\n", pr->name, pasynUser->errorMessage); } if(pr->pact) callbackRequestProcessCallback(&pPvt->callback,pr->prio,pr); }
static void callbackSiWriteRead(asynUser *pasynUser) { devPvt *pdevPvt = (devPvt *)pasynUser->userPvt; stringinRecord *precord = (stringinRecord *)pdevPvt->precord; asynStatus status; size_t nBytesRead; long dbStatus; char raw[MAX_STRING_SIZE]; char translate[MAX_STRING_SIZE]; size_t len = sizeof(precord->val); status = pasynManager->unblockProcessCallback(pasynUser,pdevPvt->blockAll); if(status!=asynSuccess) { asynPrint(pasynUser,ASYN_TRACE_ERROR, "%s pasynManager:unblockProcessCallback failed %s\n", precord->name,pasynUser->errorMessage); recGblSetSevr(precord,READ_ALARM,INVALID_ALARM); goto done; } switch(pdevPvt->state) { case stateIdle: dbStatus = dbGet(&pdevPvt->dbAddr,DBR_STRING,raw,0,0,0); if(dbStatus) { asynPrint(pasynUser,ASYN_TRACE_ERROR, "%s dbGet failed\n",precord->name); recGblSetSevr(precord,READ_ALARM,INVALID_ALARM); goto done; } dbTranslateEscape(translate,raw); status = writeIt(pasynUser,translate,strlen(translate)); if(status!=asynSuccess) { asynPrint(pasynUser,ASYN_TRACE_ERROR, "%s asynOctet:write failed %s\n", precord->name,pasynUser->errorMessage); recGblSetSevr(precord,READ_ALARM,INVALID_ALARM); goto done; } pdevPvt->state = stateWrite; status = queueIt(pdevPvt); if(status!=asynSuccess) goto done; return; case stateWrite: status = readIt(pasynUser,precord->val,len,&nBytesRead); if(status!=asynSuccess) { asynPrint(pasynUser,ASYN_TRACE_ERROR, "%s asynOctet:write failed %s\n", precord->name,pasynUser->errorMessage); recGblSetSevr(precord,READ_ALARM,INVALID_ALARM); goto done; } if(status==asynSuccess) { if(nBytesRead==len) nBytesRead--; precord->val[nBytesRead] = 0; } pdevPvt->state = stateIdle; break; /*all done*/ } done: pdevPvt->state = stateIdle; callbackRequestProcessCallback( &pdevPvt->processCallback,precord->prio,precord); }