#include <stdio.h>
#include <stdlib.h>
#include "cadef.h"
#include "epicsTime.h"
Go to the source code of this file.
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov" |
void caConnTest |
( |
const char * |
pNameIn, |
|
|
unsigned |
channelCountIn, |
|
|
double |
delayIn |
|
) |
| |
Definition at line 58 of file caConnTest.cpp.
60 unsigned iteration = 0u;
65 channelCount = channelCountIn;
67 pChans =
new chid [channelCount];
71 subsequentConnect =
false;
72 begin = epicsTime::getCurrent ();
74 printf (
"initializing CA client library\n" );
77 SEVCHK ( status,
"CA init failed" );
79 printf (
"creating channels\n" );
81 for ( i = 0u; i < channelCount; i++ ) {
84 SEVCHK ( status,
"CA search problems" );
87 printf (
"all channels were created\n" );
91 if ( iteration & 1 ) {
92 for ( i = 0u; i < channelCount; i++ ) {
94 SEVCHK ( status,
"ca_clear_channel() problems" );
96 printf (
"all channels were destroyed\n" );
99 printf (
"shutting down CA client library\n" );
102 SEVCHK ( status,
"task exit problems" );
int epicsStdCall ca_task_exit()
int epicsStdCall ca_search_and_connect(const char *name_str, chid *chanptr, caCh *conn_func, void *puser)
int epicsStdCall ca_pend_event(ca_real timeout)
#define SEVCHK(CA_ERROR_CODE, MESSAGE_STRING)
int epicsStdCall ca_task_initialize(void)
int epicsStdCall ca_clear_channel(chid pChan)
void caConnTestConnHandler(struct connection_handler_args args)
Definition at line 24 of file caConnTest.cpp.
27 if ( connCount == 0u ) {
28 if ( subsequentConnect ) {
29 printf (
"the first channel connected\n");
30 begin = epicsTime::getCurrent ();
36 if ( connCount == channelCount ) {
37 epicsTime current = epicsTime::getCurrent ();
38 double delay = current -
begin;
39 printf (
"all channels connected after %f sec ( %f sec per channel)\n",
40 delay, delay / channelCount );
44 if ( connCount == channelCount ) {
45 printf (
"channels are disconnected\n" );
46 subsequentConnect =
true;
49 if ( connCount == 0u ) {
50 printf (
"all channels are disconnected\n" );
#define assert(exp)
Declare that a condition should be true.