From adfa1257f50b81ae55ac5b9ac48b105f6e529970 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 16 Jan 2012 16:40:37 -0600 Subject: [PATCH] makeBaseApp: caMonitor example should use ca_create_subscription() It was calling ca_add_event(), which is a deprecated API. --- src/makeBaseApp/top/caClientApp/caMonitor.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/makeBaseApp/top/caClientApp/caMonitor.c b/src/makeBaseApp/top/caClientApp/caMonitor.c index 9bd77e8ea..059fefb5e 100644 --- a/src/makeBaseApp/top/caClientApp/caMonitor.c +++ b/src/makeBaseApp/top/caClientApp/caMonitor.c @@ -1,7 +1,9 @@ /*caMonitor.c*/ -/* This example accepts a file containing a list of pvs to monitor - * It prints a message for all ca evemts: connection, access rights, data + +/* This example accepts the name of a file containing a list of pvs to monitor. + * It prints a message for all ca events: connection, access rights and monitor. */ + #include #include #include @@ -110,18 +112,18 @@ int main(int argc,char **argv) SEVCHK(ca_context_create(ca_disable_preemptive_callback),"ca_context_create"); SEVCHK(ca_add_exception_event(exceptionCallback,NULL), "ca_add_exception_event"); - for(i=0; imychid), "ca_create_channel"); SEVCHK(ca_replace_access_rights_event(pmynode[i]->mychid, accessRightsCallback), "ca_replace_access_rights_event"); - SEVCHK(ca_add_event(DBR_STRING,pmynode[i]->mychid,eventCallback, - pmynode[i],&pmynode[i]->myevid), - "ca_add_event"); + SEVCHK(ca_create_subscription(DBR_STRING,1,pmynode[i]->mychid, + DBE_VALUE,eventCallback,pmynode[i],&pmynode[i]->myevid), + "ca_create_subscription"); } /*Should never return from following call*/ SEVCHK(ca_pend_event(0.0),"ca_pend_event"); - return(0); + return 0; }