diff --git a/src/as/asCa.c b/src/as/asCa.c index 96bd961f3..e94357dc6 100644 --- a/src/as/asCa.c +++ b/src/as/asCa.c @@ -52,6 +52,19 @@ typedef struct { chid chid; } CAPVT; +static void exceptionCallback(struct exception_handler_args args) +{ + chid chid = args.chid; + long stat = args.stat; /* Channel access status code*/ + const char *channel; + static char *noname = "unknown"; + + channel = (chid ? ca_name(chid) : noname); + + errlogPrintf("asCa:exceptionCallback stat %s channel %s\n", + ca_message(stat),channel); +} + /*connectCallback only handles disconnects*/ LOCAL void connectCallback(struct connection_handler_args arg) { @@ -135,6 +148,8 @@ LOCAL void asCaTask(void) taskwdInsert(taskIdSelf(),NULL,NULL); SEVCHK(ca_task_initialize(),"ca_task_initialize"); + SEVCHK(ca_add_exception_event(exceptionCallback,NULL), + "ca_add_exception_event"); while(TRUE) { if(semTake(asCaTaskAddChannels,WAIT_FOREVER)!=OK) { epicsPrintf("asCa semTake error for asCaTaskClearChannels\n"); diff --git a/src/db/dbCa.c b/src/db/dbCa.c index 6e1c8bced..0ab0f86f8 100644 --- a/src/db/dbCa.c +++ b/src/db/dbCa.c @@ -432,6 +432,20 @@ int dbCaGetLinkDBFtype(struct link *plink) } +static void exceptionCallback(struct exception_handler_args args) +{ + chid chid = args.chid; + long stat = args.stat; /* Channel access status code*/ + const char *channel; + static char *noname = "unknown"; + + channel = (chid ? ca_name(chid) : noname); + + errlogPrintf("dbCa:exceptionCallback stat %s channel %s\n", + ca_message(stat),channel); +} + + static void eventCallback(struct event_handler_args arg) { caLink *pca = (caLink *)arg.usr; @@ -635,6 +649,8 @@ void dbCaTask() int status; SEVCHK(ca_task_initialize(),NULL); + SEVCHK(ca_add_exception_event(exceptionCallback,NULL), + "ca_add_exception_event"); /*Dont do anything until iocInit initializes database*/ while(!interruptAccept) taskDelay(10); /* channel access event loop */