support for dbCaPutCallback

This commit is contained in:
Marty Kraimer
2003-12-16 20:05:17 +00:00
parent 1758f60c79
commit fdd78eaf81
10 changed files with 46 additions and 152 deletions

View File

@@ -12,7 +12,6 @@ TOP=../../..
include $(TOP)/configure/CONFIG
DBD += devSoft.dbd
DBD += devSoftCallback.dbd
LIBSRCS += devAiSoft.c
LIBSRCS += devAiSoftRaw.c
@@ -22,6 +21,7 @@ LIBSRCS += devBiSoft.c
LIBSRCS += devBiSoftRaw.c
LIBSRCS += devBoSoft.c
LIBSRCS += devBoSoftRaw.c
LIBSRCS += devCalcoutSoft.c
LIBSRCS += devEventSoft.c
LIBSRCS += devHistogramSoft.c
LIBSRCS += devLiSoft.c
@@ -41,6 +41,7 @@ LIBSRCS += devWfSoft.c
LIBSRCS += devAoSoftCallback.c
LIBSRCS += devBoSoftCallback.c
LIBSRCS += devCalcoutSoftCallback.c
LIBSRCS += devLoSoftCallback.c
LIBSRCS += devMbboSoftCallback.c
LIBSRCS += devMbboDirectSoftCallback.c

View File

@@ -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);

View File

@@ -30,7 +30,6 @@
#include "epicsExport.h"
/* Create the dset for devBoCallbackSoft */
static long init_record();
static long write_bo();
struct {
@@ -44,31 +43,11 @@ struct {
5,
NULL,
NULL,
init_record,
NULL,
NULL,
write_bo
};
epicsExportAddress(dset,devBoSoftCallback);
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(boRecord *pbo)
{
long status=0;
/* dont convert */
status=2;
return status;
} /* end init_record() */
static long write_bo(boRecord *pbo)
{
@@ -77,10 +56,11 @@ static long write_bo(boRecord *pbo)
if(pbo->pact) return(0);
if(plink->type!=CA_LINK) {
status = dbPutLink(&pbo->out,DBR_USHORT,&pbo->val,1);
status = dbPutLink(plink,DBR_USHORT,&pbo->val,1);
return(status);
}
status = dbCaPutLinkCallback(plink,DBR_USHORT,&pbo->val,1,putCallback);
status = dbCaPutLinkCallback(plink,DBR_USHORT,&pbo->val,1,
(dbCaCallback)dbCaCallbackProcess,plink);
if(status) {
recGblSetSevr(pbo,LINK_ALARM,INVALID_ALARM);
return(status);

View File

@@ -28,7 +28,6 @@
#include "epicsExport.h"
/* Create the dset for devLoSoftCallback */
static long init_record();
static long write_longout();
struct {
long number;
@@ -41,25 +40,11 @@ struct {
5,
NULL,
NULL,
init_record,
NULL,
NULL,
write_longout
};
epicsExportAddress(dset,devLoSoftCallback);
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(longoutRecord *plongout)
{
return(0);
} /* end init_record() */
static long write_longout(longoutRecord *plongout)
{
@@ -68,10 +53,11 @@ static long write_longout(longoutRecord *plongout)
if(plongout->pact) return(0);
if(plink->type!=CA_LINK) {
status = dbPutLink(&plongout->out,DBR_LONG,&plongout->val,1);
status = dbPutLink(plink,DBR_LONG,&plongout->val,1);
return(status);
}
status = dbCaPutLinkCallback(plink,DBR_LONG,&plongout->val,1,putCallback);
status = dbCaPutLinkCallback(plink,DBR_LONG,&plongout->val,1,
(dbCaCallback)dbCaCallbackProcess,plink);
if(status) {
recGblSetSevr(plongout,LINK_ALARM,INVALID_ALARM);
return(status);

View File

@@ -27,7 +27,6 @@
#include "epicsExport.h"
/* Create the dset for devMbboSoft */
static long init_record();
static long write_mbbo();
struct {
long number;
@@ -40,30 +39,11 @@ struct {
5,
NULL,
NULL,
init_record,
NULL,
NULL,
write_mbbo
};
epicsExportAddress(dset,devMbboDirectSoftCallback);
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(mbboDirectRecord *pmbbo)
{
long status = 0;
/* dont convert */
status = 2;
return status;
} /* end init_record() */
static long write_mbbo(mbboDirectRecord *pmbbo)
{
@@ -72,10 +52,11 @@ static long write_mbbo(mbboDirectRecord *pmbbo)
if(pmbbo->pact) return(0);
if(plink->type!=CA_LINK) {
status = dbPutLink(&pmbbo->out,DBR_USHORT,&pmbbo->val,1);
status = dbPutLink(plink,DBR_USHORT,&pmbbo->val,1);
return(status);
}
status = dbCaPutLinkCallback(plink,DBR_USHORT,&pmbbo->val,1,putCallback);
status = dbCaPutLinkCallback(plink,DBR_USHORT,&pmbbo->val,1,
(dbCaCallback)dbCaCallbackProcess,plink);
if(status) {
recGblSetSevr(pmbbo,LINK_ALARM,INVALID_ALARM);
return(status);

View File

@@ -27,7 +27,6 @@
#include "epicsExport.h"
/* Create the dset for devMbboSoftCallback */
static long init_record();
static long write_mbbo();
struct {
long number;
@@ -40,31 +39,11 @@ struct {
5,
NULL,
NULL,
init_record,
NULL,
NULL,
write_mbbo
};
epicsExportAddress(dset,devMbboSoftCallback);
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(mbboRecord *pmbbo)
{
long status=0;
/*dont convert*/
status=2;
return status;
} /* end init_record() */
static long write_mbbo(mbboRecord *pmbbo)
{
@@ -73,10 +52,11 @@ static long write_mbbo(mbboRecord *pmbbo)
if(pmbbo->pact) return(0);
if(plink->type!=CA_LINK) {
status = dbPutLink(&pmbbo->out,DBR_USHORT,&pmbbo->val,1);
status = dbPutLink(plink,DBR_USHORT,&pmbbo->val,1);
return(status);
}
status = dbCaPutLinkCallback(plink,DBR_USHORT,&pmbbo->val,1,putCallback);
status = dbCaPutLinkCallback(plink,DBR_USHORT,&pmbbo->val,1,
(dbCaCallback)dbCaCallbackProcess,plink);
if(status) {
recGblSetSevr(pmbbo,LINK_ALARM,INVALID_ALARM);
return(status);

View File

@@ -27,7 +27,6 @@
#include "epicsExport.h"
/* Create the dset for devSoSoftCallback */
static long init_record();
static long write_stringout();
struct {
long number;
@@ -40,25 +39,11 @@ struct {
5,
NULL,
NULL,
init_record,
NULL,
NULL,
write_stringout
};
epicsExportAddress(dset,devSoSoftCallback);
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(stringoutRecord *pstringout)
{
return 0;
} /* end init_record() */
static long write_stringout(pstringout)
struct stringoutRecord *pstringout;
@@ -68,10 +53,11 @@ static long write_stringout(pstringout)
if(pstringout->pact) return(0);
if(plink->type!=CA_LINK) {
status = dbPutLink(&pstringout->out,DBR_STRING,&pstringout->val,1);
status = dbPutLink(plink,DBR_STRING,&pstringout->val,1);
return(status);
}
status = dbCaPutLinkCallback(plink,DBR_STRING,&pstringout->val,1,putCallback);
status = dbCaPutLinkCallback(plink,DBR_STRING,&pstringout->val,1,
(dbCaCallback)dbCaCallbackProcess,plink);
if(status) {
recGblSetSevr(pstringout,LINK_ALARM,INVALID_ALARM);
return(status);

View File

@@ -1,26 +1,34 @@
# $Id$
device(ai,CONSTANT,devAiSoft,"Soft Channel")
device(ai,CONSTANT,devAiSoftRaw,"Raw Soft Channel")
device(ao,CONSTANT,devAoSoft,"Soft Channel")
device(ao,CONSTANT,devAoSoftRaw,"Raw Soft Channel")
device(bi,CONSTANT,devBiSoft,"Soft Channel")
device(bi,CONSTANT,devBiSoftRaw,"Raw Soft Channel")
device(bo,CONSTANT,devBoSoft,"Soft Channel")
device(bo,CONSTANT,devBoSoftRaw,"Raw Soft Channel")
device(calcout,CONSTANT,devCalcoutSoft,"Soft Channel")
device(event,CONSTANT,devEventSoft,"Soft Channel")
device(longin,CONSTANT,devLiSoft,"Soft Channel")
device(longout,CONSTANT,devLoSoft,"Soft Channel")
device(mbbi,CONSTANT,devMbbiSoft,"Soft Channel")
device(mbbi,CONSTANT,devMbbiSoftRaw,"Raw Soft Channel")
device(mbbiDirect,CONSTANT,devMbbiDirectSoft,"Soft Channel")
device(mbbiDirect,CONSTANT,devMbbiDirectSoftRaw,"Raw Soft Channel")
device(mbbo,CONSTANT,devMbboSoft,"Soft Channel")
device(mbbo,CONSTANT,devMbboSoftRaw,"Raw Soft Channel")
device(mbboDirect,CONSTANT,devMbboDirectSoft,"Soft Channel")
device(mbboDirect,CONSTANT,devMbboDirectSoftRaw,"Raw Soft Channel")
device(stringin,CONSTANT,devSiSoft,"Soft Channel")
device(stringout,CONSTANT,devSoSoft,"Soft Channel")
device(subArray,CONSTANT,devSASoft,"Soft Channel")
device(waveform,CONSTANT,devWfSoft,"Soft Channel")
device(ai,CONSTANT,devAiSoftRaw,"Raw Soft Channel")
device(ao,CONSTANT,devAoSoftRaw,"Raw Soft Channel")
device(bi,CONSTANT,devBiSoftRaw,"Raw Soft Channel")
device(bo,CONSTANT,devBoSoftRaw,"Raw Soft Channel")
device(mbbi,CONSTANT,devMbbiSoftRaw,"Raw Soft Channel")
device(mbbiDirect,CONSTANT,devMbbiDirectSoftRaw,"Raw Soft Channel")
device(mbbo,CONSTANT,devMbboSoftRaw,"Raw Soft Channel")
device(mbboDirect,CONSTANT,devMbboDirectSoftRaw,"Raw Soft Channel")
device(ao,CONSTANT,devAoSoftCallback,"Async Soft Channel")
device(bo,CONSTANT,devBoSoftCallback,"Async Soft Channel")
device(calcout,CONSTANT,devCalcoutSoftCallback,"Async Soft Channel")
device(longout,CONSTANT,devLoSoftCallback,"Async Soft Channel")
device(mbbo,CONSTANT,devMbboSoftCallback,"Async Soft Channel")
device(mbboDirect,CONSTANT,devMbboDirectSoftCallback,"Async Soft Channel")
device(stringout,CONSTANT,devSoSoftCallback,"Async Soft Channel")

View File

@@ -1,9 +0,0 @@
# $Id$
device(ao,CONSTANT,devAoSoftCallback,"Soft Put Callback")
device(bo,CONSTANT,devBoSoftCallback,"Soft Put Callback")
device(longout,CONSTANT,devLoSoftCallback,"Soft Put Callback")
device(mbbo,CONSTANT,devMbboSoftCallback,"Soft Put Callback")
device(mbboDirect,CONSTANT,devMbboDirectSoftCallback,"Soft Put Callback")
device(stringout,CONSTANT,devSoSoftCallback,"Soft Put Callback")

View File

@@ -34,7 +34,7 @@ include "subRecord.dbd"
include "subArrayRecord.dbd"
include "waveformRecord.dbd"
# Soft and SoftRaw device support
# "Soft Channel", "Raw Soft Channel", and "Async Soft Channel" device support
include "devSoft.dbd"
# Access security subroutines