diff --git a/src/db/dbAccess.c b/src/db/dbAccess.c index 42e25908b..9b5ef0d36 100644 --- a/src/db/dbAccess.c +++ b/src/db/dbAccess.c @@ -453,6 +453,21 @@ int dbIsLinkConnected(struct link *plink) } return(FALSE); } + +int dbGetLinkDBFtype(struct link *plink) +{ + switch(plink->type) { + case DB_LINK: + { + DBADDR *paddr = (DBADDR *)plink->value.pv_link.pvt; + + return((int)paddr->field_type); + } + case CA_LINK: return(dbCaGetLinkDBFtype(plink)); + default: break; + } + return(-1); +} /* * Process a record if its scan field is passive. diff --git a/src/db/dbAccess.h b/src/db/dbAccess.h index d7e941401..5e69cc23f 100644 --- a/src/db/dbAccess.h +++ b/src/db/dbAccess.h @@ -226,6 +226,7 @@ int dbIsValueField(struct dbFldDes *pdbFldDes); int dbGetFieldIndex(struct dbAddr *paddr); long dbGetNelements(struct link *plink,long *nelements); int dbIsLinkConnected(struct link *plink); +int dbGetLinkDBFtype(struct link *plink); long dbScanLink(struct dbCommon *pfrom, struct dbCommon *pto); long dbScanPassive(struct dbCommon *pfrom,struct dbCommon *pto); void dbScanFwdLink(struct link *plink); @@ -266,6 +267,7 @@ long dbCaGetPrecision(struct link *plink,short *precision); long dbCaGetSevr(struct link *plink,short *severity); long dbCaGetUnits(struct link *plink,char *units,int unitsSize); int dbCaIsLinkConnected(struct link *plink); +int dbCaGetLinkDBFtype(struct link *plink); #else struct rset *dbGetRset(); diff --git a/src/db/dbCa.c b/src/db/dbCa.c index 790ee7220..2635e80ea 100644 --- a/src/db/dbCa.c +++ b/src/db/dbCa.c @@ -405,6 +405,20 @@ int dbCaIsLinkConnected(struct link *plink) if(ca_state(pca->chid)==cs_conn) return(TRUE); return(FALSE); } +int dbCaGetLinkDBFtype(struct link *plink) +{ + caLink *pca; + + if(!plink) return(-1); + if(plink->type != CA_LINK) return(-1); + pca = (caLink *)plink->value.pv_link.pvt; + if(!pca) return(-1); + if(!pca->chid) return(-1); + if(ca_state(pca->chid)==cs_conn) + return(dbDBRoldToDBFnew[ca_field_type(pca->chid)]); + return(-1); +} + static void eventCallback(struct event_handler_args arg) { diff --git a/src/db/dbNotify.c b/src/db/dbNotify.c index 0007b85e6..dd30653b4 100644 --- a/src/db/dbNotify.c +++ b/src/db/dbNotify.c @@ -124,9 +124,24 @@ static void waitAdd(struct dbCommon *precord,PUTNOTIFY *ppn) long dbPutNotify(PUTNOTIFY *ppn) { - long status; - struct dbCommon *precord = ppn->paddr->precord; + long status; + DBADDR *paddr = ppn->paddr; + dbCommon *precord = (dbCommon *)paddr->precord; + short dbfType = paddr->field_type; + if(dbfType>=DBF_INLINK && dbfType<=DBF_FWDLINK) { + /*Initialize everything in PUTNOTIFY except restart list and node*/ + callbackSetCallback(notifyCallback,&ppn->callback); + callbackSetUser(ppn,&ppn->callback); + callbackSetPriority(priorityLow,&ppn->callback); + ppn->status = 0; + ppn->restart = FALSE; + ppn->callbackState = callbackNotActive; + status=dbPutField(paddr,ppn->dbrType,ppn->pbuffer,ppn->nRequest); + ppn->status = status; + issueCallback(ppn); + return(S_db_Pending); + } dbScanLock(precord); ellInit(&ppn->restartList); memset(&ppn->restartNode,'\0',sizeof(PNRESTARTNODE)); diff --git a/src/db/dbScan.c b/src/db/dbScan.c index 927627578..a220e4e19 100644 --- a/src/db/dbScan.c +++ b/src/db/dbScan.c @@ -53,6 +53,7 @@ #include #include #include +#include #include "dbDefs.h" #include "epicsPrint.h" @@ -311,7 +312,7 @@ void scanDelete(struct dbCommon *precord) return; } -int scanppl() /*print periodic list*/ +int scanppl(double rate) /*print periodic list*/ { scan_list *psl; char message[80]; @@ -323,19 +324,22 @@ int scanppl() /*print periodic list*/ if(psl==NULL) continue; period = psl->ticks; period /= vxTicksPerSecond; + if(rate>0.0 && (fabs(rate - period) >.05)) continue; sprintf(message,"Scan Period= %f seconds ",period); printList(psl,message); } return(0); } -int scanpel() /*print event list */ +int scanpel(int event_number) /*print event list */ { char message[80]; int priority,evnt; event_scan_list *pevent_scan_list; for(evnt=0; evntevent_number) break; for(priority=0; priority