support for dbCaPutCallback
This commit is contained in:
@@ -23,14 +23,12 @@
|
||||
#include "recGbl.h"
|
||||
#include "recSup.h"
|
||||
#include "devSup.h"
|
||||
#include "dbCa.h"
|
||||
#include "link.h"
|
||||
#include "special.h"
|
||||
#include "aoRecord.h"
|
||||
#include "epicsExport.h"
|
||||
|
||||
/* added for Channel Access Links */
|
||||
static long init_record();
|
||||
|
||||
/* Create the dset for devAoSoftCallback */
|
||||
static long write_ao();
|
||||
struct {
|
||||
@@ -45,29 +43,11 @@ struct {
|
||||
6,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
NULL,
|
||||
NULL,
|
||||
write_ao,
|
||||
NULL};
|
||||
epicsExportAddress(dset,devAoSoftCallback);
|
||||
|
||||
static void putCallback(struct link *plink)
|
||||
{
|
||||
dbCommon *pdbCommon = (dbCommon *)plink->value.pv_link.precord;
|
||||
|
||||
dbScanLock(pdbCommon);
|
||||
(*pdbCommon->rset->process)(pdbCommon);
|
||||
dbScanUnlock(pdbCommon);
|
||||
}
|
||||
|
||||
static long init_record(aoRecord *pao)
|
||||
{
|
||||
|
||||
long status=0;
|
||||
status = 2;
|
||||
return status;
|
||||
|
||||
} /* end init_record() */
|
||||
|
||||
static long write_ao(aoRecord *pao)
|
||||
{
|
||||
@@ -76,10 +56,11 @@ static long write_ao(aoRecord *pao)
|
||||
|
||||
if(pao->pact) return(0);
|
||||
if(plink->type!=CA_LINK) {
|
||||
status = dbPutLink(&pao->out,DBR_DOUBLE,&pao->oval,1);
|
||||
status = dbPutLink(plink,DBR_DOUBLE,&pao->oval,1);
|
||||
return(status);
|
||||
}
|
||||
status = dbCaPutLinkCallback(plink,DBR_DOUBLE,&pao->oval,1,putCallback);
|
||||
status = dbCaPutLinkCallback(plink,DBR_DOUBLE,&pao->oval,1,
|
||||
(dbCaCallback)dbCaCallbackProcess,plink);
|
||||
if(status) {
|
||||
recGblSetSevr(pao,LINK_ALARM,INVALID_ALARM);
|
||||
return(status);
|
||||
|
||||
Reference in New Issue
Block a user