diff --git a/src/dev/softDev/Makefile b/src/dev/softDev/Makefile index 97280da24..8e6eb0d63 100644 --- a/src/dev/softDev/Makefile +++ b/src/dev/softDev/Makefile @@ -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 diff --git a/src/dev/softDev/devAoSoftCallback.c b/src/dev/softDev/devAoSoftCallback.c index 4df7fd4bd..7eddebb89 100644 --- a/src/dev/softDev/devAoSoftCallback.c +++ b/src/dev/softDev/devAoSoftCallback.c @@ -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); diff --git a/src/dev/softDev/devBoSoftCallback.c b/src/dev/softDev/devBoSoftCallback.c index efea0f8a3..cc4f472c6 100644 --- a/src/dev/softDev/devBoSoftCallback.c +++ b/src/dev/softDev/devBoSoftCallback.c @@ -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); diff --git a/src/dev/softDev/devLoSoftCallback.c b/src/dev/softDev/devLoSoftCallback.c index b54538735..4d37bc595 100644 --- a/src/dev/softDev/devLoSoftCallback.c +++ b/src/dev/softDev/devLoSoftCallback.c @@ -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); diff --git a/src/dev/softDev/devMbboDirectSoftCallback.c b/src/dev/softDev/devMbboDirectSoftCallback.c index baadfaa8e..3efee488a 100644 --- a/src/dev/softDev/devMbboDirectSoftCallback.c +++ b/src/dev/softDev/devMbboDirectSoftCallback.c @@ -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); diff --git a/src/dev/softDev/devMbboSoftCallback.c b/src/dev/softDev/devMbboSoftCallback.c index d6ad54f05..737b25f61 100644 --- a/src/dev/softDev/devMbboSoftCallback.c +++ b/src/dev/softDev/devMbboSoftCallback.c @@ -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); diff --git a/src/dev/softDev/devSoSoftCallback.c b/src/dev/softDev/devSoSoftCallback.c index 4b7956ea2..e51d4a924 100644 --- a/src/dev/softDev/devSoSoftCallback.c +++ b/src/dev/softDev/devSoSoftCallback.c @@ -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); diff --git a/src/dev/softDev/devSoft.dbd b/src/dev/softDev/devSoft.dbd index 5dc2f67f8..305894e7d 100644 --- a/src/dev/softDev/devSoft.dbd +++ b/src/dev/softDev/devSoft.dbd @@ -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") + diff --git a/src/dev/softDev/devSoftCallback.dbd b/src/dev/softDev/devSoftCallback.dbd deleted file mode 100644 index dfacd90ce..000000000 --- a/src/dev/softDev/devSoftCallback.dbd +++ /dev/null @@ -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") - diff --git a/src/misc/base.dbd b/src/misc/base.dbd index 41590581d..dc63cf846 100644 --- a/src/misc/base.dbd +++ b/src/misc/base.dbd @@ -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