28 #define epicsAssertAuthor "Jeff Hill johill@lanl.gov" 35 #define CA_ERROR_GLBLSOURCE 40 #define CAC_VERSION_GLOBAL 51 "Normal successful completion",
52 "Maximum simultaneous IOC connections exceeded",
53 "Unknown internet host",
54 "Unknown internet service",
55 "Unable to allocate a new socket",
57 "Unable to connect to internet host or service",
58 "Unable to allocate additional dynamic memory",
60 "Record field specified inappropriate for channel specified",
61 "The requested data transfer is greater than available memory or EPICS_CA_MAX_ARRAY_BYTES",
63 "User specified timeout on IO operation expired",
64 "Sorry, that feature is planned but not supported at this time",
65 "The supplied string is unusually large",
66 "The request was ignored because the specified channel is disconnected",
67 "The data type specifed is invalid",
69 "Remote Channel not found",
70 "Unable to locate all user specified channels",
71 "Channel Access Internal Failure",
72 "The requested local DB operation failed",
73 "Channel read request failed",
75 "Channel write request failed",
76 "Channel subscription request failed",
77 "Invalid element count requested",
79 "Virtual circuit disconnect",
81 "Identical process variable names on multiple servers",
82 "Request inappropriate within subscription (monitor) update callback",
83 "Database value get for that channel failed during channel search",
84 "Unable to initialize without the vxWorks VX_FP_TASK task option set",
85 "Event queue overflow has prevented first pass event after event add",
87 "Bad event subscription (monitor) identifier",
88 "Remote channel has new network address",
89 "New or resumed network connection",
90 "Specified task isnt a member of a CA context",
91 "Attempt to use defunct CA feature failed",
93 "The supplied string is empty",
94 "Unable to spawn the CA repeater thread- auto reconnect will fail",
95 "No channel id match for search reply- search reply ignored",
96 "Reseting dead connection- will try to reconnect",
97 "Server (IOC) has fallen behind or is not responding- still waiting",
99 "No internet interface with broadcast available",
100 "Invalid event selection mask",
101 "IO operations have completed",
102 "IO operations are in progress",
103 "Invalid synchronous group identifier",
105 "Put callback timed out",
106 "Read access denied",
107 "Write access denied",
108 "Requested feature is no longer supported",
109 "Empty PV search address list",
111 "No reasonable data conversion between client and server types",
112 "Invalid channel identifier",
113 "Invalid function pointer",
114 "Thread is already attached to a client context",
115 "Not supported by attached service",
117 "User destroyed channel",
118 "Invalid channel priority",
119 "Preemptive callback not enabled - additional threads may not join context",
120 "Client's protocol revision does not support transfers exceeding 16k bytes",
121 "Virtual circuit connection sequence aborted",
123 "Virtual circuit unresponsive" 140 if ( caClientContextId == 0 ) {
179 if ( caClientContextId == 0 ) {
236 if ( caClientContextId !=
NULL ) {
266 caCh *conn_func,
void *puser )
268 if ( get_type !=
TYPENOTCONN && pvalue != 0 && get_count != 0 ) {
280 const char * name_str,
chid * chanptr,
281 caCh * conn_func,
void * puser )
289 const char * name_str,
caCh * conn_func,
void * puser,
303 guard ( pcac->mutex );
304 if ( pcac->fdRegFuncNeedsToBeCalled ) {
305 pFunc = pcac->fdRegFunc;
306 pArg = pcac->fdRegArg;
307 pcac->fdRegFuncNeedsToBeCalled =
false;
311 ( *pFunc ) ( pArg, pcac->sock,
true );
318 new ( pcac->oldChannelNotifyFreeList )
320 conn_func, puser, priority );
323 *chanptr = pChanNotify;
332 catch ( std::bad_alloc & ) {
341 catch ( std :: exception & except ) {
343 "ca_create_channel: " 344 "unexpected exception was \"%s\"",
375 if ( cac.pCallbackGuard.get() &&
378 pChan->
destructor ( *cac.pCallbackGuard.get(), guard );
379 cac.oldChannelNotifyFreeList.
release ( pChan );
392 pChan->
destructor ( *cac.pCallbackGuard.get(), guard );
393 cac.oldChannelNotifyFreeList.
release ( pChan );
422 evid *monixptr,
long mask )
425 pCallBack, pCallBackArg, monixptr );
468 if ( timeout == 0.0 ) {
495 if ( timeout == 0.0 ) {
496 return pcac->
pendIO ( DBL_MAX );
499 return pcac->
pendIO ( timeout );
518 pcac->
flush ( guard );
546 void epicsStdCall
ca_signal (
long ca_status,
const char *message )
569 return "new CA message number known only by server - see caerr.h";
578 const char *message,
const char *pfilenm,
int lineno )
588 int lineno,
const char *pFormat, ... )
592 if ( caClientContextId ) {
600 va_start ( theArgs, pFormat );
602 pcac->
vSignal ( ca_status, pfilenm, lineno, pFormat, theArgs );
605 fprintf (
stderr,
"CA exception in thread w/o CA ctx: status=%s file=%s line=%d: \n",
608 vfprintf (
stderr, pFormat, theArgs );
695 ::printf (
"The R3.14 EPICS OS abstraction API does not allow peeking at thread private storage of another thread.\n");
696 ::printf (
"Please call \"ca_client_status ( unsigned level )\" from the subsystem specific diagnostic code.\n");
709 pcac->
show ( level );
715 pcac->
show ( level );
729 if ( caClientContextId ) {
749 if ( pcac && pCtx != 0 ) {
761 if ( caClientContextId ) {
858 sizeof(struct dbr_sts_float),
860 sizeof(struct dbr_sts_enum),
861 sizeof(struct dbr_sts_char),
862 sizeof(struct dbr_sts_long),
863 sizeof(struct dbr_sts_double),
864 sizeof(struct dbr_time_string),
866 sizeof(struct dbr_time_short),
867 sizeof(struct dbr_time_float),
868 sizeof(struct dbr_time_enum),
869 sizeof(struct dbr_time_char),
870 sizeof(struct dbr_time_long),
872 sizeof(struct dbr_time_double),
873 sizeof(struct dbr_sts_string),
874 sizeof(struct dbr_gr_short),
875 sizeof(struct dbr_gr_float),
876 sizeof(struct dbr_gr_enum),
878 sizeof(struct dbr_gr_char),
879 sizeof(struct dbr_gr_long),
880 sizeof(struct dbr_gr_double),
881 sizeof(struct dbr_sts_string),
882 sizeof(struct dbr_ctrl_short),
884 sizeof(struct dbr_ctrl_float),
885 sizeof(struct dbr_ctrl_enum),
886 sizeof(struct dbr_ctrl_char),
887 sizeof(struct dbr_ctrl_long),
888 sizeof(struct dbr_ctrl_double),
890 sizeof(dbr_put_ackt_t),
891 sizeof(dbr_put_acks_t),
892 sizeof(struct dbr_stsack_string),
893 sizeof(dbr_string_t),
905 sizeof(dbr_string_t),
922 sizeof(dbr_string_t),
941 sizeof(dbr_string_t),
1000 (
unsigned short) offsetof(dbr_sts_string,
value[0]),
1002 (
unsigned short) offsetof(dbr_sts_float,
value),
1003 (
unsigned short) offsetof(dbr_sts_enum,
value),
1004 (
unsigned short) offsetof(dbr_sts_char,
value),
1005 (
unsigned short) offsetof(dbr_sts_long,
value),
1006 (
unsigned short) offsetof(dbr_sts_double,
value),
1007 (
unsigned short) offsetof(dbr_time_string,
value[0] ),
1008 (
unsigned short) offsetof(dbr_time_short,
value),
1009 (
unsigned short) offsetof(dbr_time_float,
value),
1010 (
unsigned short) offsetof(dbr_time_enum,
value),
1011 (
unsigned short) offsetof(dbr_time_char,
value),
1012 (
unsigned short) offsetof(dbr_time_long,
value),
1013 (
unsigned short) offsetof(dbr_time_double,
value),
1014 (
unsigned short) offsetof(dbr_sts_string,
value[0]),
1015 (
unsigned short) offsetof(dbr_gr_short,
value),
1016 (
unsigned short) offsetof(dbr_gr_float,
value),
1017 (
unsigned short) offsetof(dbr_gr_enum,
value),
1018 (
unsigned short) offsetof(dbr_gr_char,
value),
1019 (
unsigned short) offsetof(dbr_gr_long,
value),
1020 (
unsigned short) offsetof(dbr_gr_double,
value),
1021 (
unsigned short) offsetof(dbr_sts_string,
value[0]),
1022 (
unsigned short) offsetof(dbr_ctrl_short,
value),
1023 (
unsigned short) offsetof(dbr_ctrl_float,
value),
1024 (
unsigned short) offsetof(dbr_ctrl_enum,
value),
1025 (
unsigned short) offsetof(dbr_ctrl_char,
value),
1026 (
unsigned short) offsetof(dbr_ctrl_long,
value),
1027 (
unsigned short) offsetof(dbr_ctrl_double,
value),
1030 (
unsigned short) offsetof(dbr_stsack_string,
value[0]),
1088 "DBR_STSACK_STRING",
int epicsStdCall ca_task_exit()
int epicsStdCall ca_channel_status(epicsThreadId)
const char * dbr_text[LAST_BUFFER_TYPE+1]
const unsigned short dbr_value_size[LAST_BUFFER_TYPE+1]
void caCh(struct connection_handler_args args)
const unsigned short dbr_size[LAST_BUFFER_TYPE+1]
void ca_init_client_context(void *)
unsigned epicsStdCall ca_beacon_anomaly_count()
#define CA_PRIORITY_DEFAULT
ca_preemptive_callback_select
bool preemptiveCallbakIsEnabled() const
int epicsStdCall ca_create_channel(const char *name_str, caCh *conn_func, void *puser, capri priority, chid *chanptr)
#define CA_EXTRACT_MSG_NO(code)
LIBCOM_API void *epicsStdCall epicsThreadPrivateGet(epicsThreadPrivateId)
int epicsStdCall ca_search_and_connect(const char *name_str, chid *chanptr, caCh *conn_func, void *puser)
ca_client_context & getClientCtx()
void epicsStdCall ca_self_test()
void caExceptionHandler(struct exception_handler_args)
void caEventCallBackFunc(struct event_handler_args)
int epicsStdCall ca_pend_io(ca_real timeout)
unsigned epicsStdCall ca_get_ioc_connection_count()
pvd::StructureConstPtr type
int printFormated(const char *pformat,...) const
int epicsStdCall ca_add_masked_array_event(chtype type, arrayElementCount count, chid pChan, caEventCallBackFunc *pCallBack, void *pCallBackArg, ca_real, ca_real, ca_real, evid *monixptr, long mask)
void epicsStdCall ca_detach_context()
int epicsStdCall ca_attach_context(struct ca_client_context *pCtx)
const char * dbr_text_invalid
void epicsStdCall ca_signal(long ca_status, const char *message)
int epicsStdCall ca_preemtive_callback_is_enabled()
Miscellaneous macro definitions.
#define CA_VERSION_STRING(MINOR_REVISION)
void CAFDHANDLER(void *parg, int fd, int opened)
void epicsStdCall ca_signal_with_file_and_lineno(long ca_status, const char *message, const char *pfilenm, int lineno)
int epicsStdCall ca_client_status(unsigned level)
void destructor(CallbackGuard &cbGuard, epicsGuard< epicsMutex > &mutexGuard)
#define CA_MINOR_PROTOCOL_REVISION
const char * ca_message_text[]
int epicsStdCall ca_context_create(ca_preemptive_callback_select premptiveCallbackSelect)
int epicsStdCall ca_pend_event(ca_real timeout)
#define EPICS_THREAD_ONCE_INIT
void epicsStdCall ca_signal_formated(long ca_status, const char *pfilenm, int lineno, const char *pFormat,...)
unsigned beaconAnomaliesSinceProgramStart() const
int epicsStdCall ca_add_exception_event(caExceptionHandler *pfunc, void *arg)
LIBCOM_API void epicsStdCall epicsThreadOnce(epicsThreadOnceId *id, EPICSTHREADFUNC, void *arg)
int epicsStdCall ca_flush_io()
LIBCOM_API void epicsStdCall epicsThreadPrivateSet(epicsThreadPrivateId, void *)
const epicsType DBR_XXXXToEpicsType[LAST_BUFFER_TYPE+1]
int epicsStdCall ca_pend(ca_real timeout, int early)
int epicsStdCall ca_replace_printf_handler(caPrintfFunc *ca_printf_func)
void initiateConnect(epicsGuard< epicsMutex > &)
LIBCA_API int epicsStdCall ca_clear_subscription(evid pMon)
Extended replacement for the Posix exit and atexit routines.
epicsFloat64 dbr_double_t
int fetchClientContext(ca_client_context **ppcac)
int epicsStdCall ca_task_initialize(void)
int epicsStdCall ca_add_fd_registration(CAFDHANDLER *func, void *arg)
epicsOldString dbr_string_t
int epicsStdCall ca_clear_event(evid pMon)
int caPrintfFunc(const char *pformat, va_list args)
int epicsStdCall ca_clear_channel(chid pChan)
epicsThreadPrivateId caClientContextId
void changeExceptionEvent(caExceptionHandler *pfunc, void *arg)
int pendEvent(const double &timeout)
unsigned long arrayElementCount
const char *epicsStdCall ca_message(long ca_status)
const char *epicsStdCall ca_version()
oldChannelNotify & channel() const
void flush(epicsGuard< epicsMutex > &)
unsigned circuitCount() const
int epicsStdCall ca_modify_user_name(const char *)
int epicsStdCall ca_build_and_connect(const char *name_str, chtype get_type, arrayElementCount get_count, chid *chan, void *pvalue, caCh *conn_func, void *puser)
chid epicsStdCall ca_evid_to_chid(evid pMon)
void replaceErrLogHandler(caPrintfFunc *ca_printf_func)
void registerForFileDescriptorCallBack(CAFDHANDLER *pFunc, void *pArg)
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &)
int epicsStdCall ca_context_status(ca_client_context *pcac, unsigned level)
void epicsStdCall ca_context_destroy()
int epicsStdCall ca_modify_host_name(const char *)
int pendIO(const double &timeout)
const int epicsTypeToDBR_XXXX[lastEpicsType+1]
struct ca_client_context *epicsStdCall ca_current_context()
void vSignal(int ca_status, const char *pfilenm, int lineno, const char *pFormat, va_list args)
LIBCOM_API epicsThreadPrivateId epicsStdCall epicsThreadPrivateCreate(void)
LIBCA_API int epicsStdCall ca_create_subscription(chtype type, unsigned long count, chid chanId, long mask, caEventCallBackFunc *pFunc, void *pArg, evid *pEventID)
#define ECA_UNAVAILINSERV
int epicsStdCall ca_test_io()
const char * dbf_text_invalid
const unsigned short dbr_value_offset[LAST_BUFFER_TYPE+1]
void show(unsigned level) const
const char * dbf_text[LAST_TYPE+3]
LIBCOM_API epicsThreadId epicsStdCall epicsThreadGetIdSelf(void)