provide ca exception handler
This commit is contained in:
@@ -411,6 +411,19 @@ 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;
|
||||
@@ -594,6 +607,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) threadSleep(.1);
|
||||
/* channel access event loop */
|
||||
|
||||
Reference in New Issue
Block a user