CleanupWhitespace
removed spaces at end of line replaced tabs with spaces
This commit is contained in:
@@ -208,23 +208,23 @@ bool CASG::ioComplete (
|
||||
return this->ioPendingList.count () == 0u;
|
||||
}
|
||||
|
||||
void CASG::put ( epicsGuard < epicsMutex > & guard, chid pChan,
|
||||
void CASG::put ( epicsGuard < epicsMutex > & guard, chid pChan,
|
||||
unsigned type, arrayElementCount count, const void * pValue )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
sgAutoPtr < syncGroupWriteNotify > pNotify ( guard, *this );
|
||||
pNotify = syncGroupWriteNotify::factory (
|
||||
pNotify = syncGroupWriteNotify::factory (
|
||||
this->freeListWriteOP, *this, & CASG :: recycleWriteNotifyIO, pChan );
|
||||
pNotify->begin ( guard, type, count, pValue );
|
||||
pNotify.release ();
|
||||
}
|
||||
|
||||
void CASG::get ( epicsGuard < epicsMutex > & guard, chid pChan,
|
||||
void CASG::get ( epicsGuard < epicsMutex > & guard, chid pChan,
|
||||
unsigned type, arrayElementCount count, void *pValue )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
sgAutoPtr < syncGroupReadNotify > pNotify ( guard, *this );
|
||||
pNotify = syncGroupReadNotify::factory (
|
||||
pNotify = syncGroupReadNotify::factory (
|
||||
this->freeListReadOP, *this, & CASG :: recycleReadNotifyIO, pChan, pValue );
|
||||
pNotify->begin ( guard, type, count );
|
||||
pNotify.release ();
|
||||
@@ -241,14 +241,14 @@ void CASG::completionNotify (
|
||||
}
|
||||
}
|
||||
|
||||
void CASG :: recycleReadNotifyIO ( epicsGuard < epicsMutex > & guard,
|
||||
void CASG :: recycleReadNotifyIO ( epicsGuard < epicsMutex > & guard,
|
||||
syncGroupReadNotify & io )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
this->freeListReadOP.release ( & io );
|
||||
}
|
||||
|
||||
void CASG :: recycleWriteNotifyIO ( epicsGuard < epicsMutex > & guard,
|
||||
void CASG :: recycleWriteNotifyIO ( epicsGuard < epicsMutex > & guard,
|
||||
syncGroupWriteNotify & io )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
|
||||
@@ -28,7 +28,7 @@ struct SearchDest :
|
||||
virtual void notify (
|
||||
const caHdr & msg, const void * pPayload,
|
||||
const osiSockAddr & addr, const epicsTime & ) = 0;
|
||||
virtual void show (
|
||||
virtual void show (
|
||||
epicsGuard < epicsMutex > &, unsigned level ) const = 0;
|
||||
};
|
||||
virtual void searchRequest ( epicsGuard < epicsMutex > &,
|
||||
|
||||
@@ -181,19 +181,19 @@ int epicsStdCall ca_context_create (
|
||||
}
|
||||
|
||||
pcac = ( ca_client_context * ) epicsThreadPrivateGet ( caClientContextId );
|
||||
if ( pcac ) {
|
||||
if ( pcac ) {
|
||||
if ( premptiveCallbackSelect == ca_enable_preemptive_callback &&
|
||||
! pcac->preemptiveCallbakIsEnabled() ) {
|
||||
return ECA_NOTTHREADED;
|
||||
}
|
||||
return ECA_NORMAL;
|
||||
}
|
||||
return ECA_NORMAL;
|
||||
}
|
||||
|
||||
pcac = new ca_client_context (
|
||||
premptiveCallbackSelect == ca_enable_preemptive_callback );
|
||||
if ( ! pcac ) {
|
||||
return ECA_ALLOCMEM;
|
||||
}
|
||||
if ( ! pcac ) {
|
||||
return ECA_ALLOCMEM;
|
||||
}
|
||||
|
||||
epicsThreadPrivateSet ( caClientContextId, (void *) pcac );
|
||||
}
|
||||
@@ -465,7 +465,7 @@ int epicsStdCall ca_pend_event ( ca_real timeout )
|
||||
try {
|
||||
// preserve past odd ball behavior of waiting forever when
|
||||
// the delay is zero
|
||||
if ( timeout == 0.0 ) {
|
||||
if ( timeout == 0.0 ) {
|
||||
while ( true ) {
|
||||
pcac->pendEvent ( 60.0 );
|
||||
}
|
||||
@@ -694,7 +694,7 @@ int epicsStdCall ca_channel_status ( epicsThreadId /* tid */ )
|
||||
{
|
||||
::printf ("The R3.14 EPICS OS abstraction API does not allow peeking at thread private storage of another thread.\n");
|
||||
::printf ("Please call \"ca_client_status ( unsigned level )\" from the subsystem specific diagnostic code.\n");
|
||||
return ECA_ANACHRONISM;
|
||||
return ECA_ANACHRONISM;
|
||||
}
|
||||
|
||||
// extern "C"
|
||||
@@ -798,249 +798,249 @@ const int epicsTypeToDBR_XXXX [lastEpicsType+1] = {
|
||||
};
|
||||
|
||||
const epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1] = {
|
||||
epicsOldStringT,
|
||||
epicsInt16T,
|
||||
epicsFloat32T,
|
||||
epicsEnum16T,
|
||||
epicsUInt8T,
|
||||
epicsInt32T,
|
||||
epicsFloat64T,
|
||||
epicsOldStringT,
|
||||
epicsInt16T,
|
||||
epicsFloat32T,
|
||||
epicsEnum16T,
|
||||
epicsUInt8T,
|
||||
epicsInt32T,
|
||||
epicsFloat64T,
|
||||
|
||||
epicsOldStringT,
|
||||
epicsInt16T,
|
||||
epicsFloat32T,
|
||||
epicsEnum16T,
|
||||
epicsUInt8T,
|
||||
epicsInt32T,
|
||||
epicsFloat64T,
|
||||
epicsOldStringT,
|
||||
epicsInt16T,
|
||||
epicsFloat32T,
|
||||
epicsEnum16T,
|
||||
epicsUInt8T,
|
||||
epicsInt32T,
|
||||
epicsFloat64T,
|
||||
|
||||
epicsOldStringT,
|
||||
epicsInt16T,
|
||||
epicsFloat32T,
|
||||
epicsEnum16T,
|
||||
epicsUInt8T,
|
||||
epicsInt32T,
|
||||
epicsFloat64T,
|
||||
epicsOldStringT,
|
||||
epicsInt16T,
|
||||
epicsFloat32T,
|
||||
epicsEnum16T,
|
||||
epicsUInt8T,
|
||||
epicsInt32T,
|
||||
epicsFloat64T,
|
||||
|
||||
epicsOldStringT,
|
||||
epicsInt16T,
|
||||
epicsFloat32T,
|
||||
epicsEnum16T,
|
||||
epicsUInt8T,
|
||||
epicsInt32T,
|
||||
epicsFloat64T,
|
||||
epicsOldStringT,
|
||||
epicsInt16T,
|
||||
epicsFloat32T,
|
||||
epicsEnum16T,
|
||||
epicsUInt8T,
|
||||
epicsInt32T,
|
||||
epicsFloat64T,
|
||||
|
||||
epicsOldStringT,
|
||||
epicsInt16T,
|
||||
epicsFloat32T,
|
||||
epicsEnum16T,
|
||||
epicsUInt8T,
|
||||
epicsInt32T,
|
||||
epicsFloat64T,
|
||||
epicsOldStringT,
|
||||
epicsInt16T,
|
||||
epicsFloat32T,
|
||||
epicsEnum16T,
|
||||
epicsUInt8T,
|
||||
epicsInt32T,
|
||||
epicsFloat64T,
|
||||
|
||||
epicsUInt16T,
|
||||
epicsUInt16T,
|
||||
epicsOldStringT,
|
||||
epicsOldStringT
|
||||
epicsUInt16T,
|
||||
epicsUInt16T,
|
||||
epicsOldStringT,
|
||||
epicsOldStringT
|
||||
};
|
||||
|
||||
const unsigned short dbr_size[LAST_BUFFER_TYPE+1] = {
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_short_t), /* short */
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
sizeof(dbr_char_t), /* character */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_short_t), /* short */
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
sizeof(dbr_char_t), /* character */
|
||||
|
||||
sizeof(dbr_long_t), /* long */
|
||||
sizeof(dbr_double_t), /* double */
|
||||
sizeof(struct dbr_sts_string), /* string field with status */
|
||||
sizeof(struct dbr_sts_short), /* short field with status */
|
||||
sizeof(struct dbr_sts_float), /* float field with status */
|
||||
sizeof(dbr_long_t), /* long */
|
||||
sizeof(dbr_double_t), /* double */
|
||||
sizeof(struct dbr_sts_string), /* string field with status */
|
||||
sizeof(struct dbr_sts_short), /* short field with status */
|
||||
sizeof(struct dbr_sts_float), /* float field with status */
|
||||
|
||||
sizeof(struct dbr_sts_enum), /* item number with status */
|
||||
sizeof(struct dbr_sts_char), /* char field with status */
|
||||
sizeof(struct dbr_sts_long), /* long field with status */
|
||||
sizeof(struct dbr_sts_double), /* double field with time */
|
||||
sizeof(struct dbr_time_string), /* string field with time */
|
||||
sizeof(struct dbr_sts_enum), /* item number with status */
|
||||
sizeof(struct dbr_sts_char), /* char field with status */
|
||||
sizeof(struct dbr_sts_long), /* long field with status */
|
||||
sizeof(struct dbr_sts_double), /* double field with time */
|
||||
sizeof(struct dbr_time_string), /* string field with time */
|
||||
|
||||
sizeof(struct dbr_time_short), /* short field with time */
|
||||
sizeof(struct dbr_time_float), /* float field with time */
|
||||
sizeof(struct dbr_time_enum), /* item number with time */
|
||||
sizeof(struct dbr_time_char), /* char field with time */
|
||||
sizeof(struct dbr_time_long), /* long field with time */
|
||||
sizeof(struct dbr_time_short), /* short field with time */
|
||||
sizeof(struct dbr_time_float), /* float field with time */
|
||||
sizeof(struct dbr_time_enum), /* item number with time */
|
||||
sizeof(struct dbr_time_char), /* char field with time */
|
||||
sizeof(struct dbr_time_long), /* long field with time */
|
||||
|
||||
sizeof(struct dbr_time_double), /* double field with time */
|
||||
sizeof(struct dbr_sts_string), /* graphic string info */
|
||||
sizeof(struct dbr_gr_short), /* graphic short info */
|
||||
sizeof(struct dbr_gr_float), /* graphic float info */
|
||||
sizeof(struct dbr_gr_enum), /* graphic item info */
|
||||
sizeof(struct dbr_time_double), /* double field with time */
|
||||
sizeof(struct dbr_sts_string), /* graphic string info */
|
||||
sizeof(struct dbr_gr_short), /* graphic short info */
|
||||
sizeof(struct dbr_gr_float), /* graphic float info */
|
||||
sizeof(struct dbr_gr_enum), /* graphic item info */
|
||||
|
||||
sizeof(struct dbr_gr_char), /* graphic char info */
|
||||
sizeof(struct dbr_gr_long), /* graphic long info */
|
||||
sizeof(struct dbr_gr_double), /* graphic double info */
|
||||
sizeof(struct dbr_sts_string), /* control string info */
|
||||
sizeof(struct dbr_ctrl_short), /* control short info */
|
||||
sizeof(struct dbr_gr_char), /* graphic char info */
|
||||
sizeof(struct dbr_gr_long), /* graphic long info */
|
||||
sizeof(struct dbr_gr_double), /* graphic double info */
|
||||
sizeof(struct dbr_sts_string), /* control string info */
|
||||
sizeof(struct dbr_ctrl_short), /* control short info */
|
||||
|
||||
sizeof(struct dbr_ctrl_float), /* control float info */
|
||||
sizeof(struct dbr_ctrl_enum), /* control item info */
|
||||
sizeof(struct dbr_ctrl_char), /* control char info */
|
||||
sizeof(struct dbr_ctrl_long), /* control long info */
|
||||
sizeof(struct dbr_ctrl_double), /* control double info */
|
||||
sizeof(struct dbr_ctrl_float), /* control float info */
|
||||
sizeof(struct dbr_ctrl_enum), /* control item info */
|
||||
sizeof(struct dbr_ctrl_char), /* control char info */
|
||||
sizeof(struct dbr_ctrl_long), /* control long info */
|
||||
sizeof(struct dbr_ctrl_double), /* control double info */
|
||||
|
||||
sizeof(dbr_put_ackt_t), /* put ackt */
|
||||
sizeof(dbr_put_acks_t), /* put acks */
|
||||
sizeof(struct dbr_stsack_string),/* string field with status/ack*/
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_put_ackt_t), /* put ackt */
|
||||
sizeof(dbr_put_acks_t), /* put acks */
|
||||
sizeof(struct dbr_stsack_string),/* string field with status/ack*/
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
};
|
||||
|
||||
const unsigned short dbr_value_size[LAST_BUFFER_TYPE+1] = {
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_short_t), /* short */
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
sizeof(dbr_char_t), /* character */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_short_t), /* short */
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
sizeof(dbr_char_t), /* character */
|
||||
|
||||
sizeof(dbr_long_t), /* long */
|
||||
sizeof(dbr_double_t), /* double */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_short_t), /* short */
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
sizeof(dbr_long_t), /* long */
|
||||
sizeof(dbr_double_t), /* double */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_short_t), /* short */
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
sizeof(dbr_char_t), /* character */
|
||||
sizeof(dbr_long_t), /* long */
|
||||
sizeof(dbr_double_t), /* double */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
sizeof(dbr_char_t), /* character */
|
||||
sizeof(dbr_long_t), /* long */
|
||||
sizeof(dbr_double_t), /* double */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
|
||||
sizeof(dbr_short_t), /* short */
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
sizeof(dbr_char_t), /* character */
|
||||
sizeof(dbr_long_t), /* long */
|
||||
sizeof(dbr_short_t), /* short */
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
sizeof(dbr_char_t), /* character */
|
||||
sizeof(dbr_long_t), /* long */
|
||||
|
||||
sizeof(dbr_double_t), /* double */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_short_t), /* short */
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
sizeof(dbr_double_t), /* double */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_short_t), /* short */
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
|
||||
sizeof(dbr_char_t), /* character */
|
||||
sizeof(dbr_long_t), /* long */
|
||||
sizeof(dbr_double_t), /* double */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_short_t), /* short */
|
||||
sizeof(dbr_char_t), /* character */
|
||||
sizeof(dbr_long_t), /* long */
|
||||
sizeof(dbr_double_t), /* double */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_short_t), /* short */
|
||||
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
sizeof(dbr_char_t), /* character */
|
||||
sizeof(dbr_long_t), /* long */
|
||||
sizeof(dbr_double_t), /* double */
|
||||
sizeof(dbr_float_t), /* IEEE Float */
|
||||
sizeof(dbr_enum_t), /* item number */
|
||||
sizeof(dbr_char_t), /* character */
|
||||
sizeof(dbr_long_t), /* long */
|
||||
sizeof(dbr_double_t), /* double */
|
||||
|
||||
sizeof(dbr_ushort_t), /* put_ackt */
|
||||
sizeof(dbr_ushort_t), /* put_acks */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_ushort_t), /* put_ackt */
|
||||
sizeof(dbr_ushort_t), /* put_acks */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
sizeof(dbr_string_t), /* string max size */
|
||||
};
|
||||
|
||||
//extern "C"
|
||||
const enum dbr_value_class dbr_value_class[LAST_BUFFER_TYPE+1] = {
|
||||
dbr_class_string, /* string max size */
|
||||
dbr_class_int, /* short */
|
||||
dbr_class_float, /* IEEE Float */
|
||||
dbr_class_int, /* item number */
|
||||
dbr_class_int, /* character */
|
||||
dbr_class_int, /* long */
|
||||
dbr_class_float, /* double */
|
||||
dbr_class_string, /* string max size */
|
||||
dbr_class_int, /* short */
|
||||
dbr_class_float, /* IEEE Float */
|
||||
dbr_class_int, /* item number */
|
||||
dbr_class_int, /* character */
|
||||
dbr_class_int, /* long */
|
||||
dbr_class_float, /* double */
|
||||
|
||||
dbr_class_string, /* string max size */
|
||||
dbr_class_int, /* short */
|
||||
dbr_class_float, /* IEEE Float */
|
||||
dbr_class_int, /* item number */
|
||||
dbr_class_int, /* character */
|
||||
dbr_class_int, /* long */
|
||||
dbr_class_float, /* double */
|
||||
dbr_class_string, /* string max size */
|
||||
dbr_class_int, /* short */
|
||||
dbr_class_float, /* IEEE Float */
|
||||
dbr_class_int, /* item number */
|
||||
dbr_class_int, /* character */
|
||||
dbr_class_int, /* long */
|
||||
dbr_class_float, /* double */
|
||||
|
||||
dbr_class_string, /* string max size */
|
||||
dbr_class_int, /* short */
|
||||
dbr_class_float, /* IEEE Float */
|
||||
dbr_class_int, /* item number */
|
||||
dbr_class_int, /* character */
|
||||
dbr_class_int, /* long */
|
||||
dbr_class_float, /* double */
|
||||
dbr_class_string, /* string max size */
|
||||
dbr_class_int, /* short */
|
||||
dbr_class_float, /* IEEE Float */
|
||||
dbr_class_int, /* item number */
|
||||
dbr_class_int, /* character */
|
||||
dbr_class_int, /* long */
|
||||
dbr_class_float, /* double */
|
||||
|
||||
dbr_class_string, /* string max size */
|
||||
dbr_class_int, /* short */
|
||||
dbr_class_float, /* IEEE Float */
|
||||
dbr_class_int, /* item number */
|
||||
dbr_class_int, /* character */
|
||||
dbr_class_int, /* long */
|
||||
dbr_class_float, /* double */
|
||||
dbr_class_string, /* string max size */
|
||||
dbr_class_int, /* short */
|
||||
dbr_class_float, /* IEEE Float */
|
||||
dbr_class_int, /* item number */
|
||||
dbr_class_int, /* character */
|
||||
dbr_class_int, /* long */
|
||||
dbr_class_float, /* double */
|
||||
|
||||
dbr_class_string, /* string max size */
|
||||
dbr_class_int, /* short */
|
||||
dbr_class_float, /* IEEE Float */
|
||||
dbr_class_int, /* item number */
|
||||
dbr_class_int, /* character */
|
||||
dbr_class_int, /* long */
|
||||
dbr_class_float, /* double */
|
||||
dbr_class_int,
|
||||
dbr_class_int,
|
||||
dbr_class_string,
|
||||
dbr_class_string, /* string max size */
|
||||
dbr_class_string, /* string max size */
|
||||
dbr_class_int, /* short */
|
||||
dbr_class_float, /* IEEE Float */
|
||||
dbr_class_int, /* item number */
|
||||
dbr_class_int, /* character */
|
||||
dbr_class_int, /* long */
|
||||
dbr_class_float, /* double */
|
||||
dbr_class_int,
|
||||
dbr_class_int,
|
||||
dbr_class_string,
|
||||
dbr_class_string, /* string max size */
|
||||
};
|
||||
|
||||
const unsigned short dbr_value_offset[LAST_BUFFER_TYPE+1] = {
|
||||
0, /* string */
|
||||
0, /* short */
|
||||
0, /* IEEE Float */
|
||||
0, /* item number */
|
||||
0, /* character */
|
||||
0, /* long */
|
||||
0, /* IEEE double */
|
||||
(unsigned short) offsetof(dbr_sts_string,value[0]),/* string field with status */
|
||||
(unsigned short) offsetof(dbr_sts_short,value), /* short field with status */
|
||||
(unsigned short) offsetof(dbr_sts_float,value), /* float field with status */
|
||||
(unsigned short) offsetof(dbr_sts_enum,value), /* item number with status */
|
||||
(unsigned short) offsetof(dbr_sts_char,value), /* char field with status */
|
||||
(unsigned short) offsetof(dbr_sts_long,value), /* long field with status */
|
||||
(unsigned short) offsetof(dbr_sts_double,value), /* double field with time */
|
||||
(unsigned short) offsetof(dbr_time_string,value[0] ),/* string field with time */
|
||||
(unsigned short) offsetof(dbr_time_short,value), /* short field with time */
|
||||
(unsigned short) offsetof(dbr_time_float,value), /* float field with time */
|
||||
(unsigned short) offsetof(dbr_time_enum,value), /* item number with time */
|
||||
(unsigned short) offsetof(dbr_time_char,value), /* char field with time */
|
||||
(unsigned short) offsetof(dbr_time_long,value), /* long field with time */
|
||||
(unsigned short) offsetof(dbr_time_double,value), /* double field with time */
|
||||
(unsigned short) offsetof(dbr_sts_string,value[0]),/* graphic string info */
|
||||
(unsigned short) offsetof(dbr_gr_short,value), /* graphic short info */
|
||||
(unsigned short) offsetof(dbr_gr_float,value), /* graphic float info */
|
||||
(unsigned short) offsetof(dbr_gr_enum,value), /* graphic item info */
|
||||
(unsigned short) offsetof(dbr_gr_char,value), /* graphic char info */
|
||||
(unsigned short) offsetof(dbr_gr_long,value), /* graphic long info */
|
||||
(unsigned short) offsetof(dbr_gr_double,value), /* graphic double info */
|
||||
(unsigned short) offsetof(dbr_sts_string,value[0]),/* control string info */
|
||||
(unsigned short) offsetof(dbr_ctrl_short,value), /* control short info */
|
||||
(unsigned short) offsetof(dbr_ctrl_float,value), /* control float info */
|
||||
(unsigned short) offsetof(dbr_ctrl_enum,value), /* control item info */
|
||||
(unsigned short) offsetof(dbr_ctrl_char,value), /* control char info */
|
||||
(unsigned short) offsetof(dbr_ctrl_long,value), /* control long info */
|
||||
(unsigned short) offsetof(dbr_ctrl_double,value), /* control double info */
|
||||
0, /* put ackt */
|
||||
0, /* put acks */
|
||||
(unsigned short) offsetof(dbr_stsack_string,value[0]),/* string field with status */
|
||||
0, /* string */
|
||||
0, /* string */
|
||||
0, /* short */
|
||||
0, /* IEEE Float */
|
||||
0, /* item number */
|
||||
0, /* character */
|
||||
0, /* long */
|
||||
0, /* IEEE double */
|
||||
(unsigned short) offsetof(dbr_sts_string,value[0]), /* string field with status */
|
||||
(unsigned short) offsetof(dbr_sts_short,value), /* short field with status */
|
||||
(unsigned short) offsetof(dbr_sts_float,value), /* float field with status */
|
||||
(unsigned short) offsetof(dbr_sts_enum,value), /* item number with status */
|
||||
(unsigned short) offsetof(dbr_sts_char,value), /* char field with status */
|
||||
(unsigned short) offsetof(dbr_sts_long,value), /* long field with status */
|
||||
(unsigned short) offsetof(dbr_sts_double,value), /* double field with time */
|
||||
(unsigned short) offsetof(dbr_time_string,value[0] ), /* string field with time */
|
||||
(unsigned short) offsetof(dbr_time_short,value), /* short field with time */
|
||||
(unsigned short) offsetof(dbr_time_float,value), /* float field with time */
|
||||
(unsigned short) offsetof(dbr_time_enum,value), /* item number with time */
|
||||
(unsigned short) offsetof(dbr_time_char,value), /* char field with time */
|
||||
(unsigned short) offsetof(dbr_time_long,value), /* long field with time */
|
||||
(unsigned short) offsetof(dbr_time_double,value), /* double field with time */
|
||||
(unsigned short) offsetof(dbr_sts_string,value[0]), /* graphic string info */
|
||||
(unsigned short) offsetof(dbr_gr_short,value), /* graphic short info */
|
||||
(unsigned short) offsetof(dbr_gr_float,value), /* graphic float info */
|
||||
(unsigned short) offsetof(dbr_gr_enum,value), /* graphic item info */
|
||||
(unsigned short) offsetof(dbr_gr_char,value), /* graphic char info */
|
||||
(unsigned short) offsetof(dbr_gr_long,value), /* graphic long info */
|
||||
(unsigned short) offsetof(dbr_gr_double,value), /* graphic double info */
|
||||
(unsigned short) offsetof(dbr_sts_string,value[0]), /* control string info */
|
||||
(unsigned short) offsetof(dbr_ctrl_short,value), /* control short info */
|
||||
(unsigned short) offsetof(dbr_ctrl_float,value), /* control float info */
|
||||
(unsigned short) offsetof(dbr_ctrl_enum,value), /* control item info */
|
||||
(unsigned short) offsetof(dbr_ctrl_char,value), /* control char info */
|
||||
(unsigned short) offsetof(dbr_ctrl_long,value), /* control long info */
|
||||
(unsigned short) offsetof(dbr_ctrl_double,value), /* control double info */
|
||||
0, /* put ackt */
|
||||
0, /* put acks */
|
||||
(unsigned short) offsetof(dbr_stsack_string,value[0]), /* string field with status */
|
||||
0, /* string */
|
||||
};
|
||||
|
||||
const char *dbf_text[LAST_TYPE+3] = {
|
||||
"TYPENOTCONN",
|
||||
"DBF_STRING",
|
||||
"DBF_SHORT",
|
||||
"DBF_FLOAT",
|
||||
"DBF_ENUM",
|
||||
"DBF_CHAR",
|
||||
"DBF_LONG",
|
||||
"DBF_DOUBLE",
|
||||
"DBF_NO_ACCESS"
|
||||
"TYPENOTCONN",
|
||||
"DBF_STRING",
|
||||
"DBF_SHORT",
|
||||
"DBF_FLOAT",
|
||||
"DBF_ENUM",
|
||||
"DBF_CHAR",
|
||||
"DBF_LONG",
|
||||
"DBF_DOUBLE",
|
||||
"DBF_NO_ACCESS"
|
||||
};
|
||||
|
||||
const char *dbf_text_invalid = "DBF_invalid";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -19,15 +19,15 @@ int main ( int argc, char **argv )
|
||||
unsigned progressLoggingLevel;
|
||||
unsigned channelCount;
|
||||
unsigned repetitionCount;
|
||||
enum ca_preemptive_callback_select preempt;
|
||||
int aBoolean;
|
||||
enum ca_preemptive_callback_select preempt;
|
||||
int aBoolean;
|
||||
|
||||
|
||||
if ( argc < 2 || argc > 6 ) {
|
||||
printf ("usage: %s <PV name> [progress logging level] [channel count] "
|
||||
"[repetition count] [enable preemptive callback]\n",
|
||||
"[repetition count] [enable preemptive callback]\n",
|
||||
argv[0] );
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( argc >= 3 ) {
|
||||
@@ -57,12 +57,12 @@ int main ( int argc, char **argv )
|
||||
else {
|
||||
aBoolean = 0;
|
||||
}
|
||||
if ( aBoolean ) {
|
||||
preempt = ca_enable_preemptive_callback;
|
||||
}
|
||||
else {
|
||||
preempt = ca_disable_preemptive_callback;
|
||||
}
|
||||
if ( aBoolean ) {
|
||||
preempt = ca_enable_preemptive_callback;
|
||||
}
|
||||
else {
|
||||
preempt = ca_disable_preemptive_callback;
|
||||
}
|
||||
|
||||
acctst ( argv[1], progressLoggingLevel, channelCount, repetitionCount, preempt );
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ struct AutoInit {
|
||||
AutoInit ();
|
||||
};
|
||||
|
||||
AutoInit :: AutoInit ()
|
||||
AutoInit :: AutoInit ()
|
||||
{
|
||||
iocshRegister ( &acctstFuncDef, acctstCallFunc );
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef INC_addrList_H
|
||||
#define INC_addrList_H
|
||||
|
||||
#include "envDefs.h"
|
||||
#include "envDefs.h"
|
||||
#include "osiSock.h"
|
||||
|
||||
#include "libCaAPI.h"
|
||||
@@ -23,7 +23,7 @@ LIBCA_API void epicsStdCall configureChannelAccessAddressList
|
||||
( struct ELLLIST *pList, SOCKET sock, unsigned short port );
|
||||
|
||||
LIBCA_API int epicsStdCall addAddrToChannelAccessAddressList
|
||||
( struct ELLLIST *pList, const ENV_PARAM *pEnv,
|
||||
( struct ELLLIST *pList, const ENV_PARAM *pEnv,
|
||||
unsigned short port, int ignoreNonDefaultPort );
|
||||
|
||||
LIBCA_API void epicsStdCall printChannelAccessAddressList
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_autoPtrFreeList_H
|
||||
@@ -46,7 +46,7 @@ private:
|
||||
};
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
inline autoPtrFreeList < T, N, MUTEX >::autoPtrFreeList (
|
||||
inline autoPtrFreeList < T, N, MUTEX >::autoPtrFreeList (
|
||||
tsFreeList < T, N, MUTEX > & freeListIn, T * pIn ) :
|
||||
p ( pIn ), freeList ( freeListIn ) {}
|
||||
|
||||
|
||||
@@ -5,22 +5,22 @@
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef autoPtrRecycleh
|
||||
@@ -29,7 +29,7 @@
|
||||
template < class T >
|
||||
class autoPtrRecycle {
|
||||
public:
|
||||
autoPtrRecycle (
|
||||
autoPtrRecycle (
|
||||
epicsGuard < epicsMutex > &, chronIntIdResTable < baseNMIU > &,
|
||||
cacRecycle &, T * );
|
||||
~autoPtrRecycle ();
|
||||
@@ -43,12 +43,12 @@ private:
|
||||
chronIntIdResTable < baseNMIU > & ioTable;
|
||||
epicsGuard < epicsMutex > & guard;
|
||||
// not implemented
|
||||
autoPtrRecycle ( const autoPtrRecycle & );
|
||||
autoPtrRecycle & operator = ( const autoPtrRecycle & );
|
||||
autoPtrRecycle ( const autoPtrRecycle & );
|
||||
autoPtrRecycle & operator = ( const autoPtrRecycle & );
|
||||
};
|
||||
|
||||
template < class T >
|
||||
inline autoPtrRecycle<T>::autoPtrRecycle (
|
||||
inline autoPtrRecycle<T>::autoPtrRecycle (
|
||||
epicsGuard < epicsMutex > & guardIn, chronIntIdResTable < baseNMIU > & tbl,
|
||||
cacRecycle & rIn, T * pIn ) :
|
||||
p ( pIn ), r ( rIn ), ioTable ( tbl ), guard ( guardIn ) {}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -40,12 +40,12 @@
|
||||
* start up
|
||||
*
|
||||
* if creating this in response to a search reply
|
||||
* and not in response to a beacon then
|
||||
* and not in response to a beacon then
|
||||
* we set the beacon time stamp to
|
||||
* zero (so we can correctly compute the period
|
||||
* between the 1st and 2nd beacons)
|
||||
*/
|
||||
bhe::bhe ( epicsMutex & mutexIn, const epicsTime & initialTimeStamp,
|
||||
bhe::bhe ( epicsMutex & mutexIn, const epicsTime & initialTimeStamp,
|
||||
unsigned initialBeaconNumber, const inetAddrID & addr ) :
|
||||
inetAddrID ( addr ), timeStamp ( initialTimeStamp ), averagePeriod ( - DBL_MAX ),
|
||||
mutex ( mutexIn ), pIIU ( 0 ), lastBeaconNumber ( initialBeaconNumber )
|
||||
@@ -72,7 +72,7 @@ void bhe::beaconAnomalyNotify ( epicsGuard < epicsMutex > & guard )
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void bhe::logBeacon ( const char * pDiagnostic,
|
||||
void bhe::logBeacon ( const char * pDiagnostic,
|
||||
const double & currentPeriod,
|
||||
const epicsTime & currentTime )
|
||||
{
|
||||
@@ -80,10 +80,10 @@ void bhe::logBeacon ( const char * pDiagnostic,
|
||||
char name[64];
|
||||
this->name ( name, sizeof ( name ) );
|
||||
char date[64];
|
||||
currentTime.strftime ( date, sizeof ( date ),
|
||||
currentTime.strftime ( date, sizeof ( date ),
|
||||
"%a %b %d %Y %H:%M:%S.%f");
|
||||
::printf ( "%s cp=%g ap=%g %s %s\n",
|
||||
pDiagnostic, currentPeriod,
|
||||
pDiagnostic, currentPeriod,
|
||||
this->averagePeriod, name, date );
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ void bhe::logBeaconDiscard ( unsigned beaconAdvance,
|
||||
char name[64];
|
||||
this->name ( name, sizeof ( name ) );
|
||||
char date[64];
|
||||
currentTime.strftime ( date, sizeof ( date ),
|
||||
currentTime.strftime ( date, sizeof ( date ),
|
||||
"%a %b %d %Y %H:%M:%S.%f");
|
||||
::printf ( "bb %u %s %s\n",
|
||||
beaconAdvance, name, date );
|
||||
@@ -121,16 +121,16 @@ void bhe::logBeaconDiscard ( unsigned /* beaconAdvance */,
|
||||
*
|
||||
* updates beacon period, and looks for beacon anomalies
|
||||
*/
|
||||
bool bhe::updatePeriod (
|
||||
epicsGuard < epicsMutex > & guard, const epicsTime & programBeginTime,
|
||||
const epicsTime & currentTime, ca_uint32_t beaconNumber,
|
||||
bool bhe::updatePeriod (
|
||||
epicsGuard < epicsMutex > & guard, const epicsTime & programBeginTime,
|
||||
const epicsTime & currentTime, ca_uint32_t beaconNumber,
|
||||
unsigned protocolRevision )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
|
||||
//
|
||||
// this block is enetered if the beacon was created as a side effect of
|
||||
// creating a connection and so we dont yet know the first beacon time
|
||||
// creating a connection and so we dont yet know the first beacon time
|
||||
// and sequence number
|
||||
//
|
||||
if ( this->timeStamp == epicsTime () ) {
|
||||
@@ -140,7 +140,7 @@ bool bhe::updatePeriod (
|
||||
|
||||
this->beaconAnomalyNotify ( guard );
|
||||
|
||||
/*
|
||||
/*
|
||||
* this is the 1st beacon seen - the beacon time stamp
|
||||
* was not initialized during BHE create because
|
||||
* a TCP/IP connection created the beacon.
|
||||
@@ -165,15 +165,15 @@ bool bhe::updatePeriod (
|
||||
}
|
||||
this->lastBeaconNumber = beaconNumber;
|
||||
|
||||
// throw out sequence numbers just prior to, or the same as, the last one received
|
||||
// throw out sequence numbers just prior to, or the same as, the last one received
|
||||
// (this situation is probably caused by a temporary duplicate route )
|
||||
if ( beaconSeqAdvance == 0 || beaconSeqAdvance > ca_uint32_max - 256 ) {
|
||||
logBeaconDiscard ( beaconSeqAdvance, currentTime );
|
||||
return false;
|
||||
}
|
||||
|
||||
// throw out sequence numbers that jump forward by only a few numbers
|
||||
// (this situation is probably caused by a duplicate route
|
||||
// throw out sequence numbers that jump forward by only a few numbers
|
||||
// (this situation is probably caused by a duplicate route
|
||||
// or a beacon due to input queue overun)
|
||||
if ( beaconSeqAdvance > 1 && beaconSeqAdvance < 4 ) {
|
||||
logBeaconDiscard ( beaconSeqAdvance, currentTime );
|
||||
@@ -203,7 +203,7 @@ bool bhe::updatePeriod (
|
||||
/*
|
||||
* ignore beacons seen for the first time shortly after
|
||||
* init, but do not ignore beacons arriving with a short
|
||||
* period because the IOC was rebooted soon after the
|
||||
* period because the IOC was rebooted soon after the
|
||||
* client starts up.
|
||||
*/
|
||||
totalRunningTime = this->timeStamp - programBeginTime;
|
||||
@@ -215,24 +215,24 @@ bool bhe::updatePeriod (
|
||||
|
||||
/*
|
||||
* Is this an IOC seen because of a restored
|
||||
* network segment?
|
||||
* network segment?
|
||||
*
|
||||
* It may be possible to get false triggers here
|
||||
* It may be possible to get false triggers here
|
||||
* if the client is busy, but this does not cause
|
||||
* problems because the echo response will tell us
|
||||
* problems because the echo response will tell us
|
||||
* that the server is available
|
||||
*/
|
||||
if ( currentPeriod >= this->averagePeriod * 1.25 ) {
|
||||
|
||||
/*
|
||||
* trigger on any missing beacon
|
||||
/*
|
||||
* trigger on any missing beacon
|
||||
* if connected to this server
|
||||
*/
|
||||
*/
|
||||
this->beaconAnomalyNotify ( guard );
|
||||
|
||||
if ( currentPeriod >= this->averagePeriod * 3.25 ) {
|
||||
/*
|
||||
* trigger on any 3 contiguous missing beacons
|
||||
/*
|
||||
* trigger on any 3 contiguous missing beacons
|
||||
* if not connected to this server
|
||||
*/
|
||||
netChange = true;
|
||||
@@ -246,9 +246,9 @@ bool bhe::updatePeriod (
|
||||
* IOC reboots). Lower tolarance here because we
|
||||
* dont have to worry about lost beacons.
|
||||
*
|
||||
* It may be possible to get false triggers here
|
||||
* It may be possible to get false triggers here
|
||||
* if the client is busy, but this does not cause
|
||||
* problems because the echo response will tell us
|
||||
* problems because the echo response will tell us
|
||||
* that the server is available
|
||||
*/
|
||||
else if ( currentPeriod <= this->averagePeriod * 0.80 ) {
|
||||
@@ -257,14 +257,14 @@ bool bhe::updatePeriod (
|
||||
logBeacon ( "bal", currentPeriod, currentTime );
|
||||
}
|
||||
else if ( this->pIIU ) {
|
||||
// update state of health for active virtual circuits
|
||||
// update state of health for active virtual circuits
|
||||
// if the beacon looks ok
|
||||
this->pIIU->beaconArrivalNotify ( guard );
|
||||
logBeacon ( "vb", currentPeriod, currentTime );
|
||||
}
|
||||
|
||||
// update a running average period
|
||||
this->averagePeriod = currentPeriod * 0.125 +
|
||||
this->averagePeriod = currentPeriod * 0.125 +
|
||||
this->averagePeriod * 0.875;
|
||||
}
|
||||
|
||||
@@ -284,22 +284,22 @@ void bhe::show ( epicsGuard < epicsMutex > &, unsigned level ) const
|
||||
char host [64];
|
||||
this->name ( host, sizeof ( host ) );
|
||||
if ( this->averagePeriod == -DBL_MAX ) {
|
||||
::printf ( "CA beacon hash entry for %s <no period estimate>\n",
|
||||
::printf ( "CA beacon hash entry for %s <no period estimate>\n",
|
||||
host );
|
||||
}
|
||||
else {
|
||||
::printf ( "CA beacon hash entry for %s with period estimate %f\n",
|
||||
::printf ( "CA beacon hash entry for %s with period estimate %f\n",
|
||||
host, this->averagePeriod );
|
||||
}
|
||||
if ( level > 0u ) {
|
||||
char date[64];
|
||||
this->timeStamp.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S");
|
||||
::printf ( "\tbeacon number %u, on %s\n",
|
||||
::printf ( "\tbeacon number %u, on %s\n",
|
||||
this->lastBeaconNumber, date );
|
||||
}
|
||||
}
|
||||
|
||||
double bhe::period ( epicsGuard < epicsMutex > & guard ) const
|
||||
double bhe::period ( epicsGuard < epicsMutex > & guard ) const
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
return this->averagePeriod;
|
||||
@@ -311,14 +311,14 @@ epicsTime bhe::updateTime ( epicsGuard < epicsMutex > & guard ) const
|
||||
return this->timeStamp;
|
||||
}
|
||||
|
||||
void bhe::registerIIU (
|
||||
void bhe::registerIIU (
|
||||
epicsGuard < epicsMutex > & guard, tcpiiu & iiu )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
this->pIIU = & iiu;
|
||||
}
|
||||
|
||||
void bhe::unregisterIIU (
|
||||
void bhe::unregisterIIU (
|
||||
epicsGuard < epicsMutex > & guard, tcpiiu & iiu )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -70,13 +70,13 @@ private:
|
||||
tcpiiu * pIIU;
|
||||
ca_uint32_t lastBeaconNumber;
|
||||
void beaconAnomalyNotify ( epicsGuard < epicsMutex > & );
|
||||
void logBeacon ( const char * pDiagnostic,
|
||||
void logBeacon ( const char * pDiagnostic,
|
||||
const double & currentPeriod,
|
||||
const epicsTime & currentTime );
|
||||
void logBeaconDiscard ( unsigned beaconAdvance,
|
||||
const epicsTime & currentTime );
|
||||
bhe ( const bhe & );
|
||||
bhe & operator = ( const bhe & );
|
||||
bhe ( const bhe & );
|
||||
bhe & operator = ( const bhe & );
|
||||
LIBCA_API void operator delete ( void * );
|
||||
};
|
||||
|
||||
@@ -89,20 +89,20 @@ public:
|
||||
void release ( void * );
|
||||
private:
|
||||
tsFreeList < bhe, 0x100 > freeList;
|
||||
bheFreeStore ( const bheFreeStore & );
|
||||
bheFreeStore & operator = ( const bheFreeStore & );
|
||||
bheFreeStore ( const bheFreeStore & );
|
||||
bheFreeStore & operator = ( const bheFreeStore & );
|
||||
};
|
||||
|
||||
inline void * bhe::operator new ( size_t size,
|
||||
inline void * bhe::operator new ( size_t size,
|
||||
bheMemoryManager & mgr )
|
||||
{
|
||||
{
|
||||
return mgr.allocate ( size );
|
||||
}
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void bhe::operator delete ( void * pCadaver,
|
||||
inline void bhe::operator delete ( void * pCadaver,
|
||||
bheMemoryManager & mgr )
|
||||
{
|
||||
{
|
||||
mgr.release ( pCadaver );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -59,50 +59,50 @@ void caConnTest ( const char *pNameIn, unsigned channelCountIn, double delayIn )
|
||||
{
|
||||
unsigned iteration = 0u;
|
||||
int status;
|
||||
unsigned i;
|
||||
chid *pChans;
|
||||
unsigned i;
|
||||
chid *pChans;
|
||||
|
||||
channelCount = channelCountIn;
|
||||
|
||||
pChans = new chid [channelCount];
|
||||
|
||||
while ( 1 ) {
|
||||
|
||||
while ( 1 ) {
|
||||
connCount = 0u;
|
||||
subsequentConnect = false;
|
||||
begin = epicsTime::getCurrent ();
|
||||
|
||||
printf ( "initializing CA client library\n" );
|
||||
|
||||
status = ca_task_initialize();
|
||||
SEVCHK ( status, "CA init failed" );
|
||||
status = ca_task_initialize();
|
||||
SEVCHK ( status, "CA init failed" );
|
||||
|
||||
printf ( "creating channels\n" );
|
||||
|
||||
for ( i = 0u; i < channelCount; i++ ) {
|
||||
status = ca_search_and_connect ( pNameIn,
|
||||
for ( i = 0u; i < channelCount; i++ ) {
|
||||
status = ca_search_and_connect ( pNameIn,
|
||||
&pChans[i], caConnTestConnHandler, 0 );
|
||||
SEVCHK ( status, "CA search problems" );
|
||||
}
|
||||
SEVCHK ( status, "CA search problems" );
|
||||
}
|
||||
|
||||
printf ( "all channels were created\n" );
|
||||
|
||||
ca_pend_event ( delayIn );
|
||||
ca_pend_event ( delayIn );
|
||||
|
||||
if ( iteration & 1 ) {
|
||||
for ( i = 0u; i < channelCount; i++ ) {
|
||||
status = ca_clear_channel ( pChans[i] );
|
||||
SEVCHK ( status, "ca_clear_channel() problems" );
|
||||
}
|
||||
for ( i = 0u; i < channelCount; i++ ) {
|
||||
status = ca_clear_channel ( pChans[i] );
|
||||
SEVCHK ( status, "ca_clear_channel() problems" );
|
||||
}
|
||||
printf ( "all channels were destroyed\n" );
|
||||
}
|
||||
|
||||
printf ( "shutting down CA client library\n" );
|
||||
|
||||
status = ca_task_exit ();
|
||||
SEVCHK ( status, "task exit problems" );
|
||||
status = ca_task_exit ();
|
||||
SEVCHK ( status, "task exit problems" );
|
||||
|
||||
iteration++;
|
||||
}
|
||||
}
|
||||
|
||||
//delete [] pChans;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ extern "C" {
|
||||
enum appendNumberFlag {appendNumber, dontAppendNumber};
|
||||
int catime ( const char *channelName, unsigned channelCount, enum appendNumberFlag appNF );
|
||||
|
||||
int acctst ( const char *pname, unsigned logggingInterestLevel,
|
||||
unsigned channelCount, unsigned repetitionCount,
|
||||
int acctst ( const char *pname, unsigned logggingInterestLevel,
|
||||
unsigned channelCount, unsigned repetitionCount,
|
||||
enum ca_preemptive_callback_select select );
|
||||
|
||||
#define CATIME_OK 0
|
||||
|
||||
@@ -37,50 +37,50 @@ void caEventRate ( const char *pName, unsigned count )
|
||||
chid * pChidTable = new chid [ count ];
|
||||
|
||||
{
|
||||
printf ( "Connecting to CA Channel \"%s\" %u times.",
|
||||
printf ( "Connecting to CA Channel \"%s\" %u times.",
|
||||
pName, count );
|
||||
fflush ( stdout );
|
||||
|
||||
|
||||
epicsTime begin = epicsTime::getCurrent ();
|
||||
for ( unsigned i = 0u; i < count; i++ ) {
|
||||
int status = ca_search ( pName, & pChidTable[i] );
|
||||
SEVCHK ( status, NULL );
|
||||
}
|
||||
|
||||
|
||||
int status = ca_pend_io ( 10000.0 );
|
||||
if ( status != ECA_NORMAL ) {
|
||||
fprintf ( stderr, " not found.\n" );
|
||||
return;
|
||||
}
|
||||
epicsTime end = epicsTime::getCurrent ();
|
||||
|
||||
|
||||
printf ( " done(%f sec).\n", end - begin );
|
||||
}
|
||||
|
||||
{
|
||||
printf ( "Subscribing %u times.", count );
|
||||
fflush ( stdout );
|
||||
|
||||
|
||||
epicsTime begin = epicsTime::getCurrent ();
|
||||
for ( unsigned i = 0u; i < count; i++ ) {
|
||||
int addEventStatus = ca_add_event ( DBR_FLOAT,
|
||||
int addEventStatus = ca_add_event ( DBR_FLOAT,
|
||||
pChidTable[i], eventCallBack, &eventCount, NULL);
|
||||
SEVCHK ( addEventStatus, __FILE__ );
|
||||
}
|
||||
|
||||
|
||||
int status = ca_flush_io ();
|
||||
SEVCHK ( status, __FILE__ );
|
||||
|
||||
|
||||
epicsTime end = epicsTime::getCurrent ();
|
||||
|
||||
|
||||
printf ( " done(%f sec).\n", end - begin );
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
printf ( "Waiting for initial value events." );
|
||||
fflush ( stdout );
|
||||
|
||||
// let the first one go by
|
||||
|
||||
// let the first one go by
|
||||
epicsTime begin = epicsTime::getCurrent ();
|
||||
while ( eventCount < count ) {
|
||||
int status = ca_pend_event ( 0.01 );
|
||||
@@ -89,7 +89,7 @@ void caEventRate ( const char *pName, unsigned count )
|
||||
}
|
||||
}
|
||||
epicsTime end = epicsTime::getCurrent ();
|
||||
|
||||
|
||||
printf ( " done(%f sec).\n", end - begin );
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ void caEventRate ( const char *pName, unsigned count )
|
||||
double mean = X / N;
|
||||
double stdDev = sqrt ( XX / N - mean * mean );
|
||||
|
||||
printf ( "CA Event Rate (Hz): current %g mean %g std dev %g\n",
|
||||
printf ( "CA Event Rate (Hz): current %g mean %g std dev %g\n",
|
||||
Hz, mean, stdDev );
|
||||
|
||||
if ( samplePeriod < maxSamplePeriod ) {
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
#define capStrOf(A) #A
|
||||
#define capStrOfX(A) capStrOf ( A )
|
||||
|
||||
/*
|
||||
/*
|
||||
* CA protocol revision
|
||||
* TCP/UDP port number (bumped each major protocol change)
|
||||
* TCP/UDP port number (bumped each major protocol change)
|
||||
*/
|
||||
#define CA_MAJOR_PROTOCOL_REVISION 4
|
||||
#define CA_VERSION_STRING( MINOR_REVISION ) \
|
||||
@@ -29,7 +29,7 @@
|
||||
#define CA_UKN_MINOR_VERSION 0u /* unknown minor version */
|
||||
#define CA_MINIMUM_SUPPORTED_VERSION 4u
|
||||
# define CA_VSUPPORTED(MINOR) ((MINOR)>=CA_MINIMUM_SUPPORTED_VERSION)
|
||||
# define CA_V41(MINOR) ((MINOR)>=1u)
|
||||
# define CA_V41(MINOR) ((MINOR)>=1u)
|
||||
# define CA_V42(MINOR) ((MINOR)>=2u)
|
||||
# define CA_V43(MINOR) ((MINOR)>=3u)
|
||||
# define CA_V44(MINOR) ((MINOR)>=4u)
|
||||
@@ -44,8 +44,8 @@
|
||||
# define CA_V413(MINOR) ((MINOR)>=13u) /* Allow zero length in requests. */
|
||||
|
||||
/*
|
||||
* These port numbers are only used if the CA repeater and
|
||||
* CA server port numbers cant be obtained from the EPICS
|
||||
* These port numbers are only used if the CA repeater and
|
||||
* CA server port numbers cant be obtained from the EPICS
|
||||
* environment variables "EPICS_CA_REPEATER_PORT" and
|
||||
* "EPICS_CA_SERVER_PORT"
|
||||
*/
|
||||
@@ -53,8 +53,8 @@
|
||||
#define CA_SERVER_PORT (CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u)
|
||||
#define CA_REPEATER_PORT (CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u+1u)
|
||||
|
||||
/*
|
||||
* 1500 (max of ethernet and 802.{2,3} MTU) - 20(IP) - 8(UDP)
|
||||
/*
|
||||
* 1500 (max of ethernet and 802.{2,3} MTU) - 20(IP) - 8(UDP)
|
||||
* (the MTU of Ethernet is currently independent of its speed varient)
|
||||
*/
|
||||
#define ETHERNET_MAX_UDP ( 1500u - 20u - 8u )
|
||||
@@ -88,10 +88,10 @@ typedef ca_uint32_t caResId;
|
||||
#define CA_PROTO_SNAPSHOT 5u /* snapshot of the system */
|
||||
#define CA_PROTO_SEARCH 6u /* IOC channel search */
|
||||
#define CA_PROTO_BUILD 7u /* build - obsolete */
|
||||
#define CA_PROTO_EVENTS_OFF 8u /* flow control */
|
||||
#define CA_PROTO_EVENTS_ON 9u /* flow control */
|
||||
#define CA_PROTO_READ_SYNC 10u /* purge old reads */
|
||||
#define CA_PROTO_ERROR 11u /* an operation failed */
|
||||
#define CA_PROTO_EVENTS_OFF 8u /* flow control */
|
||||
#define CA_PROTO_EVENTS_ON 9u /* flow control */
|
||||
#define CA_PROTO_READ_SYNC 10u /* purge old reads */
|
||||
#define CA_PROTO_ERROR 11u /* an operation failed */
|
||||
#define CA_PROTO_CLEAR_CHANNEL 12u /* free chan resources */
|
||||
#define CA_PROTO_RSRV_IS_UP 13u /* CA server has joined the net */
|
||||
#define CA_PROTO_NOT_FOUND 14u /* channel not found */
|
||||
@@ -171,7 +171,7 @@ typedef struct ca_hdr {
|
||||
*/
|
||||
struct mon_info {
|
||||
ca_float32_t m_lval; /* low delta */
|
||||
ca_float32_t m_hval; /* high delta */
|
||||
ca_float32_t m_hval; /* high delta */
|
||||
ca_float32_t m_toval; /* period btween samples */
|
||||
ca_uint16_t m_mask; /* event select mask */
|
||||
ca_uint16_t m_pad; /* extend to 32 bits */
|
||||
|
||||
@@ -36,7 +36,7 @@ private:
|
||||
ca_uint8_t pri;
|
||||
};
|
||||
|
||||
inline caServerID::caServerID (
|
||||
inline caServerID::caServerID (
|
||||
const struct sockaddr_in & addrIn, unsigned priorityIn ) :
|
||||
addr ( addrIn ), pri ( static_cast <ca_uint8_t> ( priorityIn ) )
|
||||
{
|
||||
@@ -45,7 +45,7 @@ inline caServerID::caServerID (
|
||||
|
||||
inline bool caServerID::operator == ( const caServerID & rhs ) const
|
||||
{
|
||||
if ( this->addr.sin_addr.s_addr == rhs.addr.sin_addr.s_addr &&
|
||||
if ( this->addr.sin_addr.s_addr == rhs.addr.sin_addr.s_addr &&
|
||||
this->addr.sin_port == rhs.addr.sin_port &&
|
||||
this->pri == rhs.pri ) {
|
||||
return true;
|
||||
@@ -66,7 +66,7 @@ inline resTableIndex caServerID::hash () const
|
||||
index ^= this->addr.sin_port;
|
||||
index ^= this->addr.sin_port >> 8u;
|
||||
index ^= this->pri;
|
||||
return integerHash ( caServerMinIndexBitWidth,
|
||||
return integerHash ( caServerMinIndexBitWidth,
|
||||
caServerMaxIndexBitWidth, index );
|
||||
}
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
@@ -154,7 +154,7 @@ cac::cac (
|
||||
}
|
||||
|
||||
try {
|
||||
long status;
|
||||
long status;
|
||||
|
||||
/*
|
||||
* Certain os, such as HPUX, do not unblock a socket system call
|
||||
|
||||
@@ -72,8 +72,8 @@ public:
|
||||
void release ( void * );
|
||||
private:
|
||||
tsFreeList < comBuf, 0x20 > freeList;
|
||||
cacComBufMemoryManager ( const cacComBufMemoryManager & );
|
||||
cacComBufMemoryManager & operator = ( const cacComBufMemoryManager & );
|
||||
cacComBufMemoryManager ( const cacComBufMemoryManager & );
|
||||
cacComBufMemoryManager & operator = ( const cacComBufMemoryManager & );
|
||||
};
|
||||
|
||||
class notifyGuard {
|
||||
@@ -339,8 +339,8 @@ private:
|
||||
const char *pCtx, unsigned status );
|
||||
static const pExcepProtoStubTCP tcpExcepJumpTableCAC [];
|
||||
|
||||
cac ( const cac & );
|
||||
cac & operator = ( const cac & );
|
||||
cac ( const cac & );
|
||||
cac & operator = ( const cac & );
|
||||
|
||||
friend class tcpiiu;
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
\*************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -39,7 +39,7 @@ private:
|
||||
epicsSingleton < localHostName > :: reference
|
||||
_refLocalHostName;
|
||||
};
|
||||
|
||||
|
||||
static epicsThreadOnceId cacChannelIdOnce = EPICS_THREAD_ONCE_INIT;
|
||||
|
||||
const cacChannel::priLev cacChannel::priorityMax = 99u;
|
||||
@@ -53,63 +53,63 @@ cacChannel::~cacChannel ()
|
||||
{
|
||||
}
|
||||
|
||||
caAccessRights cacChannel::accessRights (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
caAccessRights cacChannel::accessRights (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
static caAccessRights ar ( true, true );
|
||||
return ar;
|
||||
}
|
||||
|
||||
unsigned cacChannel::searchAttempts (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
unsigned cacChannel::searchAttempts (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return 0u;
|
||||
}
|
||||
|
||||
double cacChannel::beaconPeriod (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
double cacChannel::beaconPeriod (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return - DBL_MAX;
|
||||
}
|
||||
|
||||
double cacChannel::receiveWatchdogDelay (
|
||||
double cacChannel::receiveWatchdogDelay (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return - DBL_MAX;
|
||||
}
|
||||
|
||||
bool cacChannel::ca_v42_ok (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cacChannel::connected (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CACChannelPrivate ::
|
||||
CACChannelPrivate ::
|
||||
CACChannelPrivate() :
|
||||
_refLocalHostName ( localHostNameCache.getReference () )
|
||||
{
|
||||
}
|
||||
|
||||
inline unsigned CACChannelPrivate ::
|
||||
inline unsigned CACChannelPrivate ::
|
||||
getHostName ( char * pBuf, unsigned bufLength )
|
||||
{
|
||||
return _refLocalHostName->getName ( pBuf, bufLength );
|
||||
}
|
||||
|
||||
inline const char * CACChannelPrivate ::
|
||||
|
||||
inline const char * CACChannelPrivate ::
|
||||
pHostName ()
|
||||
{
|
||||
return _refLocalHostName->pointer ();
|
||||
}
|
||||
|
||||
static CACChannelPrivate * pCACChannelPrivate = 0;
|
||||
|
||||
|
||||
// runs once only for each process
|
||||
extern "C" void cacChannelSetup ( void * )
|
||||
{
|
||||
@@ -117,7 +117,7 @@ extern "C" void cacChannelSetup ( void * )
|
||||
}
|
||||
|
||||
// the default is to assume that it is a locally hosted channel
|
||||
unsigned cacChannel::getHostName (
|
||||
unsigned cacChannel::getHostName (
|
||||
epicsGuard < epicsMutex > &,
|
||||
char * pBuf, unsigned bufLength ) const throw ()
|
||||
{
|
||||
|
||||
@@ -6,26 +6,26 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#include "iocinf.h"
|
||||
|
||||
#include "cacIO.h"
|
||||
|
||||
cacChannelNotify::~cacChannelNotify ()
|
||||
cacChannelNotify::~cacChannelNotify ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -28,11 +28,11 @@ cacContextNotify::~cacContextNotify ()
|
||||
{
|
||||
}
|
||||
|
||||
void cacContextNotify::callbackProcessingInitiateNotify ()
|
||||
void cacContextNotify::callbackProcessingInitiateNotify ()
|
||||
{
|
||||
}
|
||||
|
||||
void cacContextNotify::callbackProcessingCompleteNotify ()
|
||||
void cacContextNotify::callbackProcessingCompleteNotify ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_cacIO_H
|
||||
@@ -264,8 +264,8 @@ protected:
|
||||
|
||||
private:
|
||||
cacChannelNotify & callback;
|
||||
cacChannel ( const cacChannel & );
|
||||
cacChannel & operator = ( const cacChannel & );
|
||||
cacChannel ( const cacChannel & );
|
||||
cacChannel & operator = ( const cacChannel & );
|
||||
};
|
||||
|
||||
class LIBCA_API cacContext {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -72,8 +72,8 @@ typedef void caArh (struct access_rights_handler_args args);
|
||||
/* The conversion routine to call for each type */
|
||||
#define VALID_TYPE(TYPE) (((unsigned short)TYPE)<=LAST_BUFFER_TYPE)
|
||||
|
||||
/*
|
||||
* Arguments passed to event handlers and get/put call back handlers.
|
||||
/*
|
||||
* Arguments passed to event handlers and get/put call back handlers.
|
||||
*
|
||||
* The status field below is the CA ECA_XXX status of the requested
|
||||
* operation which is saved from when the operation was attempted in the
|
||||
@@ -84,7 +84,7 @@ typedef void caArh (struct access_rights_handler_args args);
|
||||
typedef struct event_handler_args {
|
||||
void *usr; /* user argument supplied with request */
|
||||
chanId chid; /* channel id */
|
||||
long type; /* the type of the item returned */
|
||||
long type; /* the type of the item returned */
|
||||
long count; /* the element count of the item returned */
|
||||
const void *dbr; /* a pointer to the item returned */
|
||||
int status; /* ECA_XXX status of the requested op from the server */
|
||||
@@ -122,8 +122,8 @@ typedef unsigned CA_SYNC_GID;
|
||||
#define CA_OP_CLEAR_EVENT 4
|
||||
#define CA_OP_OTHER 5
|
||||
|
||||
/*
|
||||
* used with connection_handler_args
|
||||
/*
|
||||
* used with connection_handler_args
|
||||
*/
|
||||
#define CA_OP_CONN_UP 6
|
||||
#define CA_OP_CONN_DOWN 7
|
||||
@@ -156,8 +156,8 @@ LIBCA_API unsigned epicsStdCall ca_read_access (chid chan);
|
||||
LIBCA_API unsigned epicsStdCall ca_write_access (chid chan);
|
||||
|
||||
/*
|
||||
* cs_ - `channel state'
|
||||
*
|
||||
* cs_ - `channel state'
|
||||
*
|
||||
* cs_never_conn valid chid, IOC not found
|
||||
* cs_prev_conn valid chid, IOC was found, but unavailable
|
||||
* cs_conn valid chid, IOC was found, still available
|
||||
@@ -172,7 +172,7 @@ LIBCA_API enum channel_state epicsStdCall ca_state (chid chan);
|
||||
/* Must be called once before calling any of the other routines */
|
||||
/************************************************************************/
|
||||
LIBCA_API int epicsStdCall ca_task_initialize (void);
|
||||
enum ca_preemptive_callback_select
|
||||
enum ca_preemptive_callback_select
|
||||
{ ca_disable_preemptive_callback, ca_enable_preemptive_callback };
|
||||
LIBCA_API int epicsStdCall
|
||||
ca_context_create (enum ca_preemptive_callback_select select);
|
||||
@@ -186,7 +186,7 @@ LIBCA_API void epicsStdCall ca_detach_context ();
|
||||
LIBCA_API int epicsStdCall ca_task_exit (void);
|
||||
LIBCA_API void epicsStdCall ca_context_destroy (void);
|
||||
|
||||
typedef unsigned capri;
|
||||
typedef unsigned capri;
|
||||
#define CA_PRIORITY_MAX 99
|
||||
#define CA_PRIORITY_MIN 0
|
||||
#define CA_PRIORITY_DEFAULT CA_PRIORITY_MIN
|
||||
@@ -199,7 +199,7 @@ typedef unsigned capri;
|
||||
* ca_create_channel ()
|
||||
*
|
||||
* pChanName R channel name string
|
||||
* pConnStateCallback R address of connection state change
|
||||
* pConnStateCallback R address of connection state change
|
||||
* callback function
|
||||
* pUserPrivate R placed in the channel's user private field
|
||||
* o can be fetched later by ca_puser(CHID)
|
||||
@@ -209,8 +209,8 @@ typedef unsigned capri;
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_create_channel
|
||||
(
|
||||
const char *pChanName,
|
||||
caCh *pConnStateCallback,
|
||||
const char *pChanName,
|
||||
caCh *pConnStateCallback,
|
||||
void *pUserPrivate,
|
||||
capri priority,
|
||||
chid *pChanID
|
||||
@@ -219,7 +219,7 @@ LIBCA_API int epicsStdCall ca_create_channel
|
||||
/*
|
||||
* ca_change_connection_event()
|
||||
*
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pfunc R address of connection call-back function
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_change_connection_event
|
||||
@@ -231,7 +231,7 @@ LIBCA_API int epicsStdCall ca_change_connection_event
|
||||
/*
|
||||
* ca_replace_access_rights_event ()
|
||||
*
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pfunc R address of access rights call-back function
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_replace_access_rights_event (
|
||||
@@ -245,7 +245,7 @@ LIBCA_API int epicsStdCall ca_replace_access_rights_event (
|
||||
* replace the default exception handler
|
||||
*
|
||||
* pfunc R address of exception call-back function
|
||||
* pArg R copy of this pointer passed to exception
|
||||
* pArg R copy of this pointer passed to exception
|
||||
* call-back function
|
||||
*/
|
||||
typedef void caExceptionHandler (struct exception_handler_args);
|
||||
@@ -272,10 +272,10 @@ LIBCA_API int epicsStdCall ca_clear_channel
|
||||
/*
|
||||
* ca_bput()
|
||||
*
|
||||
* WARNING: this copies the new value from a string (dbr_string_t)
|
||||
* WARNING: this copies the new value from a string (dbr_string_t)
|
||||
* (and not as an integer)
|
||||
*
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pValue R new channel value string copied from this location
|
||||
*/
|
||||
#define ca_bput(chan, pValue) \
|
||||
@@ -284,9 +284,9 @@ ca_array_put(DBR_STRING, 1u, chan, (const dbr_string_t *) (pValue))
|
||||
/*
|
||||
* ca_rput()
|
||||
*
|
||||
* WARNING: this copies the new value from a dbr_float_t
|
||||
* WARNING: this copies the new value from a dbr_float_t
|
||||
*
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pValue R new channel value copied from this location
|
||||
*/
|
||||
#define ca_rput(chan,pValue) \
|
||||
@@ -296,7 +296,7 @@ ca_array_put(DBR_FLOAT, 1u, chan, (const dbr_float_t *) pValue)
|
||||
* ca_put()
|
||||
*
|
||||
* type R data type from db_access.h
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pValue R new channel value copied from this location
|
||||
*/
|
||||
#define ca_put(type, chan, pValue) ca_array_put (type, 1u, chan, pValue)
|
||||
@@ -306,13 +306,13 @@ ca_array_put(DBR_FLOAT, 1u, chan, (const dbr_float_t *) pValue)
|
||||
*
|
||||
* type R data type from db_access.h
|
||||
* count R array element count
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pValue R new channel value copied from this location
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_array_put
|
||||
(
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chid chanId,
|
||||
const void * pValue
|
||||
);
|
||||
@@ -320,8 +320,8 @@ LIBCA_API int epicsStdCall ca_array_put
|
||||
/*
|
||||
* ca_array_put_callback()
|
||||
*
|
||||
* This routine functions identically to the original ca put request
|
||||
* with the addition of a callback to the user supplied function
|
||||
* This routine functions identically to the original ca put request
|
||||
* with the addition of a callback to the user supplied function
|
||||
* after recod processing completes in the IOC. The arguments
|
||||
* to the user supplied callback function are declared in
|
||||
* the structure event_handler_args and include the pointer
|
||||
@@ -329,15 +329,15 @@ LIBCA_API int epicsStdCall ca_array_put
|
||||
*
|
||||
* type R data type from db_access.h
|
||||
* count R array element count
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pValue R new channel value copied from this location
|
||||
* pFunc R pointer to call-back function
|
||||
* pArg R copy of this pointer passed to pFunc
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_array_put_callback
|
||||
(
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chid chanId,
|
||||
const void * pValue,
|
||||
caEventCallBackFunc * pFunc,
|
||||
@@ -354,10 +354,10 @@ LIBCA_API int epicsStdCall ca_array_put_callback
|
||||
/*
|
||||
* ca_bget()
|
||||
*
|
||||
* WARNING: this copies the new value into a string (dbr_string_t)
|
||||
* WARNING: this copies the new value into a string (dbr_string_t)
|
||||
* (and not into an integer)
|
||||
*
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pValue W channel value copied to this location
|
||||
*/
|
||||
#define ca_bget(chan, pValue) \
|
||||
@@ -366,9 +366,9 @@ ca_array_get(DBR_STRING, 1u, chan, (dbr_string_t *)(pValue))
|
||||
/*
|
||||
* ca_rget()
|
||||
*
|
||||
* WARNING: this copies the new value into a 32 bit float (dbr_float_t)
|
||||
* WARNING: this copies the new value into a 32 bit float (dbr_float_t)
|
||||
*
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pValue W channel value copied to this location
|
||||
*/
|
||||
#define ca_rget(chan, pValue) \
|
||||
@@ -378,7 +378,7 @@ ca_array_get(DBR_FLOAT, 1u, chan, (dbr_float_t *)(pValue))
|
||||
* ca_rget()
|
||||
*
|
||||
* type R data type from db_access.h
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pValue W channel value copied to this location
|
||||
*/
|
||||
#define ca_get(type, chan, pValue) ca_array_get(type, 1u, chan, pValue)
|
||||
@@ -388,13 +388,13 @@ ca_array_get(DBR_FLOAT, 1u, chan, (dbr_float_t *)(pValue))
|
||||
*
|
||||
* type R data type from db_access.h
|
||||
* count R array element count
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pValue W channel value copied to this location
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_array_get
|
||||
(
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chid chanId,
|
||||
void * pValue
|
||||
);
|
||||
@@ -408,10 +408,10 @@ LIBCA_API int epicsStdCall ca_array_get
|
||||
/*
|
||||
* ca_bget_callback()
|
||||
*
|
||||
* WARNING: this returns the new value as a string (dbr_string_t)
|
||||
* WARNING: this returns the new value as a string (dbr_string_t)
|
||||
* (and not as an integer)
|
||||
*
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pFunc R pointer to call-back function
|
||||
* pArg R copy of this pointer passed to pFunc
|
||||
*/
|
||||
@@ -421,9 +421,9 @@ ca_array_get_callback (DBR_STRING, 1u, chan, pFunc, pArg)
|
||||
/*
|
||||
* ca_rget_callback()
|
||||
*
|
||||
* WARNING: this returns the new value as a float (dbr_float_t)
|
||||
* WARNING: this returns the new value as a float (dbr_float_t)
|
||||
*
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pFunc R pointer to call-back function
|
||||
* pArg R copy of this pointer passed to pFunc
|
||||
*/
|
||||
@@ -434,7 +434,7 @@ ca_array_get_callback (DBR_FLOAT, 1u, chan, pFunc, pArg)
|
||||
* ca_get_callback()
|
||||
*
|
||||
* type R data type from db_access.h
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pFunc R pointer to call-back function
|
||||
* pArg R copy of this pointer passed to pFunc
|
||||
*/
|
||||
@@ -446,14 +446,14 @@ ca_array_get_callback (type, 1u, chan, pFunc, pArg)
|
||||
*
|
||||
* type R data type from db_access.h
|
||||
* count R array element count
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pFunc R pointer to call-back function
|
||||
* pArg R copy of this pointer passed to pFunc
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_array_get_callback
|
||||
(
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chid chanId,
|
||||
caEventCallBackFunc * pFunc,
|
||||
void * pArg
|
||||
@@ -465,7 +465,7 @@ LIBCA_API int epicsStdCall ca_array_get_callback
|
||||
/* NOTES: */
|
||||
/* 1) Evid may be omited by passing a NULL pointer */
|
||||
/* */
|
||||
/* 2) An array count of zero specifies the native db count */
|
||||
/* 2) An array count of zero specifies the native db count */
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
@@ -474,7 +474,7 @@ LIBCA_API int epicsStdCall ca_array_get_callback
|
||||
*
|
||||
* type R data type from db_access.h
|
||||
* count R array element count
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* mask R event mask - one of {DBE_VALUE, DBE_ALARM, DBE_LOG}
|
||||
* pFunc R pointer to call-back function
|
||||
* pArg R copy of this pointer passed to pFunc
|
||||
@@ -482,8 +482,8 @@ LIBCA_API int epicsStdCall ca_array_get_callback
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_create_subscription
|
||||
(
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chid chanId,
|
||||
long mask,
|
||||
caEventCallBackFunc * pFunc,
|
||||
@@ -524,24 +524,24 @@ LIBCA_API chid epicsStdCall ca_evid_to_chid ( evid id );
|
||||
/* FLOW OF TYPICAL APPLICATION */
|
||||
/* */
|
||||
/* search() ! Obtain Channel ids */
|
||||
/* . ! " */
|
||||
/* . ! " */
|
||||
/* . ! " */
|
||||
/* pend_io ! wait for channels to connect */
|
||||
/* */
|
||||
/* get() ! several requests for remote info */
|
||||
/* get() ! " */
|
||||
/* add_event() ! " */
|
||||
/* get() ! " */
|
||||
/* get() ! " */
|
||||
/* add_event() ! " */
|
||||
/* get() ! " */
|
||||
/* . */
|
||||
/* . */
|
||||
/* . */
|
||||
/* flush_io() ! send get requests */
|
||||
/* ! optional parallel processing */
|
||||
/* . ! " */
|
||||
/* . ! " */
|
||||
/* . ! " */
|
||||
/* . ! " */
|
||||
/* pend_io() ! wait for replies from get requests */
|
||||
/* . ! access to requested data */
|
||||
/* . ! " */
|
||||
/* . ! " */
|
||||
/* pend_event() ! wait for requested events */
|
||||
/* */
|
||||
/************************************************************************/
|
||||
@@ -551,7 +551,7 @@ LIBCA_API chid epicsStdCall ca_evid_to_chid ( evid id );
|
||||
/* functions specified with add_event when events occur. If the */
|
||||
/* timeout is specified as 0 an infinite timeout is assumed. */
|
||||
/* ca_flush_io() is called by this routine. If ca_pend_io () */
|
||||
/* is called when no IO is outstanding then it will return immediately */
|
||||
/* is called when no IO is outstanding then it will return immediately */
|
||||
/* without processing. */
|
||||
/************************************************************************/
|
||||
|
||||
@@ -566,8 +566,8 @@ LIBCA_API int epicsStdCall ca_pend_event (ca_real timeOut);
|
||||
/*
|
||||
* ca_pend_io()
|
||||
*
|
||||
* timeOut R wait for this delay in seconds but return early
|
||||
* if all get requests (or search requests with null
|
||||
* timeOut R wait for this delay in seconds but return early
|
||||
* if all get requests (or search requests with null
|
||||
* connection handler pointer have completed)
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_pend_io (ca_real timeOut);
|
||||
@@ -578,7 +578,7 @@ LIBCA_API int epicsStdCall ca_pend (ca_real timeout, int early);
|
||||
/*
|
||||
* ca_test_io()
|
||||
*
|
||||
* returns TRUE when get requests (or search requests with null
|
||||
* returns TRUE when get requests (or search requests with null
|
||||
* connection handler pointer) are outstanding
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_test_io (void);
|
||||
@@ -600,8 +600,8 @@ LIBCA_API int epicsStdCall ca_flush_io (void);
|
||||
*/
|
||||
LIBCA_API void epicsStdCall ca_signal
|
||||
(
|
||||
long errorCode,
|
||||
const char *pCtxStr
|
||||
long errorCode,
|
||||
const char *pCtxStr
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -614,10 +614,10 @@ LIBCA_API void epicsStdCall ca_signal
|
||||
*/
|
||||
LIBCA_API void epicsStdCall ca_signal_with_file_and_lineno
|
||||
(
|
||||
long errorCode,
|
||||
const char *pCtxStr,
|
||||
const char *pFileStr,
|
||||
int lineNo
|
||||
long errorCode,
|
||||
const char *pCtxStr,
|
||||
const char *pFileStr,
|
||||
int lineNo
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -646,7 +646,7 @@ LIBCA_API unsigned epicsStdCall ca_get_host_name ( chid pChan,
|
||||
/*
|
||||
* CA_ADD_FD_REGISTRATION
|
||||
*
|
||||
* call their function with their argument whenever
|
||||
* call their function with their argument whenever
|
||||
* a new fd is added or removed
|
||||
* (for use with a manager of the select system call under UNIX)
|
||||
*
|
||||
@@ -654,7 +654,7 @@ LIBCA_API unsigned epicsStdCall ca_get_host_name ( chid pChan,
|
||||
* if (!opened) then fd was deleted
|
||||
*
|
||||
*/
|
||||
typedef void CAFDHANDLER (void *parg, int fd, int opened);
|
||||
typedef void CAFDHANDLER (void *parg, int fd, int opened);
|
||||
|
||||
/*
|
||||
* ca_add_fd_registration()
|
||||
@@ -685,7 +685,7 @@ LIBCA_API int epicsStdCall ca_add_fd_registration
|
||||
*
|
||||
* create a sync group
|
||||
*
|
||||
* pgid W pointer to sync group id that will be written
|
||||
* pgid W pointer to sync group id that will be written
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_sg_create (CA_SYNC_GID * pgid);
|
||||
|
||||
@@ -694,16 +694,16 @@ LIBCA_API int epicsStdCall ca_sg_create (CA_SYNC_GID * pgid);
|
||||
*
|
||||
* delete a sync group
|
||||
*
|
||||
* gid R sync group id
|
||||
* gid R sync group id
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_sg_delete (const CA_SYNC_GID gid);
|
||||
|
||||
/*
|
||||
* ca_sg_block()
|
||||
*
|
||||
* block for IO performed within a sync group to complete
|
||||
* block for IO performed within a sync group to complete
|
||||
*
|
||||
* gid R sync group id
|
||||
* gid R sync group id
|
||||
* timeout R wait for this duration prior to timing out
|
||||
* and returning ECA_TIMEOUT
|
||||
*/
|
||||
@@ -715,7 +715,7 @@ LIBCA_API int epicsStdCall ca_sg_block (const CA_SYNC_GID gid, ca_real timeout);
|
||||
* test for sync group IO operations in progress
|
||||
*
|
||||
* gid R sync group id
|
||||
*
|
||||
*
|
||||
* returns one of ECA_BADSYNCGRP, ECA_IOINPROGRESS, ECA_IODONE
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_sg_test (const CA_SYNC_GID gid);
|
||||
@@ -736,16 +736,16 @@ LIBCA_API int epicsStdCall ca_sg_reset(const CA_SYNC_GID gid);
|
||||
* gid R sync group id
|
||||
* type R data type from db_access.h
|
||||
* count R array element count
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pValue W channel value copied to this location
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_sg_array_get
|
||||
(
|
||||
const CA_SYNC_GID gid,
|
||||
chtype type,
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chid chan,
|
||||
void *pValue
|
||||
void *pValue
|
||||
);
|
||||
|
||||
#define ca_sg_get(gid, type, chan, pValue) \
|
||||
@@ -760,16 +760,16 @@ ca_sg_array_get (gid, type, 1u, chan, pValue)
|
||||
* gid R sync group id
|
||||
* type R data type from db_access.h
|
||||
* count R array element count
|
||||
* chan R channel identifier
|
||||
* chan R channel identifier
|
||||
* pValue R new channel value copied from this location
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_sg_array_put
|
||||
(
|
||||
const CA_SYNC_GID gid,
|
||||
chtype type,
|
||||
chtype type,
|
||||
unsigned long count,
|
||||
chid chan,
|
||||
const void *pValue
|
||||
const void *pValue
|
||||
);
|
||||
|
||||
#define ca_sg_put(gid, type, chan, pValue) \
|
||||
@@ -790,11 +790,11 @@ LIBCA_API void epicsStdCall ca_dump_dbr (chtype type, unsigned count, const void
|
||||
/*
|
||||
* ca_v42_ok()
|
||||
*
|
||||
* Put call back is available if the CA server is on version is 4.2
|
||||
* Put call back is available if the CA server is on version is 4.2
|
||||
* or higher.
|
||||
*
|
||||
* chan R channel identifier
|
||||
*
|
||||
*
|
||||
* (returns true or false)
|
||||
*/
|
||||
LIBCA_API int epicsStdCall ca_v42_ok (chid chan);
|
||||
@@ -854,12 +854,12 @@ ca_build_and_connect(NAME, XXXXX, 1, CHIDPTR, YYYYY, 0, 0)
|
||||
#define ca_array_build(NAME,XXXXX, ZZZZZZ, CHIDPTR,YYYYY)\
|
||||
ca_build_and_connect(NAME, XXXXX, ZZZZZZ, CHIDPTR, YYYYY, 0, 0)
|
||||
LIBCA_API int epicsStdCall ca_build_and_connect
|
||||
( const char *pChanName, chtype, unsigned long,
|
||||
( const char *pChanName, chtype, unsigned long,
|
||||
chid * pChanID, void *, caCh * pFunc, void * pArg );
|
||||
#define ca_search(pChanName, pChanID)\
|
||||
ca_search_and_connect (pChanName, pChanID, 0, 0)
|
||||
LIBCA_API int epicsStdCall ca_search_and_connect
|
||||
( const char * pChanName, chid * pChanID,
|
||||
( const char * pChanName, chid * pChanID,
|
||||
caCh *pFunc, void * pArg );
|
||||
LIBCA_API int epicsStdCall ca_channel_status (epicsThreadId tid);
|
||||
LIBCA_API int epicsStdCall ca_clear_event ( evid eventID );
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* Author: Jeffrey O. Hill
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
#ifndef INC_caerr_H
|
||||
@@ -69,9 +69,9 @@
|
||||
(CA_INSERT_MSG_NO(NUMBER) | CA_INSERT_SEVERITY(SEVERITY))
|
||||
|
||||
/*
|
||||
* In the lines below "defunct" indicates that current release
|
||||
* In the lines below "defunct" indicates that current release
|
||||
* servers and client library will not return this error code, but
|
||||
* servers on earlier releases that communicate with current clients
|
||||
* servers on earlier releases that communicate with current clients
|
||||
* might still generate exceptions with these error constants
|
||||
*/
|
||||
#define ECA_NORMAL DEFMSG(CA_K_SUCCESS, 0) /* success */
|
||||
@@ -80,10 +80,10 @@
|
||||
#define ECA_UKNSERV DEFMSG(CA_K_ERROR, 3) /* defunct */
|
||||
#define ECA_SOCK DEFMSG(CA_K_ERROR, 4) /* defunct */
|
||||
#define ECA_CONN DEFMSG(CA_K_WARNING, 5) /* defunct */
|
||||
#define ECA_ALLOCMEM DEFMSG(CA_K_WARNING, 6)
|
||||
#define ECA_ALLOCMEM DEFMSG(CA_K_WARNING, 6)
|
||||
#define ECA_UKNCHAN DEFMSG(CA_K_WARNING, 7) /* defunct */
|
||||
#define ECA_UKNFIELD DEFMSG(CA_K_WARNING, 8) /* defunct */
|
||||
#define ECA_TOLARGE DEFMSG(CA_K_WARNING, 9)
|
||||
#define ECA_TOLARGE DEFMSG(CA_K_WARNING, 9)
|
||||
#define ECA_TIMEOUT DEFMSG(CA_K_WARNING, 10)
|
||||
#define ECA_NOSUPPORT DEFMSG(CA_K_WARNING, 11) /* defunct */
|
||||
#define ECA_STRTOBIG DEFMSG(CA_K_WARNING, 12) /* defunct */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#ifndef INCLcaeventmaskh
|
||||
@@ -13,12 +13,12 @@
|
||||
|
||||
/*
|
||||
event selections
|
||||
(If any more than 8 of these are needed then update the
|
||||
select field in the event_block struct in db_event.c from
|
||||
(If any more than 8 of these are needed then update the
|
||||
select field in the event_block struct in db_event.c from
|
||||
unsigned char to unsigned short)
|
||||
|
||||
|
||||
DBE_VALUE
|
||||
DBE_VALUE
|
||||
Trigger an event when a significant change in the channel's value
|
||||
occurs. Relies on the monitor deadband field under DCT.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
|
||||
|
||||
#include "envDefs.h"
|
||||
#include "envDefs.h"
|
||||
#include "errlog.h"
|
||||
#include "osiWireFormat.h"
|
||||
|
||||
@@ -39,8 +39,8 @@ public:
|
||||
void release ( void * );
|
||||
private:
|
||||
tsFreeList < class bhe, 0x100 > freeList;
|
||||
bheFreeStoreMgr ( const bheFreeStoreMgr & );
|
||||
bheFreeStoreMgr & operator = ( const bheFreeStoreMgr & );
|
||||
bheFreeStoreMgr ( const bheFreeStoreMgr & );
|
||||
bheFreeStoreMgr & operator = ( const bheFreeStoreMgr & );
|
||||
};
|
||||
|
||||
void * bheFreeStoreMgr::allocate ( size_t size )
|
||||
@@ -107,7 +107,7 @@ int main ( int argc, char ** argv )
|
||||
sock = epicsSocketCreate ( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
|
||||
if ( sock == INVALID_SOCKET ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
errlogPrintf ("casw: unable to create datagram socket because = \"%s\"\n",
|
||||
sockErrBuf );
|
||||
@@ -121,7 +121,7 @@ int main ( int argc, char ** argv )
|
||||
status = bind ( sock, &addr.sa, sizeof (addr) );
|
||||
if ( status < 0 ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
epicsSocketDestroy ( sock );
|
||||
errlogPrintf ( "casw: unable to bind to an unconstrained address because = \"%s\"\n",
|
||||
@@ -133,7 +133,7 @@ int main ( int argc, char ** argv )
|
||||
status = socket_ioctl ( sock, FIONBIO, &yes );
|
||||
if ( status < 0 ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
epicsSocketDestroy ( sock );
|
||||
errlogPrintf ( "casw: unable to set socket to nonblocking state because \"%s\"\n",
|
||||
@@ -168,7 +168,7 @@ int main ( int argc, char ** argv )
|
||||
status = socket_ioctl ( sock, FIONBIO, &no );
|
||||
if ( status < 0 ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
epicsSocketDestroy ( sock );
|
||||
errlogPrintf ( "casw: unable to set socket to blocking state because \"%s\"\n",
|
||||
@@ -184,7 +184,7 @@ int main ( int argc, char ** argv )
|
||||
&addr.sa, &addrSize );
|
||||
if ( status <= 0 ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
epicsSocketDestroy ( sock );
|
||||
errlogPrintf ("casw: error from recv was = \"%s\"\n",
|
||||
@@ -195,7 +195,7 @@ int main ( int argc, char ** argv )
|
||||
if ( addr.sa.sa_family != AF_INET ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
unsigned byteCount = static_cast <unsigned> ( status );
|
||||
pCurMsg = reinterpret_cast < const caHdr * > ( ( pCurBuf = buf ) );
|
||||
while ( byteCount ) {
|
||||
@@ -212,9 +212,9 @@ int main ( int argc, char ** argv )
|
||||
epicsTime previousTime;
|
||||
struct sockaddr_in ina;
|
||||
|
||||
/*
|
||||
/*
|
||||
* this allows a fan-out server to potentially
|
||||
* insert the true address of the CA server
|
||||
* insert the true address of the CA server
|
||||
*
|
||||
* old servers:
|
||||
* 1) set this field to one of the ip addresses of the host _or_
|
||||
@@ -251,8 +251,8 @@ int main ( int argc, char ** argv )
|
||||
bhe *pBHE = beaconTable.lookup ( ina );
|
||||
if ( pBHE ) {
|
||||
previousTime = pBHE->updateTime ( guard );
|
||||
anomaly = pBHE->updatePeriod (
|
||||
guard, programBeginTime,
|
||||
anomaly = pBHE->updatePeriod (
|
||||
guard, programBeginTime,
|
||||
currentTime, beaconNumber, protocolRevision );
|
||||
}
|
||||
else {
|
||||
@@ -263,7 +263,7 @@ int main ( int argc, char ** argv )
|
||||
* time that we have seen a server's beacon
|
||||
* shortly after the program started up)
|
||||
*/
|
||||
pBHE = new ( bheFreeList )
|
||||
pBHE = new ( bheFreeList )
|
||||
bhe ( mutex, currentTime, beaconNumber, ina );
|
||||
if ( pBHE ) {
|
||||
if ( beaconTable.add ( *pBHE ) < 0 ) {
|
||||
@@ -274,7 +274,7 @@ int main ( int argc, char ** argv )
|
||||
}
|
||||
if ( anomaly || interest > 1 ) {
|
||||
char date[64];
|
||||
currentTime.strftime ( date, sizeof ( date ),
|
||||
currentTime.strftime ( date, sizeof ( date ),
|
||||
"%Y-%m-%d %H:%M:%S.%09f");
|
||||
char host[64];
|
||||
ipAddrToA ( &ina, host, sizeof ( host ) );
|
||||
@@ -287,11 +287,11 @@ int main ( int argc, char ** argv )
|
||||
pPrefix = " ";
|
||||
}
|
||||
}
|
||||
printf ( "%s%-40s %s\n",
|
||||
printf ( "%s%-40s %s\n",
|
||||
pPrefix, host, date );
|
||||
if ( anomaly && interest > 0 ) {
|
||||
printf ( "\testimate=%f current=%f\n",
|
||||
pBHE->period ( guard ),
|
||||
printf ( "\testimate=%f current=%f\n",
|
||||
pBHE->period ( guard ),
|
||||
currentTime - previousTime );
|
||||
}
|
||||
fflush(stdout);
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
*
|
||||
* CA performance test
|
||||
* CA performance test
|
||||
*
|
||||
* History
|
||||
* History
|
||||
* joh 09-12-89 Initial release
|
||||
* joh 12-20-94 portability
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -45,7 +45,7 @@ typedef struct testItem {
|
||||
char name[128];
|
||||
int type;
|
||||
int count;
|
||||
void * pValue;
|
||||
void * pValue;
|
||||
} ti;
|
||||
|
||||
typedef void tf ( ti *pItems, unsigned iterations, unsigned *pInlineIter );
|
||||
@@ -144,7 +144,7 @@ unsigned *pInlineIter
|
||||
{
|
||||
int status;
|
||||
unsigned i;
|
||||
|
||||
|
||||
for (i=0u; i<iterations; i++) {
|
||||
status = ca_clear_channel (pItems[i].chix);
|
||||
SEVCHK (status, NULL);
|
||||
@@ -166,7 +166,7 @@ unsigned *pInlineIter
|
||||
ti *pi;
|
||||
int status;
|
||||
dbr_int_t val;
|
||||
|
||||
|
||||
for (pi=pItems; pi < &pItems[iterations]; pi++) {
|
||||
status = ca_array_put(
|
||||
pi->type,
|
||||
@@ -257,7 +257,7 @@ unsigned *pInlineIter
|
||||
{
|
||||
ti *pi;
|
||||
int status;
|
||||
|
||||
|
||||
for (pi=pItems; pi<&pItems[iterations]; pi++) {
|
||||
status = ca_array_get(
|
||||
pi->type,
|
||||
@@ -337,7 +337,7 @@ unsigned *pInlineIter
|
||||
{
|
||||
ti *pi;
|
||||
int status;
|
||||
|
||||
|
||||
for (pi=pItems; pi<&pItems[iterations]; pi++) {
|
||||
status = ca_array_get(
|
||||
pi->type,
|
||||
@@ -361,9 +361,9 @@ static void measure_get_latency (ti *pItems, unsigned iterations)
|
||||
epicsTimeStamp start_time;
|
||||
double delay;
|
||||
double X = 0u;
|
||||
double XX = 0u;
|
||||
double max = DBL_MIN;
|
||||
double min = DBL_MAX;
|
||||
double XX = 0u;
|
||||
double max = DBL_MIN;
|
||||
double min = DBL_MAX;
|
||||
double mean;
|
||||
double stdDev;
|
||||
ti *pi;
|
||||
@@ -371,7 +371,7 @@ static void measure_get_latency (ti *pItems, unsigned iterations)
|
||||
|
||||
for ( pi = pItems; pi < &pItems[iterations]; pi++ ) {
|
||||
epicsTimeGetCurrent ( &start_time );
|
||||
status = ca_array_get ( pi->type, pi->count,
|
||||
status = ca_array_get ( pi->type, pi->count,
|
||||
pi->chix, pi->pValue );
|
||||
SEVCHK ( status, NULL );
|
||||
status = ca_pend_io ( 100.0 );
|
||||
@@ -395,13 +395,13 @@ static void measure_get_latency (ti *pItems, unsigned iterations)
|
||||
|
||||
mean = X/iterations;
|
||||
stdDev = sqrt ( XX/iterations - mean*mean );
|
||||
printf (
|
||||
printf (
|
||||
"Get Latency - "
|
||||
"mean = %3.1f uS, "
|
||||
"std dev = %3.1f uS, "
|
||||
"min = %3.1f uS "
|
||||
"max = %3.1f uS\n",
|
||||
mean * 1e6, stdDev * 1e6,
|
||||
mean * 1e6, stdDev * 1e6,
|
||||
min * 1e6, max * 1e6 );
|
||||
}
|
||||
|
||||
@@ -412,9 +412,9 @@ static void printSearchStat ( const ti * pi, unsigned iterations )
|
||||
{
|
||||
unsigned i;
|
||||
double X = 0u;
|
||||
double XX = 0u;
|
||||
double max = DBL_MIN;
|
||||
double min = DBL_MAX;
|
||||
double XX = 0u;
|
||||
double max = DBL_MIN;
|
||||
double min = DBL_MAX;
|
||||
double mean;
|
||||
double stdDev;
|
||||
|
||||
@@ -432,7 +432,7 @@ static void printSearchStat ( const ti * pi, unsigned iterations )
|
||||
|
||||
mean = X / iterations;
|
||||
stdDev = sqrt( XX / iterations - mean * mean );
|
||||
printf (
|
||||
printf (
|
||||
"Search tries per chan - "
|
||||
"mean = %3.1f "
|
||||
"std dev = %3.1f "
|
||||
@@ -458,10 +458,10 @@ void timeIt ( tf *pfunc, ti *pItems, unsigned iterations,
|
||||
delay = epicsTimeDiffInSeconds ( &end_time, &start_time );
|
||||
if ( delay > 0.0 ) {
|
||||
double freq = ( iterations * inlineIter ) / delay;
|
||||
printf ( "Per Op, %8.4f uS ( %8.4f MHz )",
|
||||
printf ( "Per Op, %8.4f uS ( %8.4f MHz )",
|
||||
1e6 / freq, freq / 1e6 );
|
||||
if ( pItems != NULL ) {
|
||||
printf(", %8.4f snd Mbps, %8.4f rcv Mbps\n",
|
||||
printf(", %8.4f snd Mbps, %8.4f rcv Mbps\n",
|
||||
(inlineIter*nBytesSent*CHAR_BIT)/(delay*1e6),
|
||||
(inlineIter*nBytesRecv*CHAR_BIT)/(delay*1e6) );
|
||||
}
|
||||
@@ -479,13 +479,13 @@ static void test ( ti *pItems, unsigned iterations )
|
||||
unsigned payloadSize, dblPayloadSize;
|
||||
unsigned nBytesSent, nBytesRecv;
|
||||
|
||||
payloadSize =
|
||||
payloadSize =
|
||||
dbr_size_n ( pItems[0].type, pItems[0].count );
|
||||
payloadSize = CA_MESSAGE_ALIGN ( payloadSize );
|
||||
|
||||
dblPayloadSize = dbr_size [ DBR_DOUBLE ];
|
||||
dblPayloadSize = CA_MESSAGE_ALIGN ( dblPayloadSize );
|
||||
|
||||
|
||||
if ( payloadSize > dblPayloadSize ) {
|
||||
unsigned factor = payloadSize / dblPayloadSize;
|
||||
while ( factor ) {
|
||||
@@ -500,15 +500,15 @@ static void test ( ti *pItems, unsigned iterations )
|
||||
printf ( "\t### async put test ###\n");
|
||||
nBytesSent = sizeof ( caHdr ) + CA_MESSAGE_ALIGN( payloadSize );
|
||||
nBytesRecv = 0u;
|
||||
timeIt ( test_put, pItems, iterations,
|
||||
nBytesSent * iterations,
|
||||
timeIt ( test_put, pItems, iterations,
|
||||
nBytesSent * iterations,
|
||||
nBytesRecv * iterations );
|
||||
|
||||
printf ( "\t### async get test ###\n");
|
||||
nBytesSent = sizeof ( caHdr );
|
||||
nBytesRecv = sizeof ( caHdr ) + CA_MESSAGE_ALIGN ( payloadSize );
|
||||
timeIt ( test_get, pItems, iterations,
|
||||
nBytesSent * ( iterations ),
|
||||
timeIt ( test_get, pItems, iterations,
|
||||
nBytesSent * ( iterations ),
|
||||
nBytesRecv * ( iterations ) );
|
||||
|
||||
printf ("\t### synch get test ###\n");
|
||||
@@ -520,7 +520,7 @@ static void test ( ti *pItems, unsigned iterations )
|
||||
else if ( iterations > 10 ) {
|
||||
iterations /= 10;
|
||||
}
|
||||
timeIt ( test_wait, pItems, iterations,
|
||||
timeIt ( test_wait, pItems, iterations,
|
||||
nBytesSent * iterations,
|
||||
nBytesRecv * iterations );
|
||||
}
|
||||
@@ -528,7 +528,7 @@ static void test ( ti *pItems, unsigned iterations )
|
||||
/*
|
||||
* catime ()
|
||||
*/
|
||||
int catime ( const char * channelName,
|
||||
int catime ( const char * channelName,
|
||||
unsigned channelCount, enum appendNumberFlag appNF )
|
||||
{
|
||||
unsigned i;
|
||||
@@ -536,7 +536,7 @@ int catime ( const char * channelName,
|
||||
unsigned strsize;
|
||||
unsigned nBytesSent, nBytesRecv;
|
||||
ti *pItemList;
|
||||
|
||||
|
||||
if ( channelCount == 0 ) {
|
||||
printf ( "channel count was zero\n" );
|
||||
return 0;
|
||||
@@ -547,15 +547,15 @@ int catime ( const char * channelName,
|
||||
return -1;
|
||||
}
|
||||
|
||||
SEVCHK ( ca_context_create ( ca_disable_preemptive_callback ),
|
||||
SEVCHK ( ca_context_create ( ca_disable_preemptive_callback ),
|
||||
"Unable to initialize" );
|
||||
|
||||
if ( appNF == appendNumber ) {
|
||||
printf ( "Testing with %u channels named %snnn\n",
|
||||
printf ( "Testing with %u channels named %snnn\n",
|
||||
channelCount, channelName );
|
||||
}
|
||||
else {
|
||||
printf ( "Testing with %u channels named %s\n",
|
||||
printf ( "Testing with %u channels named %s\n",
|
||||
channelCount, channelName );
|
||||
}
|
||||
|
||||
@@ -573,7 +573,7 @@ int catime ( const char * channelName,
|
||||
pItemList[i].name[strsize]= '\0';
|
||||
pItemList[i].count = 0;
|
||||
pItemList[i].pValue = 0;
|
||||
nBytesSent += 2 * ( CA_MESSAGE_ALIGN ( strlen ( pItemList[i].name ) )
|
||||
nBytesSent += 2 * ( CA_MESSAGE_ALIGN ( strlen ( pItemList[i].name ) )
|
||||
+ sizeof (caHdr) );
|
||||
nBytesRecv += 2 * sizeof (caHdr);
|
||||
}
|
||||
@@ -582,7 +582,7 @@ int catime ( const char * channelName,
|
||||
printf ( "--------------------\n" );
|
||||
timeIt ( test_search, pItemList, channelCount, nBytesSent, nBytesRecv );
|
||||
printSearchStat ( pItemList, channelCount );
|
||||
|
||||
|
||||
for ( i = 0; i < channelCount; i++ ) {
|
||||
size_t count = ca_element_count ( pItemList[i].chix );
|
||||
size_t size = sizeof ( dbr_string_t ) * count;
|
||||
@@ -608,7 +608,7 @@ int catime ( const char * channelName,
|
||||
for ( j = 0; j < pItemList[i].count; j++ ) {
|
||||
pFltVal[j] = (dbr_float_t) val;
|
||||
}
|
||||
pItemList[i].type = DBR_FLOAT;
|
||||
pItemList[i].type = DBR_FLOAT;
|
||||
}
|
||||
printf ( "DBR_FLOAT Test\n" );
|
||||
printf ( "--------------\n" );
|
||||
@@ -621,13 +621,13 @@ int catime ( const char * channelName,
|
||||
for ( j = 0; j < pItemList[i].count; j++ ) {
|
||||
pDblVal[j] = (dbr_double_t) val;
|
||||
}
|
||||
pItemList[i].type = DBR_DOUBLE;
|
||||
pItemList[i].type = DBR_DOUBLE;
|
||||
}
|
||||
printf ( "DBR_DOUBLE Test\n" );
|
||||
printf ( "---------------\n" );
|
||||
test ( pItemList, channelCount );
|
||||
|
||||
|
||||
|
||||
for ( i = 0; i < channelCount; i++ ) {
|
||||
dbr_string_t * pStrVal = ( dbr_string_t * ) pItemList[i].pValue;
|
||||
double val = i;
|
||||
@@ -635,7 +635,7 @@ int catime ( const char * channelName,
|
||||
for ( j = 0; j < pItemList[i].count; j++ ) {
|
||||
sprintf ( pStrVal[j], "%f", val );
|
||||
}
|
||||
pItemList[i].type = DBR_STRING;
|
||||
pItemList[i].type = DBR_STRING;
|
||||
}
|
||||
printf ( "DBR_STRING Test\n" );
|
||||
printf ( "---------------\n" );
|
||||
@@ -648,7 +648,7 @@ int catime ( const char * channelName,
|
||||
for ( j = 0; j < pItemList[i].count; j++ ) {
|
||||
pIntVal[j] = (dbr_int_t) val;
|
||||
}
|
||||
pItemList[i].type = DBR_INT;
|
||||
pItemList[i].type = DBR_INT;
|
||||
}
|
||||
printf ( "DBR_INT Test\n" );
|
||||
printf ( "------------\n" );
|
||||
@@ -661,8 +661,8 @@ int catime ( const char * channelName,
|
||||
for ( j = 0; j < pItemList[i].count; j++ ) {
|
||||
pDblVal[j] = 0;
|
||||
}
|
||||
pItemList[i].type = DBR_DOUBLE;
|
||||
}
|
||||
pItemList[i].type = DBR_DOUBLE;
|
||||
}
|
||||
measure_get_latency ( pItemList, channelCount );
|
||||
|
||||
printf ( "Free Channel Test\n" );
|
||||
@@ -670,10 +670,10 @@ int catime ( const char * channelName,
|
||||
timeIt ( test_free, pItemList, channelCount, 0, 0 );
|
||||
|
||||
SEVCHK ( ca_task_exit (), "Unable to free resources at exit" );
|
||||
|
||||
|
||||
for ( i = 0; i < channelCount; i++ ) {
|
||||
free ( pItemList[i].pValue );
|
||||
}
|
||||
}
|
||||
|
||||
free ( pItemList );
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
*/
|
||||
|
||||
#include <stdexcept>
|
||||
@@ -32,7 +32,7 @@ bool comBuf::flushToWire ( wireSendAdapter & wire, const epicsTime & currentTime
|
||||
unsigned index = this->nextReadIndex;
|
||||
unsigned finalIndex = this->commitIndex;
|
||||
while ( index < finalIndex ) {
|
||||
unsigned nBytes = wire.sendBytes (
|
||||
unsigned nBytes = wire.sendBytes (
|
||||
&this->buf[index], finalIndex - index, currentTime );
|
||||
if ( nBytes == 0u ) {
|
||||
this->nextReadIndex = index;
|
||||
@@ -44,9 +44,9 @@ bool comBuf::flushToWire ( wireSendAdapter & wire, const epicsTime & currentTime
|
||||
return true;
|
||||
}
|
||||
|
||||
// throwing the exception from a function that isnt inline
|
||||
// throwing the exception from a function that isnt inline
|
||||
// shrinks the GNU compiled object code
|
||||
void comBuf::throwInsufficentBytesException ()
|
||||
void comBuf::throwInsufficentBytesException ()
|
||||
{
|
||||
throw comBuf::insufficentBytesAvailable ();
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
*/
|
||||
|
||||
#ifndef INC_comBuf_H
|
||||
@@ -39,23 +39,23 @@ static const unsigned comBufSize = 0x4000;
|
||||
class comBufMemoryManager {
|
||||
public:
|
||||
virtual ~comBufMemoryManager ();
|
||||
virtual void * allocate ( size_t ) = 0;
|
||||
virtual void release ( void * ) = 0;
|
||||
virtual void * allocate ( size_t ) = 0;
|
||||
virtual void release ( void * ) = 0;
|
||||
};
|
||||
|
||||
class wireSendAdapter {
|
||||
public:
|
||||
virtual unsigned sendBytes ( const void * pBuf,
|
||||
unsigned nBytesInBuf,
|
||||
virtual unsigned sendBytes ( const void * pBuf,
|
||||
unsigned nBytesInBuf,
|
||||
const class epicsTime & currentTime ) = 0;
|
||||
protected:
|
||||
virtual ~wireSendAdapter() {}
|
||||
};
|
||||
|
||||
enum swioCircuitState {
|
||||
swioConnected,
|
||||
swioPeerHangup,
|
||||
swioPeerAbort,
|
||||
enum swioCircuitState {
|
||||
swioConnected,
|
||||
swioPeerHangup,
|
||||
swioPeerAbort,
|
||||
swioLinkFailure,
|
||||
swioLocalAbort
|
||||
};
|
||||
@@ -66,7 +66,7 @@ struct statusWireIO {
|
||||
|
||||
class wireRecvAdapter {
|
||||
public:
|
||||
virtual void recvBytes ( void * pBuf,
|
||||
virtual void recvBytes ( void * pBuf,
|
||||
unsigned nBytesInBuf, statusWireIO & ) = 0;
|
||||
protected:
|
||||
virtual ~wireRecvAdapter() {}
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
template < class T >
|
||||
popStatus pop ( T & );
|
||||
static void throwInsufficentBytesException ();
|
||||
void * operator new ( size_t size,
|
||||
void * operator new ( size_t size,
|
||||
comBufMemoryManager & );
|
||||
epicsPlacementDeleteOperator (( void *, comBufMemoryManager & ))
|
||||
private:
|
||||
@@ -118,14 +118,14 @@ private:
|
||||
bool push ( const T * ); // disabled
|
||||
};
|
||||
|
||||
inline void * comBuf::operator new ( size_t size,
|
||||
inline void * comBuf::operator new ( size_t size,
|
||||
comBufMemoryManager & mgr )
|
||||
{
|
||||
return mgr.allocate ( size );
|
||||
}
|
||||
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void comBuf::operator delete ( void * pCadaver,
|
||||
inline void comBuf::operator delete ( void * pCadaver,
|
||||
comBufMemoryManager & mgr )
|
||||
{
|
||||
mgr.release ( pCadaver );
|
||||
@@ -161,8 +161,8 @@ inline unsigned comBuf :: uncommittedBytes () const
|
||||
|
||||
inline unsigned comBuf :: push ( comBuf & bufIn )
|
||||
{
|
||||
unsigned nBytes = this->copyInBytes (
|
||||
& bufIn.buf[ bufIn.nextReadIndex ],
|
||||
unsigned nBytes = this->copyInBytes (
|
||||
& bufIn.buf[ bufIn.nextReadIndex ],
|
||||
bufIn.commitIndex - bufIn.nextReadIndex );
|
||||
bufIn.nextReadIndex += nBytes;
|
||||
return nBytes;
|
||||
@@ -173,11 +173,11 @@ inline unsigned comBuf :: capacityBytes ()
|
||||
return comBufSize;
|
||||
}
|
||||
|
||||
inline void comBuf :: fillFromWire (
|
||||
inline void comBuf :: fillFromWire (
|
||||
wireRecvAdapter & wire, statusWireIO & stat )
|
||||
{
|
||||
wire.recvBytes (
|
||||
& this->buf[this->nextWriteIndex],
|
||||
wire.recvBytes (
|
||||
& this->buf[this->nextWriteIndex],
|
||||
sizeof ( this->buf ) - this->nextWriteIndex, stat );
|
||||
if ( stat.circuitState == swioConnected ) {
|
||||
this->nextWriteIndex += stat.bytesCopied;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
@@ -25,8 +25,8 @@
|
||||
#include "iocinf.h"
|
||||
#include "virtualCircuit.h"
|
||||
|
||||
comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ):
|
||||
comBufMemMgr ( comBufMemoryManagerIn ), nBytesPending ( 0u )
|
||||
comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ):
|
||||
comBufMemMgr ( comBufMemoryManagerIn ), nBytesPending ( 0u )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ void comQueRecv::popString ( epicsOldString *pStr )
|
||||
}
|
||||
|
||||
void comQueRecv::pushLastComBufReceived ( comBuf & bufIn )
|
||||
|
||||
|
||||
{
|
||||
bufIn.commitIncomming ();
|
||||
comBuf * pComBuf = this->bufs.last ();
|
||||
@@ -171,7 +171,7 @@ void comQueRecv::removeAndDestroyBuf ( comBuf & buf )
|
||||
this->comBufMemMgr.release ( & buf );
|
||||
}
|
||||
|
||||
epicsUInt8 comQueRecv::popUInt8 ()
|
||||
epicsUInt8 comQueRecv::popUInt8 ()
|
||||
{
|
||||
comBuf * pComBuf = this->bufs.first ();
|
||||
if ( ! pComBuf ) {
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_comQueRecv_H
|
||||
@@ -53,8 +53,8 @@ private:
|
||||
epicsUInt16 multiBufferPopUInt16 ();
|
||||
epicsUInt32 multiBufferPopUInt32 ();
|
||||
void removeAndDestroyBuf ( comBuf & );
|
||||
comQueRecv ( const comQueRecv & );
|
||||
comQueRecv & operator = ( const comQueRecv & );
|
||||
comQueRecv ( const comQueRecv & );
|
||||
comQueRecv & operator = ( const comQueRecv & );
|
||||
};
|
||||
|
||||
inline unsigned comQueRecv::occupiedBytes () const
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
*/
|
||||
|
||||
//
|
||||
@@ -34,7 +34,7 @@
|
||||
// a connection dropped.
|
||||
// 4) Do not allocate too much memory in exception situatons (such as
|
||||
// after a circuit disconnect).
|
||||
// 5) Avoid allocating more memory than is absolutely necessary to meet
|
||||
// 5) Avoid allocating more memory than is absolutely necessary to meet
|
||||
// the above requirements.
|
||||
// 6) Message fragments must never be sent to the IOC when there isnt
|
||||
// enough memory to queue part of a message (we also must not force
|
||||
@@ -43,7 +43,7 @@
|
||||
// protocol stream.
|
||||
//
|
||||
// Implementation:
|
||||
// 1) When queuing a complete message, first test to see if a flush is
|
||||
// 1) When queuing a complete message, first test to see if a flush is
|
||||
// required. If it is a receive thread scheduals the flush with the
|
||||
// send thread, and otherwise directly execute the system call. The
|
||||
// send thread must run at a higher priority than the receive thread
|
||||
@@ -51,14 +51,14 @@
|
||||
// 2) Preallocate space for the entire message prior to copying in the
|
||||
// message so that message fragments are not flushed out just prior
|
||||
// to detecting that memory is unavailable.
|
||||
// 3) Return a special error constant when the following situations
|
||||
// 3) Return a special error constant when the following situations
|
||||
// are detected when the user is attempting to queue a request
|
||||
// from within a user callback executed by a receive thread:
|
||||
// a) A user is queuing more requests that demand a response from a
|
||||
// a) A user is queuing more requests that demand a response from a
|
||||
// callback than are removed by the response that initiated the
|
||||
// callback, and this situation persists for many callbacks until
|
||||
// all buffering in the system is exausted.
|
||||
// b) A user is queuing many requests that demand a response from one
|
||||
// b) A user is queuing many requests that demand a response from one
|
||||
// callback until all buffering in the system is exausted.
|
||||
// c) Some combination of both (a) nad (b).
|
||||
//
|
||||
@@ -71,15 +71,15 @@
|
||||
#include "db_access.h" // for dbr_short_t etc
|
||||
|
||||
// nill message alignment pad bytes
|
||||
const char cacNillBytes [] =
|
||||
{
|
||||
const char cacNillBytes [] =
|
||||
{
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0
|
||||
};
|
||||
|
||||
comQueSend::comQueSend ( wireSendAdapter & wireIn,
|
||||
comQueSend::comQueSend ( wireSendAdapter & wireIn,
|
||||
comBufMemoryManager & comBufMemMgrIn ):
|
||||
comBufMemMgr ( comBufMemMgrIn ), wire ( wireIn ),
|
||||
comBufMemMgr ( comBufMemMgrIn ), wire ( wireIn ),
|
||||
nBytesPending ( 0u )
|
||||
{
|
||||
}
|
||||
@@ -89,7 +89,7 @@ comQueSend::~comQueSend ()
|
||||
this->clear ();
|
||||
}
|
||||
|
||||
void comQueSend::clear ()
|
||||
void comQueSend::clear ()
|
||||
{
|
||||
comBuf *pBuf;
|
||||
|
||||
@@ -179,32 +179,32 @@ const comQueSend::copyScalarFunc_t comQueSend::dbrCopyScalar [39] = {
|
||||
&comQueSend::copy_dbr_invalid // DBR_CLASS_NAME
|
||||
};
|
||||
|
||||
void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem )
|
||||
void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem )
|
||||
{
|
||||
this->push ( static_cast < const char * > ( pValue ), nElem * MAX_STRING_SIZE );
|
||||
}
|
||||
|
||||
void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem )
|
||||
void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem )
|
||||
{
|
||||
this->push ( static_cast <const dbr_short_t *> ( pValue ), nElem );
|
||||
}
|
||||
|
||||
void comQueSend::copy_dbr_float ( const void *pValue, unsigned nElem )
|
||||
void comQueSend::copy_dbr_float ( const void *pValue, unsigned nElem )
|
||||
{
|
||||
this->push ( static_cast <const dbr_float_t *> ( pValue ), nElem );
|
||||
}
|
||||
|
||||
void comQueSend::copy_dbr_char ( const void *pValue, unsigned nElem )
|
||||
void comQueSend::copy_dbr_char ( const void *pValue, unsigned nElem )
|
||||
{
|
||||
this->push ( static_cast <const dbr_char_t *> ( pValue ), nElem );
|
||||
}
|
||||
|
||||
void comQueSend::copy_dbr_long ( const void *pValue, unsigned nElem )
|
||||
void comQueSend::copy_dbr_long ( const void *pValue, unsigned nElem )
|
||||
{
|
||||
this->push ( static_cast <const dbr_long_t *> ( pValue ), nElem );
|
||||
}
|
||||
|
||||
void comQueSend::copy_dbr_double ( const void *pValue, unsigned nElem )
|
||||
void comQueSend::copy_dbr_double ( const void *pValue, unsigned nElem )
|
||||
{
|
||||
this->push ( static_cast <const dbr_double_t *> ( pValue ), nElem );
|
||||
}
|
||||
@@ -256,7 +256,7 @@ const comQueSend::copyVectorFunc_t comQueSend::dbrCopyVector [39] = {
|
||||
&comQueSend::copy_dbr_invalid // DBR_CLASS_NAME
|
||||
};
|
||||
|
||||
comBuf * comQueSend::popNextComBufToSend ()
|
||||
comBuf * comQueSend::popNextComBufToSend ()
|
||||
{
|
||||
comBuf *pBuf = this->bufs.get ();
|
||||
if ( pBuf ) {
|
||||
@@ -277,9 +277,9 @@ comBuf * comQueSend::popNextComBufToSend ()
|
||||
}
|
||||
|
||||
void comQueSend::insertRequestHeader (
|
||||
ca_uint16_t request, ca_uint32_t payloadSize,
|
||||
ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid,
|
||||
ca_uint32_t requestDependent, bool v49Ok )
|
||||
ca_uint16_t request, ca_uint32_t payloadSize,
|
||||
ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid,
|
||||
ca_uint32_t requestDependent, bool v49Ok )
|
||||
{
|
||||
if ( payloadSize < 0xffff && nElem < 0xffff ) {
|
||||
comBuf * pComBuf = this->bufs.last ();
|
||||
@@ -287,12 +287,12 @@ void comQueSend::insertRequestHeader (
|
||||
pComBuf = newComBuf ();
|
||||
this->pushComBuf ( *pComBuf );
|
||||
}
|
||||
pComBuf->push ( request );
|
||||
pComBuf->push ( static_cast < ca_uint16_t > ( payloadSize ) );
|
||||
pComBuf->push ( dataType );
|
||||
pComBuf->push ( static_cast < ca_uint16_t > ( nElem ) );
|
||||
pComBuf->push ( cid );
|
||||
pComBuf->push ( requestDependent );
|
||||
pComBuf->push ( request );
|
||||
pComBuf->push ( static_cast < ca_uint16_t > ( payloadSize ) );
|
||||
pComBuf->push ( dataType );
|
||||
pComBuf->push ( static_cast < ca_uint16_t > ( nElem ) );
|
||||
pComBuf->push ( cid );
|
||||
pComBuf->push ( requestDependent );
|
||||
}
|
||||
else if ( v49Ok ) {
|
||||
comBuf * pComBuf = this->bufs.last ();
|
||||
@@ -300,14 +300,14 @@ void comQueSend::insertRequestHeader (
|
||||
pComBuf = newComBuf ();
|
||||
this->pushComBuf ( *pComBuf );
|
||||
}
|
||||
pComBuf->push ( request );
|
||||
pComBuf->push ( static_cast < ca_uint16_t > ( 0xffff ) );
|
||||
pComBuf->push ( dataType );
|
||||
pComBuf->push ( static_cast < ca_uint16_t > ( 0u ) );
|
||||
pComBuf->push ( cid );
|
||||
pComBuf->push ( requestDependent );
|
||||
pComBuf->push ( payloadSize );
|
||||
pComBuf->push ( nElem );
|
||||
pComBuf->push ( request );
|
||||
pComBuf->push ( static_cast < ca_uint16_t > ( 0xffff ) );
|
||||
pComBuf->push ( dataType );
|
||||
pComBuf->push ( static_cast < ca_uint16_t > ( 0u ) );
|
||||
pComBuf->push ( cid );
|
||||
pComBuf->push ( requestDependent );
|
||||
pComBuf->push ( payloadSize );
|
||||
pComBuf->push ( nElem );
|
||||
}
|
||||
else {
|
||||
throw cacChannel::outOfBounds ();
|
||||
@@ -315,9 +315,9 @@ void comQueSend::insertRequestHeader (
|
||||
}
|
||||
|
||||
void comQueSend::insertRequestWithPayLoad (
|
||||
ca_uint16_t request, unsigned dataType, arrayElementCount nElem,
|
||||
ca_uint32_t cid, ca_uint32_t requestDependent,
|
||||
const void * pPayload, bool v49Ok )
|
||||
ca_uint16_t request, unsigned dataType, arrayElementCount nElem,
|
||||
ca_uint32_t cid, ca_uint32_t requestDependent,
|
||||
const void * pPayload, bool v49Ok )
|
||||
{
|
||||
if ( INVALID_DB_REQ ( dataType ) ) {
|
||||
throw cacChannel::badType ();
|
||||
@@ -335,16 +335,16 @@ void comQueSend::insertRequestWithPayLoad (
|
||||
throw cacChannel::outOfBounds();
|
||||
}
|
||||
payloadSize = CA_MESSAGE_ALIGN ( size );
|
||||
this->insertRequestHeader ( request, payloadSize,
|
||||
static_cast <ca_uint16_t> ( dataType ),
|
||||
this->insertRequestHeader ( request, payloadSize,
|
||||
static_cast <ca_uint16_t> ( dataType ),
|
||||
nElem, cid, requestDependent, v49Ok );
|
||||
this->pushString ( pStr, size );
|
||||
this->pushString ( pStr, size );
|
||||
}
|
||||
else {
|
||||
size = dbr_size[dataType];
|
||||
payloadSize = CA_MESSAGE_ALIGN ( size );
|
||||
this->insertRequestHeader ( request, payloadSize,
|
||||
static_cast <ca_uint16_t> ( dataType ),
|
||||
this->insertRequestHeader ( request, payloadSize,
|
||||
static_cast <ca_uint16_t> ( dataType ),
|
||||
nElem, cid, requestDependent, v49Ok );
|
||||
( this->*dbrCopyScalar [dataType] ) ( pPayload );
|
||||
}
|
||||
@@ -355,22 +355,22 @@ void comQueSend::insertRequestWithPayLoad (
|
||||
maxBytes = 0xffffffff;
|
||||
}
|
||||
else {
|
||||
maxBytes = MAX_TCP - sizeof ( caHdr );
|
||||
maxBytes = MAX_TCP - sizeof ( caHdr );
|
||||
}
|
||||
arrayElementCount maxElem =
|
||||
( maxBytes - sizeof (dbr_double_t) - dbr_size[dataType] ) /
|
||||
arrayElementCount maxElem =
|
||||
( maxBytes - sizeof (dbr_double_t) - dbr_size[dataType] ) /
|
||||
dbr_value_size[dataType];
|
||||
if ( nElem >= maxElem ) {
|
||||
throw cacChannel::outOfBounds();
|
||||
}
|
||||
// the above checks verify that the total size
|
||||
// is lest that 0xffffffff
|
||||
size = static_cast < ca_uint32_t >
|
||||
size = static_cast < ca_uint32_t >
|
||||
( dbr_size_n ( dataType, nElem ) );
|
||||
payloadSize = CA_MESSAGE_ALIGN ( size );
|
||||
this->insertRequestHeader ( request, payloadSize,
|
||||
static_cast <ca_uint16_t> ( dataType ),
|
||||
static_cast < ca_uint32_t > ( nElem ),
|
||||
this->insertRequestHeader ( request, payloadSize,
|
||||
static_cast <ca_uint16_t> ( dataType ),
|
||||
static_cast < ca_uint32_t > ( nElem ),
|
||||
cid, requestDependent, v49Ok );
|
||||
( this->*dbrCopyVector [dataType] ) ( pPayload, nElem );
|
||||
}
|
||||
@@ -381,7 +381,7 @@ void comQueSend::insertRequestWithPayLoad (
|
||||
}
|
||||
}
|
||||
|
||||
void comQueSend::commitMsg ()
|
||||
void comQueSend::commitMsg ()
|
||||
{
|
||||
while ( this->pFirstUncommited.valid() ) {
|
||||
this->nBytesPending += this->pFirstUncommited->uncommittedBytes ();
|
||||
|
||||
@@ -8,19 +8,19 @@
|
||||
\*************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_comQueSend_H
|
||||
@@ -38,7 +38,7 @@ template < class T > class epicsGuard;
|
||||
|
||||
class comQueSendMsgMinder {
|
||||
public:
|
||||
comQueSendMsgMinder (
|
||||
comQueSendMsgMinder (
|
||||
class comQueSend &, epicsGuard < epicsMutex > & );
|
||||
~comQueSendMsgMinder ();
|
||||
void commit ();
|
||||
@@ -55,20 +55,20 @@ public:
|
||||
comQueSend ( wireSendAdapter &, comBufMemoryManager & );
|
||||
~comQueSend ();
|
||||
void clear ();
|
||||
unsigned occupiedBytes () const;
|
||||
unsigned occupiedBytes () const;
|
||||
bool flushEarlyThreshold ( unsigned nBytesThisMsg ) const;
|
||||
bool flushBlockThreshold () const;
|
||||
bool flushBlockThreshold () const;
|
||||
void pushUInt16 ( const ca_uint16_t value );
|
||||
void pushUInt32 ( const ca_uint32_t value );
|
||||
void pushFloat32 ( const ca_float32_t value );
|
||||
void pushString ( const char *pVal, unsigned nChar );
|
||||
void insertRequestHeader (
|
||||
ca_uint16_t request, ca_uint32_t payloadSize,
|
||||
ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid,
|
||||
void insertRequestHeader (
|
||||
ca_uint16_t request, ca_uint32_t payloadSize,
|
||||
ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid,
|
||||
ca_uint32_t requestDependent, bool v49Ok );
|
||||
void insertRequestWithPayLoad (
|
||||
ca_uint16_t request, unsigned dataType, arrayElementCount nElem,
|
||||
ca_uint32_t cid, ca_uint32_t requestDependent,
|
||||
ca_uint16_t request, unsigned dataType, arrayElementCount nElem,
|
||||
ca_uint32_t cid, ca_uint32_t requestDependent,
|
||||
const void * pPayload, bool v49Ok );
|
||||
comBuf * popNextComBufToSend ();
|
||||
private:
|
||||
@@ -78,43 +78,43 @@ private:
|
||||
wireSendAdapter & wire;
|
||||
unsigned nBytesPending;
|
||||
|
||||
typedef void ( comQueSend::*copyScalarFunc_t ) (
|
||||
typedef void ( comQueSend::*copyScalarFunc_t ) (
|
||||
const void * pValue );
|
||||
static const copyScalarFunc_t dbrCopyScalar [comQueSendCopyDispatchSize];
|
||||
void copy_dbr_string ( const void * pValue );
|
||||
void copy_dbr_short ( const void * pValue );
|
||||
void copy_dbr_float ( const void * pValue );
|
||||
void copy_dbr_char ( const void * pValue );
|
||||
void copy_dbr_long ( const void * pValue );
|
||||
void copy_dbr_double ( const void * pValue );
|
||||
void copy_dbr_short ( const void * pValue );
|
||||
void copy_dbr_float ( const void * pValue );
|
||||
void copy_dbr_char ( const void * pValue );
|
||||
void copy_dbr_long ( const void * pValue );
|
||||
void copy_dbr_double ( const void * pValue );
|
||||
void copy_dbr_invalid ( const void * pValue );
|
||||
|
||||
typedef void ( comQueSend::*copyVectorFunc_t ) (
|
||||
typedef void ( comQueSend::*copyVectorFunc_t ) (
|
||||
const void * pValue, unsigned nElem );
|
||||
static const copyVectorFunc_t dbrCopyVector [comQueSendCopyDispatchSize];
|
||||
void copy_dbr_string ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_short ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_float ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_char ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_long ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_double ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_short ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_float ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_char ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_long ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_double ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_invalid ( const void * pValue, unsigned nElem );
|
||||
|
||||
void pushComBuf ( comBuf & );
|
||||
comBuf * newComBuf ();
|
||||
void pushComBuf ( comBuf & );
|
||||
comBuf * newComBuf ();
|
||||
|
||||
void beginMsg ();
|
||||
void commitMsg ();
|
||||
void beginMsg ();
|
||||
void commitMsg ();
|
||||
void clearUncommitedMsg ();
|
||||
|
||||
friend class comQueSendMsgMinder;
|
||||
|
||||
//
|
||||
// visual C++ versions 6 & 7 do not allow out of
|
||||
// visual C++ versions 6 & 7 do not allow out of
|
||||
// class member template function definition
|
||||
//
|
||||
template < class T >
|
||||
inline void push ( const T *pVal, const unsigned nElem )
|
||||
inline void push ( const T *pVal, const unsigned nElem )
|
||||
{
|
||||
comBuf * pLastBuf = this->bufs.last ();
|
||||
unsigned nCopied;
|
||||
@@ -126,18 +126,18 @@ private:
|
||||
}
|
||||
while ( nElem > nCopied ) {
|
||||
comBuf * pComBuf = newComBuf ();
|
||||
nCopied += pComBuf->push
|
||||
nCopied += pComBuf->push
|
||||
( &pVal[nCopied], nElem - nCopied );
|
||||
this->pushComBuf ( *pComBuf );
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// visual C++ versions 6 and 7 do not allow out of
|
||||
// visual C++ versions 6 and 7 do not allow out of
|
||||
// class member template function definition
|
||||
//
|
||||
template < class T >
|
||||
inline void push ( const T & val )
|
||||
inline void push ( const T & val )
|
||||
{
|
||||
comBuf * pComBuf = this->bufs.last ();
|
||||
if ( pComBuf && pComBuf->push ( val ) ) {
|
||||
@@ -158,8 +158,8 @@ private:
|
||||
|
||||
extern const char cacNillBytes[];
|
||||
|
||||
inline comQueSendMsgMinder::comQueSendMsgMinder (
|
||||
class comQueSend & sendQueIn, epicsGuard < epicsMutex > & ) :
|
||||
inline comQueSendMsgMinder::comQueSendMsgMinder (
|
||||
class comQueSend & sendQueIn, epicsGuard < epicsMutex > & ) :
|
||||
pSendQue ( & sendQueIn )
|
||||
{
|
||||
sendQueIn.beginMsg ();
|
||||
@@ -180,32 +180,32 @@ inline void comQueSendMsgMinder::commit ()
|
||||
}
|
||||
}
|
||||
|
||||
inline void comQueSend::beginMsg ()
|
||||
inline void comQueSend::beginMsg ()
|
||||
{
|
||||
this->pFirstUncommited = this->bufs.lastIter ();
|
||||
}
|
||||
|
||||
inline void comQueSend::pushUInt16 ( const ca_uint16_t value )
|
||||
inline void comQueSend::pushUInt16 ( const ca_uint16_t value )
|
||||
{
|
||||
this->push ( value );
|
||||
}
|
||||
|
||||
inline void comQueSend::pushUInt32 ( const ca_uint32_t value )
|
||||
inline void comQueSend::pushUInt32 ( const ca_uint32_t value )
|
||||
{
|
||||
this->push ( value );
|
||||
}
|
||||
|
||||
inline void comQueSend::pushFloat32 ( const ca_float32_t value )
|
||||
inline void comQueSend::pushFloat32 ( const ca_float32_t value )
|
||||
{
|
||||
this->push ( value );
|
||||
}
|
||||
|
||||
inline void comQueSend::pushString ( const char *pVal, unsigned nChar )
|
||||
inline void comQueSend::pushString ( const char *pVal, unsigned nChar )
|
||||
{
|
||||
this->push ( pVal, nChar );
|
||||
}
|
||||
|
||||
inline void comQueSend::pushComBuf ( comBuf & cb )
|
||||
inline void comQueSend::pushComBuf ( comBuf & cb )
|
||||
{
|
||||
this->bufs.add ( cb );
|
||||
if ( ! this->pFirstUncommited.valid() ) {
|
||||
@@ -213,7 +213,7 @@ inline void comQueSend::pushComBuf ( comBuf & cb )
|
||||
}
|
||||
}
|
||||
|
||||
inline unsigned comQueSend::occupiedBytes () const
|
||||
inline unsigned comQueSend::occupiedBytes () const
|
||||
{
|
||||
return this->nBytesPending;
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
* Author: D. Kersteins
|
||||
*
|
||||
*
|
||||
* NOTES:
|
||||
* NOTES:
|
||||
*
|
||||
* 1) All routines in this file have an encode argument which
|
||||
* determines if we are converting from the standard format to
|
||||
* the local format or vise versa. To date only float and double data
|
||||
* the local format or vise versa. To date only float and double data
|
||||
* types must be converted differently depending on the encode
|
||||
* argument - joh
|
||||
*
|
||||
@@ -44,38 +44,38 @@
|
||||
*
|
||||
* net format: big endian and IEEE float
|
||||
*/
|
||||
typedef void ( * CACVRTFUNCPTR ) (
|
||||
typedef void ( * CACVRTFUNCPTR ) (
|
||||
const void *pSrc, void *pDest, int hton, arrayElementCount count );
|
||||
|
||||
inline void dbr_htond (
|
||||
inline void dbr_htond (
|
||||
const dbr_double_t * pHost, dbr_double_t * pNet )
|
||||
{
|
||||
AlignedWireRef < epicsFloat64 > tmp ( *pNet );
|
||||
tmp = *pHost;
|
||||
}
|
||||
inline void dbr_ntohd (
|
||||
inline void dbr_ntohd (
|
||||
const dbr_double_t * pNet, dbr_double_t * pHost )
|
||||
{
|
||||
*pHost = AlignedWireRef < const epicsFloat64 > ( *pNet );
|
||||
}
|
||||
inline void dbr_htonf (
|
||||
inline void dbr_htonf (
|
||||
const dbr_float_t * pHost, dbr_float_t * pNet )
|
||||
{
|
||||
AlignedWireRef < epicsFloat32 > tmp ( *pNet );
|
||||
tmp = *pHost;
|
||||
}
|
||||
inline void dbr_ntohf (
|
||||
inline void dbr_ntohf (
|
||||
const dbr_float_t * pNet, dbr_float_t * pHost )
|
||||
{
|
||||
*pHost = AlignedWireRef < const epicsFloat32 > ( *pNet );
|
||||
}
|
||||
|
||||
inline epicsUInt16 dbr_ntohs( const epicsUInt16 & net )
|
||||
inline epicsUInt16 dbr_ntohs( const epicsUInt16 & net )
|
||||
{
|
||||
return AlignedWireRef < const epicsUInt16 > ( net );
|
||||
}
|
||||
|
||||
inline epicsUInt16 dbr_htons ( const epicsUInt16 & host )
|
||||
inline epicsUInt16 dbr_htons ( const epicsUInt16 & host )
|
||||
{
|
||||
epicsUInt16 tmp;
|
||||
AlignedWireRef < epicsUInt16 > awr ( tmp );
|
||||
@@ -101,7 +101,7 @@ inline epicsUInt32 dbr_htonl ( const epicsUInt32 & host )
|
||||
* otherwise vise-versa
|
||||
*
|
||||
* net format: big endian and IEEE float
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -120,7 +120,7 @@ arrayElementCount num /* number of values */
|
||||
/* convert "in place" -> nothing to do */
|
||||
if (s == d)
|
||||
return;
|
||||
memcpy ( pDest, pSrc, num*MAX_STRING_SIZE );
|
||||
memcpy ( pDest, pSrc, num*MAX_STRING_SIZE );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -232,7 +232,7 @@ arrayElementCount num /* number of values */
|
||||
*
|
||||
*
|
||||
* NOTES:
|
||||
* placing encode outside the loop results in more
|
||||
* placing encode outside the loop results in more
|
||||
* code but better performance.
|
||||
*
|
||||
*/
|
||||
@@ -289,10 +289,10 @@ arrayElementCount num /* number of values */
|
||||
** struct dbr_sts_string *d pointer to destination struct
|
||||
** int encode; boolean, if true vax to ieee
|
||||
** else ieee to vax
|
||||
**
|
||||
**
|
||||
** converts fields of struct in HOST format to NET format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -305,7 +305,7 @@ arrayElementCount num /* number of values */
|
||||
{
|
||||
struct dbr_sts_string *pSrc = (struct dbr_sts_string *) s;
|
||||
struct dbr_sts_string *pDest = (struct dbr_sts_string *) d;
|
||||
|
||||
|
||||
/* convert ieee to vax format or vax to ieee */
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
@@ -326,8 +326,8 @@ arrayElementCount num /* number of values */
|
||||
** else ieee to vax
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -359,10 +359,10 @@ arrayElementCount num /* number of values */
|
||||
** int encode; boolean, if true vax to ieee
|
||||
** else ieee to vax
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -385,10 +385,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_sts_double(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -416,9 +416,9 @@ arrayElementCount num /* number of values */
|
||||
** else ieee to vax
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_sts_enum(
|
||||
@@ -444,9 +444,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_gr_short()
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_gr_short(
|
||||
@@ -483,9 +483,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_gr_char()
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_gr_char(
|
||||
@@ -524,9 +524,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_gr_long()
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_gr_long(
|
||||
@@ -562,10 +562,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_gr_enum(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -597,10 +597,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_gr_double(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -661,10 +661,10 @@ arrayElementCount num /* number of values */
|
||||
** int encode; boolean, if true vax to ieee
|
||||
** else ieee to vax
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -728,9 +728,9 @@ arrayElementCount num /* number of values */
|
||||
** else ieee to vax
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_ctrl_short(
|
||||
@@ -770,9 +770,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_ctrl_long(s,d)
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_ctrl_long(
|
||||
@@ -812,9 +812,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_ctrl_short(s,d)
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_ctrl_char(
|
||||
@@ -831,7 +831,7 @@ arrayElementCount num /* number of values */
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
|
||||
if ( s == d )
|
||||
if ( s == d )
|
||||
return;
|
||||
|
||||
pDest->upper_disp_limit = pSrc->upper_disp_limit;
|
||||
@@ -851,10 +851,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_ctrl_double(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -917,10 +917,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_ctrl_float(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -982,10 +982,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_ctrl_enum(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1001,7 +1001,7 @@ arrayElementCount num /* number of values */
|
||||
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
pDest->no_str = dbr_ntohs(pSrc->no_str);
|
||||
pDest->no_str = dbr_ntohs(pSrc->no_str);
|
||||
if ( s != d ) {
|
||||
memcpy((void *)pDest->strs,(void *)pSrc->strs,sizeof(pSrc->strs));
|
||||
}
|
||||
@@ -1022,8 +1022,8 @@ arrayElementCount num /* number of values */
|
||||
** else ieee to vax
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1041,7 +1041,7 @@ arrayElementCount num /* number of values */
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
|
||||
if ( s == d )
|
||||
if ( s == d )
|
||||
return;
|
||||
|
||||
if (num == 1) /* single value */
|
||||
@@ -1056,8 +1056,8 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_sts_long(s,d)
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1086,10 +1086,10 @@ arrayElementCount num /* number of values */
|
||||
|
||||
/****************************************************************************
|
||||
** cvrt_time_string(s,d)
|
||||
**
|
||||
**
|
||||
** converts fields of struct in HOST format to NET format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1102,7 +1102,7 @@ arrayElementCount num /* number of values */
|
||||
{
|
||||
struct dbr_time_string *pSrc = (struct dbr_time_string *) s;
|
||||
struct dbr_time_string *pDest = (struct dbr_time_string *) d;
|
||||
|
||||
|
||||
/* convert ieee to vax format or vax to ieee */
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
@@ -1118,8 +1118,8 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_time_short(s,d)
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1150,10 +1150,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_time_float(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1178,10 +1178,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_time_double(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1209,9 +1209,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_time_enum(s,d)
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_time_enum(
|
||||
@@ -1239,8 +1239,8 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_sts_char(s,d)
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1260,7 +1260,7 @@ arrayElementCount num /* number of values */
|
||||
pDest->stamp.secPastEpoch = dbr_ntohl(pSrc->stamp.secPastEpoch);
|
||||
pDest->stamp.nsec = dbr_ntohl(pSrc->stamp.nsec);
|
||||
|
||||
if ( s == d )
|
||||
if ( s == d )
|
||||
return;
|
||||
|
||||
if (num == 1) /* single value */
|
||||
@@ -1274,8 +1274,8 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_time_long(s,d)
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1324,7 +1324,7 @@ arrayElementCount num /* number of values */
|
||||
for(i=0; i<num; i++){
|
||||
*pDest = dbr_ntohs( *pSrc );
|
||||
/*
|
||||
* dont increment these inside the MACRO
|
||||
* dont increment these inside the MACRO
|
||||
*/
|
||||
pDest++;
|
||||
pSrc++;
|
||||
@@ -1337,10 +1337,10 @@ arrayElementCount num /* number of values */
|
||||
** struct dbr_stsack_string *d pointer to destination struct
|
||||
** int encode; boolean, if true vax to ieee
|
||||
** else ieee to vax
|
||||
**
|
||||
**
|
||||
** converts fields of struct in HOST format to NET format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1353,7 +1353,7 @@ arrayElementCount num /* number of values */
|
||||
{
|
||||
struct dbr_stsack_string *pSrc = (struct dbr_stsack_string *) s;
|
||||
struct dbr_stsack_string *pDest = (struct dbr_stsack_string *) d;
|
||||
|
||||
|
||||
/* convert ieee to vax format or vax to ieee */
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
@@ -1409,7 +1409,7 @@ static CACVRTFUNCPTR cac_dbr_cvrt[] = {
|
||||
cvrt_ctrl_long,
|
||||
cvrt_ctrl_double,
|
||||
|
||||
cvrt_put_ackt,
|
||||
cvrt_put_ackt,
|
||||
cvrt_put_ackt, /* DBR_PUT_ACKS identical to DBR_PUT_ACKT */
|
||||
cvrt_stsack_string,
|
||||
cvrt_string
|
||||
@@ -1417,18 +1417,18 @@ static CACVRTFUNCPTR cac_dbr_cvrt[] = {
|
||||
|
||||
#endif /* EPICS_CONVERSION_REQUIRED */
|
||||
|
||||
int caNetConvert ( unsigned type, const void *pSrc, void *pDest,
|
||||
int caNetConvert ( unsigned type, const void *pSrc, void *pDest,
|
||||
int hton, arrayElementCount count )
|
||||
{
|
||||
# ifdef EPICS_CONVERSION_REQUIRED
|
||||
if ( type >= NELEMENTS ( cac_dbr_cvrt ) ) {
|
||||
return ECA_BADTYPE;
|
||||
}
|
||||
}
|
||||
( * cac_dbr_cvrt [ type ] ) ( pSrc, pDest, hton, count );
|
||||
# else
|
||||
if ( INVALID_DB_REQ ( type ) ) {
|
||||
return ECA_BADTYPE;
|
||||
}
|
||||
}
|
||||
if ( pSrc != pDest ) {
|
||||
memcpy ( pDest, pSrc, dbr_size_n ( type, count ) );
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
//
|
||||
//
|
||||
//
|
||||
// L O S A L A M O S
|
||||
// Los Alamos National Laboratory
|
||||
@@ -25,9 +25,9 @@
|
||||
|
||||
static const double disconnectGovernorPeriod = 10.0; // sec
|
||||
|
||||
disconnectGovernorTimer::disconnectGovernorTimer (
|
||||
disconnectGovernorNotify & iiuIn,
|
||||
epicsTimerQueue & queueIn,
|
||||
disconnectGovernorTimer::disconnectGovernorTimer (
|
||||
disconnectGovernorNotify & iiuIn,
|
||||
epicsTimerQueue & queueIn,
|
||||
epicsMutex & mutexIn ) :
|
||||
mutex ( mutexIn ), timer ( queueIn.createTimer () ),
|
||||
iiu ( iiuIn )
|
||||
@@ -56,18 +56,18 @@ void disconnectGovernorTimer::shutdown (
|
||||
}
|
||||
}
|
||||
while ( nciu * pChan = this->chanList.get () ) {
|
||||
pChan->channelNode::listMember =
|
||||
pChan->channelNode::listMember =
|
||||
channelNode::cs_none;
|
||||
pChan->serviceShutdownNotify ( cbGuard, guard );
|
||||
}
|
||||
}
|
||||
|
||||
epicsTimerNotify::expireStatus disconnectGovernorTimer::expire (
|
||||
epicsTimerNotify::expireStatus disconnectGovernorTimer::expire (
|
||||
const epicsTime & /* currentTime */ )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
while ( nciu * pChan = chanList.get () ) {
|
||||
pChan->channelNode::listMember =
|
||||
pChan->channelNode::listMember =
|
||||
channelNode::cs_none;
|
||||
this->iiu.govExpireNotify ( guard, *pChan );
|
||||
}
|
||||
@@ -81,14 +81,14 @@ void disconnectGovernorTimer::show ( unsigned level ) const
|
||||
this->chanList.count () );
|
||||
if ( level > 0u ) {
|
||||
tsDLIterConst < nciu > pChan = this->chanList.firstIter ();
|
||||
while ( pChan.valid () ) {
|
||||
while ( pChan.valid () ) {
|
||||
pChan->show ( level - 1u );
|
||||
pChan++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void disconnectGovernorTimer::installChan (
|
||||
void disconnectGovernorTimer::installChan (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// L O S A L A M O S
|
||||
// Los Alamos National Laboratory
|
||||
// Los Alamos, New Mexico 87545
|
||||
//
|
||||
//
|
||||
// Copyright, 1986, The Regents of the University of California.
|
||||
//
|
||||
//
|
||||
// Author Jeffrey O. Hill
|
||||
// johill@lanl.gov
|
||||
// 505 665 1831
|
||||
//
|
||||
//
|
||||
// Author Jeffrey O. Hill
|
||||
// johill@lanl.gov
|
||||
// 505 665 1831
|
||||
//
|
||||
|
||||
#ifndef INC_disconnectGovernorTimer_H
|
||||
@@ -36,22 +36,22 @@
|
||||
class disconnectGovernorNotify {
|
||||
public:
|
||||
virtual ~disconnectGovernorNotify () = 0;
|
||||
virtual void govExpireNotify (
|
||||
virtual void govExpireNotify (
|
||||
epicsGuard < epicsMutex > &, nciu & ) = 0;
|
||||
};
|
||||
|
||||
class disconnectGovernorTimer : private epicsTimerNotify {
|
||||
public:
|
||||
disconnectGovernorTimer (
|
||||
disconnectGovernorTimer (
|
||||
class disconnectGovernorNotify &, epicsTimerQueue &, epicsMutex & );
|
||||
virtual ~disconnectGovernorTimer ();
|
||||
void start ();
|
||||
void shutdown (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
void installChan (
|
||||
void installChan (
|
||||
epicsGuard < epicsMutex > &, nciu & );
|
||||
void uninstallChan (
|
||||
void uninstallChan (
|
||||
epicsGuard < epicsMutex > &, nciu & );
|
||||
void show ( unsigned level ) const;
|
||||
private:
|
||||
@@ -60,8 +60,8 @@ private:
|
||||
epicsTimer & timer;
|
||||
class disconnectGovernorNotify & iiu;
|
||||
epicsTimerNotify::expireStatus expire ( const epicsTime & currentTime );
|
||||
disconnectGovernorTimer ( const disconnectGovernorTimer & );
|
||||
disconnectGovernorTimer & operator = ( const disconnectGovernorTimer & );
|
||||
disconnectGovernorTimer ( const disconnectGovernorTimer & );
|
||||
disconnectGovernorTimer & operator = ( const disconnectGovernorTimer & );
|
||||
};
|
||||
|
||||
#endif // ifdef INC_disconnectGovernorTimer_H
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -17,8 +17,8 @@
|
||||
void event_handler (struct event_handler_args args);
|
||||
int evtime (char *pname);
|
||||
|
||||
static unsigned iteration_count;
|
||||
static epicsUInt32 last_time;
|
||||
static unsigned iteration_count;
|
||||
static epicsUInt32 last_time;
|
||||
|
||||
#ifndef iocCore
|
||||
int main(int argc, char **argv)
|
||||
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
|
||||
else{
|
||||
printf("usage: %s <channel name>", argv[0]);
|
||||
}
|
||||
return(0);
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -41,28 +41,28 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
int evtime(char *pname)
|
||||
{
|
||||
chid chan;
|
||||
int status;
|
||||
chid chan;
|
||||
int status;
|
||||
|
||||
status = ca_search(pname, &chan);
|
||||
SEVCHK(status, NULL);
|
||||
status = ca_search(pname, &chan);
|
||||
SEVCHK(status, NULL);
|
||||
|
||||
status = ca_pend_io(10.0);
|
||||
if(status != ECA_NORMAL){
|
||||
printf("%s not found\n", pname);
|
||||
return 0;
|
||||
}
|
||||
status = ca_pend_io(10.0);
|
||||
if(status != ECA_NORMAL){
|
||||
printf("%s not found\n", pname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
status = ca_add_event(
|
||||
DBR_FLOAT,
|
||||
chan,
|
||||
event_handler,
|
||||
NULL,
|
||||
NULL);
|
||||
SEVCHK(status, __FILE__);
|
||||
status = ca_add_event(
|
||||
DBR_FLOAT,
|
||||
chan,
|
||||
event_handler,
|
||||
NULL,
|
||||
NULL);
|
||||
SEVCHK(status, __FILE__);
|
||||
|
||||
status = ca_pend_event(0.0);
|
||||
SEVCHK(status, NULL);
|
||||
status = ca_pend_event(0.0);
|
||||
SEVCHK(status, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,24 +72,24 @@ int evtime(char *pname)
|
||||
*/
|
||||
void event_handler(struct event_handler_args args)
|
||||
{
|
||||
epicsUInt32 current_time;
|
||||
# define COUNT 0x8000
|
||||
double interval;
|
||||
double delay;
|
||||
epicsTimeStamp ts;
|
||||
epicsUInt32 current_time;
|
||||
# define COUNT 0x8000
|
||||
double interval;
|
||||
double delay;
|
||||
epicsTimeStamp ts;
|
||||
|
||||
if(iteration_count%COUNT == 0){
|
||||
epicsTimeGetCurrent(&ts);
|
||||
current_time = ts.secPastEpoch;
|
||||
if(last_time != 0){
|
||||
interval = current_time - last_time;
|
||||
delay = interval/COUNT;
|
||||
printf("Delay = %f sec per event\n",
|
||||
delay);
|
||||
}
|
||||
last_time = current_time;
|
||||
}
|
||||
if(iteration_count%COUNT == 0){
|
||||
epicsTimeGetCurrent(&ts);
|
||||
current_time = ts.secPastEpoch;
|
||||
if(last_time != 0){
|
||||
interval = current_time - last_time;
|
||||
delay = interval/COUNT;
|
||||
printf("Delay = %f sec per event\n",
|
||||
delay);
|
||||
}
|
||||
last_time = current_time;
|
||||
}
|
||||
|
||||
iteration_count++;
|
||||
iteration_count++;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "iocinf.h"
|
||||
#include "oldAccess.h"
|
||||
|
||||
getCallback::getCallback ( oldChannelNotify & chanIn,
|
||||
getCallback::getCallback ( oldChannelNotify & chanIn,
|
||||
caEventCallBackFunc *pFuncIn, void *pPrivateIn ) :
|
||||
chan ( chanIn ), pFunc ( pFuncIn ), pPrivate ( pPrivateIn )
|
||||
{
|
||||
@@ -63,7 +63,7 @@ void getCallback::completion (
|
||||
|
||||
void getCallback::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
int status, const char * /* pContext */,
|
||||
int status, const char * /* pContext */,
|
||||
unsigned type, arrayElementCount count )
|
||||
{
|
||||
if ( status != ECA_CHANDESTROY ) {
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
@@ -33,18 +33,18 @@
|
||||
#include "oldAccess.h"
|
||||
#include "cac.h"
|
||||
|
||||
getCopy::getCopy (
|
||||
epicsGuard < epicsMutex > & guard, ca_client_context & cacCtxIn,
|
||||
oldChannelNotify & chanIn, unsigned typeIn,
|
||||
getCopy::getCopy (
|
||||
epicsGuard < epicsMutex > & guard, ca_client_context & cacCtxIn,
|
||||
oldChannelNotify & chanIn, unsigned typeIn,
|
||||
arrayElementCount countIn, void * pValueIn ) :
|
||||
count ( countIn ), cacCtx ( cacCtxIn ), chan ( chanIn ), pValue ( pValueIn ),
|
||||
count ( countIn ), cacCtx ( cacCtxIn ), chan ( chanIn ), pValue ( pValueIn ),
|
||||
ioSeqNo ( 0 ), type ( typeIn )
|
||||
{
|
||||
this->ioSeqNo = cacCtxIn.sequenceNumberOfOutstandingIO ( guard );
|
||||
cacCtxIn.incrementOutstandingIO ( guard, this->ioSeqNo );
|
||||
}
|
||||
|
||||
getCopy::~getCopy ()
|
||||
getCopy::~getCopy ()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ void getCopy::cancel ()
|
||||
this->cacCtx.decrementOutstandingIO ( guard, this->ioSeqNo );
|
||||
}
|
||||
|
||||
void getCopy::completion (
|
||||
epicsGuard < epicsMutex > & guard, unsigned typeIn,
|
||||
void getCopy::completion (
|
||||
epicsGuard < epicsMutex > & guard, unsigned typeIn,
|
||||
arrayElementCount countIn, const void *pDataIn )
|
||||
{
|
||||
if ( this->type == typeIn ) {
|
||||
@@ -66,7 +66,7 @@ void getCopy::completion (
|
||||
// this object destroyed by preceding function call
|
||||
}
|
||||
else {
|
||||
this->exception ( guard, ECA_INTERNAL,
|
||||
this->exception ( guard, ECA_INTERNAL,
|
||||
"bad data type match in get copy back response",
|
||||
typeIn, countIn);
|
||||
// this object destroyed by preceding function call
|
||||
@@ -75,7 +75,7 @@ void getCopy::completion (
|
||||
|
||||
void getCopy::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
int status, const char *pContext,
|
||||
int status, const char *pContext,
|
||||
unsigned /* typeIn */, arrayElementCount /* countIn */ )
|
||||
{
|
||||
oldChannelNotify & chanTmp ( this->chan );
|
||||
@@ -86,8 +86,8 @@ void getCopy::exception (
|
||||
// the lock and calling cb in case they destroy channel there
|
||||
this->cacCtx.destroyGetCopy ( guard, *this );
|
||||
if ( status != ECA_CHANDESTROY ) {
|
||||
caClientCtx.exception ( guard, status, pContext,
|
||||
__FILE__, __LINE__, chanTmp, typeTmp,
|
||||
caClientCtx.exception ( guard, status, pContext,
|
||||
__FILE__, __LINE__, chanTmp, typeTmp,
|
||||
countTmp, CA_OP_GET );
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ void getCopy::exception (
|
||||
void getCopy::show ( unsigned level ) const
|
||||
{
|
||||
int tmpType = static_cast <int> ( this->type );
|
||||
::printf ( "read copy IO at %p, type %s, element count %lu\n",
|
||||
::printf ( "read copy IO at %p, type %s, element count %lu\n",
|
||||
static_cast <const void *> ( this ), dbf_type_to_text ( tmpType ), this->count );
|
||||
if ( level > 0u ) {
|
||||
::printf ( "\tIO sequence number %u, user's storage %p\n",
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "hostNameCache.h"
|
||||
#include "epicsGuard.h"
|
||||
|
||||
hostNameCache::hostNameCache (
|
||||
hostNameCache::hostNameCache (
|
||||
const osiSockAddr & addr, ipAddrToAsciiEngine & engine ) :
|
||||
dnsTransaction ( engine.createTransaction() ), nameLength ( 0 )
|
||||
{
|
||||
@@ -64,7 +64,7 @@ void hostNameCache::transactionComplete ( const char * pHostNameIn )
|
||||
this->nameLength = newNameLen;
|
||||
}
|
||||
|
||||
unsigned hostNameCache::getName (
|
||||
unsigned hostNameCache::getName (
|
||||
char * pBuf, unsigned bufSize ) const
|
||||
{
|
||||
if ( bufSize == 0u ) {
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_hostNameCache_H
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -57,7 +57,7 @@ inline resTableIndex inetAddrID::hash () const
|
||||
index = this->addr.sin_addr.s_addr;
|
||||
index ^= this->addr.sin_port;
|
||||
index ^= this->addr.sin_port >> 8u;
|
||||
return integerHash ( inetAddrMinIndexBitWidth,
|
||||
return integerHash ( inetAddrMinIndexBitWidth,
|
||||
inetAddrMaxIndexBitWidth, index );
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -62,8 +62,8 @@ static char *getToken ( const char **ppString, char *pBuf, unsigned bufSIze )
|
||||
|
||||
if ( tokenFound ) {
|
||||
pBuf[bufSIze-1] = '\0';
|
||||
return pBuf;
|
||||
}
|
||||
return pBuf;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ static char *getToken ( const char **ppString, char *pBuf, unsigned bufSIze )
|
||||
* addAddrToChannelAccessAddressList ()
|
||||
*/
|
||||
extern "C" int epicsStdCall addAddrToChannelAccessAddressList
|
||||
( ELLLIST *pList, const ENV_PARAM *pEnv,
|
||||
( ELLLIST *pList, const ENV_PARAM *pEnv,
|
||||
unsigned short port, int ignoreNonDefaultPort )
|
||||
{
|
||||
osiSockAddrNode *pNewNode;
|
||||
@@ -106,9 +106,9 @@ extern "C" int epicsStdCall addAddrToChannelAccessAddressList
|
||||
|
||||
pNewNode->addr.ia = addr;
|
||||
|
||||
/*
|
||||
* LOCK applied externally
|
||||
*/
|
||||
/*
|
||||
* LOCK applied externally
|
||||
*/
|
||||
ellAdd (pList, &pNewNode->node);
|
||||
ret = 0; /* success if anything is added to the list */
|
||||
}
|
||||
@@ -125,8 +125,8 @@ extern "C" void epicsStdCall removeDuplicateAddresses
|
||||
ELLNODE *pRawNode;
|
||||
|
||||
while ( (pRawNode = ellGet ( pSrcList ) ) ) {
|
||||
STATIC_ASSERT ( offsetof (osiSockAddrNode, node) == 0 );
|
||||
osiSockAddrNode *pNode = reinterpret_cast <osiSockAddrNode *> ( pRawNode );
|
||||
STATIC_ASSERT ( offsetof (osiSockAddrNode, node) == 0 );
|
||||
osiSockAddrNode *pNode = reinterpret_cast <osiSockAddrNode *> ( pRawNode );
|
||||
osiSockAddrNode *pTmpNode;
|
||||
|
||||
if ( pNode->addr.sa.sa_family == AF_INET ) {
|
||||
@@ -134,14 +134,14 @@ extern "C" void epicsStdCall removeDuplicateAddresses
|
||||
pTmpNode = (osiSockAddrNode *) ellFirst (pDestList);
|
||||
while ( pTmpNode ) {
|
||||
if (pTmpNode->addr.sa.sa_family == AF_INET) {
|
||||
if ( pNode->addr.ia.sin_addr.s_addr == pTmpNode->addr.ia.sin_addr.s_addr &&
|
||||
if ( pNode->addr.ia.sin_addr.s_addr == pTmpNode->addr.ia.sin_addr.s_addr &&
|
||||
pNode->addr.ia.sin_port == pTmpNode->addr.ia.sin_port ) {
|
||||
if ( ! silent ) {
|
||||
if ( ! silent ) {
|
||||
char buf[64];
|
||||
ipAddrToDottedIP ( &pNode->addr.ia, buf, sizeof (buf) );
|
||||
fprintf ( stderr,
|
||||
"Warning: Duplicate EPICS CA Address list entry \"%s\" discarded\n", buf );
|
||||
}
|
||||
fprintf ( stderr,
|
||||
"Warning: Duplicate EPICS CA Address list entry \"%s\" discarded\n", buf );
|
||||
}
|
||||
free (pNode);
|
||||
pNode = NULL;
|
||||
break;
|
||||
@@ -200,7 +200,7 @@ extern "C" void epicsStdCall configureChannelAccessAddressList
|
||||
* from the interfaces found.
|
||||
*/
|
||||
yes = true;
|
||||
pstr = envGetConfigParam ( &EPICS_CA_AUTO_ADDR_LIST,
|
||||
pstr = envGetConfigParam ( &EPICS_CA_AUTO_ADDR_LIST,
|
||||
sizeof (yesno), yesno );
|
||||
if ( pstr ) {
|
||||
if ( strstr ( pstr, "no" ) || strstr ( pstr, "NO" ) ) {
|
||||
@@ -213,19 +213,19 @@ extern "C" void epicsStdCall configureChannelAccessAddressList
|
||||
* (lock outside because this is used by the server also)
|
||||
*/
|
||||
if (yes) {
|
||||
ELLLIST bcastList;
|
||||
ELLLIST bcastList;
|
||||
osiSockAddr addr;
|
||||
ellInit ( &bcastList );
|
||||
ellInit ( &bcastList );
|
||||
addr.ia.sin_family = AF_UNSPEC;
|
||||
osiSockDiscoverBroadcastAddresses ( &bcastList, sock, &addr );
|
||||
forcePort ( &bcastList, port );
|
||||
removeDuplicateAddresses ( &tmpList, &bcastList, 1 );
|
||||
removeDuplicateAddresses ( &tmpList, &bcastList, 1 );
|
||||
if ( ellCount ( &tmpList ) == 0 ) {
|
||||
osiSockAddrNode *pNewNode;
|
||||
pNewNode = (osiSockAddrNode *) calloc ( 1, sizeof (*pNewNode) );
|
||||
if ( pNewNode ) {
|
||||
/*
|
||||
* if no interfaces found then look for local channels
|
||||
/*
|
||||
* if no interfaces found then look for local channels
|
||||
* with the loop back interface
|
||||
*/
|
||||
pNewNode->addr.ia.sin_family = AF_INET;
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_iocinf_H
|
||||
@@ -46,17 +46,17 @@
|
||||
* CA_CONN_VERIFY_PERIOD is normally obtained from an
|
||||
* EPICS environment variable.
|
||||
*/
|
||||
static const double CA_ECHO_TIMEOUT = 5.0; /* (sec) disconn no echo reply tmo */
|
||||
static const double CA_ECHO_TIMEOUT = 5.0; /* (sec) disconn no echo reply tmo */
|
||||
static const double CA_CONN_VERIFY_PERIOD = 30.0; /* (sec) how often to request echo */
|
||||
|
||||
/*
|
||||
* this determines the number of messages received
|
||||
* without a delay in between before we go into
|
||||
* without a delay in between before we go into
|
||||
* monitor flow control
|
||||
*
|
||||
* turning this down effects maximum throughput
|
||||
* because we dont get an optimal number of bytes
|
||||
* per network frame
|
||||
* because we dont get an optimal number of bytes
|
||||
* per network frame
|
||||
*/
|
||||
static const unsigned contiguousMsgCountWhichTriggersFlowControl = 10u;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -30,7 +30,7 @@ localHostName::localHostName () :
|
||||
const char * pErrStr = "<unknown host>";
|
||||
int status = -1;
|
||||
if ( this->attachedToSockLib ) {
|
||||
status = gethostname (
|
||||
status = gethostname (
|
||||
this->cache, sizeof ( this->cache ) );
|
||||
}
|
||||
if ( status ) {
|
||||
@@ -47,7 +47,7 @@ localHostName::~localHostName ()
|
||||
}
|
||||
}
|
||||
|
||||
unsigned localHostName::getName (
|
||||
unsigned localHostName::getName (
|
||||
char * pBuf, unsigned bufLength ) const
|
||||
{
|
||||
if ( bufLength ) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
@@ -34,9 +34,9 @@
|
||||
#include "cac.h"
|
||||
#include "caerr.h" // for ECA_DBLCHNL
|
||||
|
||||
msgForMultiplyDefinedPV::msgForMultiplyDefinedPV (
|
||||
msgForMultiplyDefinedPV::msgForMultiplyDefinedPV (
|
||||
ipAddrToAsciiEngine & engine,
|
||||
callbackForMultiplyDefinedPV & cbIn,
|
||||
callbackForMultiplyDefinedPV & cbIn,
|
||||
const char * pChannelName, const char * pAcc ) :
|
||||
dnsTransaction ( engine.createTransaction () ), cb ( cbIn )
|
||||
{
|
||||
@@ -59,15 +59,15 @@ void msgForMultiplyDefinedPV::transactionComplete ( const char * pHostNameRej )
|
||||
// !! dont touch 'this' pointer after this point because object has been deleted !!
|
||||
}
|
||||
|
||||
void * msgForMultiplyDefinedPV::operator new ( size_t size,
|
||||
void * msgForMultiplyDefinedPV::operator new ( size_t size,
|
||||
tsFreeList < class msgForMultiplyDefinedPV, 16 > & freeList )
|
||||
{
|
||||
return freeList.allocate ( size );
|
||||
}
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
void msgForMultiplyDefinedPV::operator delete ( void *pCadaver,
|
||||
tsFreeList < class msgForMultiplyDefinedPV, 16 > & freeList )
|
||||
void msgForMultiplyDefinedPV::operator delete ( void *pCadaver,
|
||||
tsFreeList < class msgForMultiplyDefinedPV, 16 > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver, sizeof ( msgForMultiplyDefinedPV ) );
|
||||
}
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_msgForMultiplyDefinedPV_H
|
||||
@@ -33,8 +33,8 @@
|
||||
class callbackForMultiplyDefinedPV {
|
||||
public:
|
||||
virtual ~callbackForMultiplyDefinedPV () = 0;
|
||||
virtual void pvMultiplyDefinedNotify (
|
||||
class msgForMultiplyDefinedPV &, const char * pChannelName,
|
||||
virtual void pvMultiplyDefinedNotify (
|
||||
class msgForMultiplyDefinedPV &, const char * pChannelName,
|
||||
const char * pAcc, const char * pRej ) = 0;
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ class msgForMultiplyDefinedPV :
|
||||
public tsDLNode < msgForMultiplyDefinedPV > {
|
||||
public:
|
||||
msgForMultiplyDefinedPV ( ipAddrToAsciiEngine & engine,
|
||||
callbackForMultiplyDefinedPV &, const char * pChannelName,
|
||||
callbackForMultiplyDefinedPV &, const char * pChannelName,
|
||||
const char * pAcc );
|
||||
virtual ~msgForMultiplyDefinedPV ();
|
||||
void ioInitiate ( const osiSockAddr & rej );
|
||||
|
||||
@@ -49,7 +49,7 @@ nciu::nciu ( cac & cacIn, netiiu & iiuIn, cacChannelNotify & chanIn,
|
||||
typeCode ( USHRT_MAX ),
|
||||
priority ( static_cast <ca_uint8_t> ( pri ) )
|
||||
{
|
||||
size_t nameLengthTmp = strlen ( pNameIn ) + 1;
|
||||
size_t nameLengthTmp = strlen ( pNameIn ) + 1;
|
||||
|
||||
// second constraint is imposed by size field in protocol header
|
||||
if ( nameLengthTmp > MAX_UDP_SEND - sizeof ( caHdr ) || nameLengthTmp > USHRT_MAX ) {
|
||||
@@ -60,7 +60,7 @@ nciu::nciu ( cac & cacIn, netiiu & iiuIn, cacChannelNotify & chanIn,
|
||||
throw cacChannel::badPriority ();
|
||||
}
|
||||
|
||||
this->nameLength = static_cast <unsigned short> ( nameLengthTmp );
|
||||
this->nameLength = static_cast <unsigned short> ( nameLengthTmp );
|
||||
|
||||
this->pNameStr = new char [ this->nameLength ];
|
||||
strcpy ( this->pNameStr, pNameIn );
|
||||
@@ -112,7 +112,7 @@ void nciu::initiateConnect (
|
||||
}
|
||||
|
||||
void nciu::connect ( unsigned nativeType,
|
||||
unsigned nativeCount, unsigned sidIn,
|
||||
unsigned nativeCount, unsigned sidIn,
|
||||
epicsGuard < epicsMutex > & /* cbGuard */,
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_nciu_H
|
||||
@@ -269,8 +269,8 @@ private:
|
||||
epicsGuard < epicsMutex > &, class baseNMIU & );
|
||||
const char * pHostName (
|
||||
epicsGuard < epicsMutex > & guard ) const throw ();
|
||||
nciu ( const nciu & );
|
||||
nciu & operator = ( const nciu & );
|
||||
nciu ( const nciu & );
|
||||
nciu & operator = ( const nciu & );
|
||||
void operator delete ( void * );
|
||||
};
|
||||
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_netIO_H
|
||||
@@ -28,9 +28,9 @@
|
||||
#include "compilerDependencies.h"
|
||||
|
||||
// SUN PRO generates multiply defined symbols if the baseNMIU
|
||||
// destructor is virtual (therefore it is protected).
|
||||
// destructor is virtual (therefore it is protected).
|
||||
// I assume that SUNPRO will fix this in future versions.
|
||||
// With other compilers we get warnings (and
|
||||
// With other compilers we get warnings (and
|
||||
// potential problems) if we dont make the baseNMIU
|
||||
// destructor virtual.
|
||||
#if defined ( __SUNPRO_CC ) && ( __SUNPRO_CC <= 0x540 )
|
||||
@@ -44,42 +44,42 @@ class privateInterfaceForIO;
|
||||
class baseNMIU : public tsDLNode < baseNMIU >,
|
||||
public chronIntIdRes < baseNMIU > {
|
||||
public:
|
||||
virtual void destroy (
|
||||
virtual void destroy (
|
||||
epicsGuard < epicsMutex > &, class cacRecycle & ) = 0; // only called by cac
|
||||
virtual void completion (
|
||||
virtual void completion (
|
||||
epicsGuard < epicsMutex > &, cacRecycle & ) = 0;
|
||||
virtual void exception (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
virtual void exception (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
int status, const char * pContext ) = 0;
|
||||
virtual void exception (
|
||||
virtual void exception (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
int status, const char * pContext, unsigned type,
|
||||
int status, const char * pContext, unsigned type,
|
||||
arrayElementCount count ) = 0;
|
||||
virtual void completion (
|
||||
virtual void completion (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
unsigned type, arrayElementCount count,
|
||||
unsigned type, arrayElementCount count,
|
||||
const void * pData ) = 0;
|
||||
virtual void forceSubscriptionUpdate (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan ) = 0;
|
||||
virtual class netSubscription * isSubscription () = 0;
|
||||
virtual void show (
|
||||
virtual void show (
|
||||
unsigned level ) const = 0;
|
||||
virtual void show (
|
||||
epicsGuard < epicsMutex > &,
|
||||
virtual void show (
|
||||
epicsGuard < epicsMutex > &,
|
||||
unsigned level ) const = 0;
|
||||
protected:
|
||||
NETIO_VIRTUAL_DESTRUCTOR ~baseNMIU ();
|
||||
NETIO_VIRTUAL_DESTRUCTOR ~baseNMIU ();
|
||||
};
|
||||
|
||||
class netSubscription : public baseNMIU {
|
||||
public:
|
||||
static netSubscription * factory (
|
||||
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &,
|
||||
class privateInterfaceForIO &, unsigned type, arrayElementCount count,
|
||||
static netSubscription * factory (
|
||||
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &,
|
||||
class privateInterfaceForIO &, unsigned type, arrayElementCount count,
|
||||
unsigned mask, cacStateNotify & );
|
||||
void show (
|
||||
void show (
|
||||
unsigned level ) const;
|
||||
void show (
|
||||
void show (
|
||||
epicsGuard < epicsMutex > &, unsigned level ) const;
|
||||
arrayElementCount getCount (
|
||||
epicsGuard < epicsMutex > &, bool allow_zero ) const;
|
||||
@@ -89,12 +89,12 @@ public:
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
void subscribeIfRequired (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan );
|
||||
void unsubscribeIfRequired (
|
||||
void unsubscribeIfRequired (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan );
|
||||
protected:
|
||||
netSubscription (
|
||||
class privateInterfaceForIO &, unsigned type,
|
||||
arrayElementCount count,
|
||||
netSubscription (
|
||||
class privateInterfaceForIO &, unsigned type,
|
||||
arrayElementCount count,
|
||||
unsigned mask, cacStateNotify & );
|
||||
~netSubscription ();
|
||||
private:
|
||||
@@ -106,23 +106,23 @@ private:
|
||||
bool subscribed;
|
||||
class netSubscription * isSubscription ();
|
||||
void operator delete ( void * );
|
||||
void * operator new ( size_t,
|
||||
void * operator new ( size_t,
|
||||
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & );
|
||||
epicsPlacementDeleteOperator (( void *,
|
||||
epicsPlacementDeleteOperator (( void *,
|
||||
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & ))
|
||||
void destroy (
|
||||
void destroy (
|
||||
epicsGuard < epicsMutex > &, class cacRecycle & );
|
||||
void completion (
|
||||
epicsGuard < epicsMutex > &, cacRecycle & );
|
||||
void exception (
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
int status, const char * pContext );
|
||||
void completion (
|
||||
void completion (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
unsigned type, arrayElementCount count, const void * pData );
|
||||
void exception (
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
int status, const char * pContext, unsigned type,
|
||||
int status, const char * pContext, unsigned type,
|
||||
arrayElementCount count );
|
||||
void forceSubscriptionUpdate (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan );
|
||||
@@ -132,12 +132,12 @@ private:
|
||||
|
||||
class netReadNotifyIO : public baseNMIU {
|
||||
public:
|
||||
static netReadNotifyIO * factory (
|
||||
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > &,
|
||||
static netReadNotifyIO * factory (
|
||||
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > &,
|
||||
privateInterfaceForIO &, cacReadNotify & );
|
||||
void show (
|
||||
void show (
|
||||
unsigned level ) const;
|
||||
void show (
|
||||
void show (
|
||||
epicsGuard < epicsMutex > &, unsigned level ) const;
|
||||
protected:
|
||||
netReadNotifyIO ( privateInterfaceForIO &, cacReadNotify & );
|
||||
@@ -146,24 +146,24 @@ private:
|
||||
cacReadNotify & notify;
|
||||
class privateInterfaceForIO & privateChanForIO;
|
||||
void operator delete ( void * );
|
||||
void * operator new ( size_t,
|
||||
void * operator new ( size_t,
|
||||
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & );
|
||||
epicsPlacementDeleteOperator (( void *,
|
||||
epicsPlacementDeleteOperator (( void *,
|
||||
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & ))
|
||||
void destroy (
|
||||
void destroy (
|
||||
epicsGuard < epicsMutex > &, class cacRecycle & );
|
||||
void completion (
|
||||
epicsGuard < epicsMutex > &, cacRecycle & );
|
||||
void exception (
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
int status, const char * pContext );
|
||||
void completion (
|
||||
void completion (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
unsigned type, arrayElementCount count,
|
||||
const void * pData );
|
||||
void exception (
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
int status, const char * pContext,
|
||||
int status, const char * pContext,
|
||||
unsigned type, arrayElementCount count );
|
||||
class netSubscription * isSubscription ();
|
||||
void forceSubscriptionUpdate (
|
||||
@@ -174,12 +174,12 @@ private:
|
||||
|
||||
class netWriteNotifyIO : public baseNMIU {
|
||||
public:
|
||||
static netWriteNotifyIO * factory (
|
||||
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > &,
|
||||
static netWriteNotifyIO * factory (
|
||||
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > &,
|
||||
privateInterfaceForIO &, cacWriteNotify & );
|
||||
void show (
|
||||
void show (
|
||||
unsigned level ) const;
|
||||
void show (
|
||||
void show (
|
||||
epicsGuard < epicsMutex > &, unsigned level ) const;
|
||||
protected:
|
||||
netWriteNotifyIO ( privateInterfaceForIO &, cacWriteNotify & );
|
||||
@@ -188,25 +188,25 @@ private:
|
||||
cacWriteNotify & notify;
|
||||
privateInterfaceForIO & privateChanForIO;
|
||||
void operator delete ( void * );
|
||||
void * operator new ( size_t,
|
||||
void * operator new ( size_t,
|
||||
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & );
|
||||
epicsPlacementDeleteOperator (( void *,
|
||||
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & ))
|
||||
class netSubscription * isSubscription ();
|
||||
void destroy (
|
||||
void destroy (
|
||||
epicsGuard < epicsMutex > &, class cacRecycle & );
|
||||
void completion (
|
||||
epicsGuard < epicsMutex > &, cacRecycle & );
|
||||
void exception (
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
int status, const char * pContext );
|
||||
void completion (
|
||||
void completion (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
unsigned type, arrayElementCount count,
|
||||
const void * pData );
|
||||
void exception (
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > &, cacRecycle &,
|
||||
int status, const char * pContext, unsigned type,
|
||||
int status, const char * pContext, unsigned type,
|
||||
arrayElementCount count );
|
||||
void forceSubscriptionUpdate (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan );
|
||||
@@ -214,23 +214,23 @@ private:
|
||||
netWriteNotifyIO & operator = ( const netWriteNotifyIO & );
|
||||
};
|
||||
|
||||
inline void * netSubscription::operator new ( size_t size,
|
||||
inline void * netSubscription::operator new ( size_t size,
|
||||
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &freeList )
|
||||
{
|
||||
return freeList.allocate ( size );
|
||||
}
|
||||
|
||||
#if defined ( CXX_PLACEMENT_DELETE )
|
||||
inline void netSubscription::operator delete ( void *pCadaver,
|
||||
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &freeList )
|
||||
inline void netSubscription::operator delete ( void *pCadaver,
|
||||
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
#endif
|
||||
|
||||
inline netSubscription * netSubscription::factory (
|
||||
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & freeList,
|
||||
class privateInterfaceForIO & chan, unsigned type, arrayElementCount count,
|
||||
inline netSubscription * netSubscription::factory (
|
||||
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & freeList,
|
||||
class privateInterfaceForIO & chan, unsigned type, arrayElementCount count,
|
||||
unsigned mask, cacStateNotify ¬ify )
|
||||
{
|
||||
return new ( freeList ) netSubscription ( chan, type,
|
||||
@@ -260,43 +260,43 @@ inline unsigned netSubscription::getMask ( epicsGuard < epicsMutex > & ) const
|
||||
return this->mask;
|
||||
}
|
||||
|
||||
inline netReadNotifyIO * netReadNotifyIO::factory (
|
||||
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & freeList,
|
||||
inline netReadNotifyIO * netReadNotifyIO::factory (
|
||||
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & freeList,
|
||||
privateInterfaceForIO & ioComplNotifIntf, cacReadNotify & notify )
|
||||
{
|
||||
return new ( freeList ) netReadNotifyIO ( ioComplNotifIntf, notify );
|
||||
}
|
||||
|
||||
inline void * netReadNotifyIO::operator new ( size_t size,
|
||||
inline void * netReadNotifyIO::operator new ( size_t size,
|
||||
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & freeList )
|
||||
{
|
||||
return freeList.allocate ( size );
|
||||
}
|
||||
|
||||
#if defined ( CXX_PLACEMENT_DELETE )
|
||||
inline void netReadNotifyIO::operator delete ( void *pCadaver,
|
||||
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & freeList )
|
||||
inline void netReadNotifyIO::operator delete ( void *pCadaver,
|
||||
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
#endif
|
||||
|
||||
inline netWriteNotifyIO * netWriteNotifyIO::factory (
|
||||
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & freeList,
|
||||
inline netWriteNotifyIO * netWriteNotifyIO::factory (
|
||||
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & freeList,
|
||||
privateInterfaceForIO & ioComplNotifyIntf, cacWriteNotify & notify )
|
||||
{
|
||||
return new ( freeList ) netWriteNotifyIO ( ioComplNotifyIntf, notify );
|
||||
}
|
||||
|
||||
inline void * netWriteNotifyIO::operator new ( size_t size,
|
||||
inline void * netWriteNotifyIO::operator new ( size_t size,
|
||||
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & freeList )
|
||||
{
|
||||
{
|
||||
return freeList.allocate ( size );
|
||||
}
|
||||
|
||||
#if defined ( CXX_PLACEMENT_DELETE )
|
||||
inline void netWriteNotifyIO::operator delete ( void *pCadaver,
|
||||
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & freeList )
|
||||
inline void netWriteNotifyIO::operator delete ( void *pCadaver,
|
||||
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
#include "nciu.h"
|
||||
#include "cac.h"
|
||||
|
||||
netReadNotifyIO::netReadNotifyIO (
|
||||
privateInterfaceForIO & ioComplIntfIn,
|
||||
netReadNotifyIO::netReadNotifyIO (
|
||||
privateInterfaceForIO & ioComplIntfIn,
|
||||
cacReadNotify & notify ) :
|
||||
notify ( notify ), privateChanForIO ( ioComplIntfIn )
|
||||
{
|
||||
@@ -41,26 +41,26 @@ netReadNotifyIO::~netReadNotifyIO ()
|
||||
|
||||
void netReadNotifyIO::show ( unsigned /* level */ ) const
|
||||
{
|
||||
::printf ( "netReadNotifyIO at %p\n",
|
||||
::printf ( "netReadNotifyIO at %p\n",
|
||||
static_cast < const void * > ( this ) );
|
||||
}
|
||||
|
||||
void netReadNotifyIO::show (
|
||||
void netReadNotifyIO::show (
|
||||
epicsGuard < epicsMutex > &, unsigned level ) const
|
||||
{
|
||||
this->show ( level );
|
||||
}
|
||||
|
||||
void netReadNotifyIO::destroy (
|
||||
void netReadNotifyIO::destroy (
|
||||
epicsGuard < epicsMutex > & guard, cacRecycle & recycle )
|
||||
{
|
||||
this->~netReadNotifyIO ();
|
||||
recycle.recycleReadNotifyIO ( guard, *this );
|
||||
}
|
||||
|
||||
void netReadNotifyIO::completion (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
cacRecycle & recycle, unsigned type,
|
||||
void netReadNotifyIO::completion (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
cacRecycle & recycle, unsigned type,
|
||||
arrayElementCount count, const void * pData )
|
||||
{
|
||||
//guard.assertIdenticalMutex ( this->mutex );
|
||||
@@ -81,28 +81,28 @@ void netReadNotifyIO::completion (
|
||||
recycle.recycleReadNotifyIO ( guard, *this );
|
||||
}
|
||||
|
||||
void netReadNotifyIO::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
void netReadNotifyIO::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
cacRecycle & recycle,
|
||||
int status, const char *pContext )
|
||||
{
|
||||
//guard.assertIdenticalMutex ( this->mutex );
|
||||
this->privateChanForIO.ioCompletionNotify ( guard, *this );
|
||||
this->notify.exception (
|
||||
this->notify.exception (
|
||||
guard, status, pContext, UINT_MAX, 0u );
|
||||
this->~netReadNotifyIO ();
|
||||
recycle.recycleReadNotifyIO ( guard, *this );
|
||||
}
|
||||
|
||||
void netReadNotifyIO::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
void netReadNotifyIO::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
cacRecycle & recycle,
|
||||
int status, const char *pContext,
|
||||
int status, const char *pContext,
|
||||
unsigned type, arrayElementCount count )
|
||||
{
|
||||
//guard.assertIdenticalMutex ( this->mutex )
|
||||
this->privateChanForIO.ioCompletionNotify ( guard, *this );
|
||||
this->notify.exception (
|
||||
this->notify.exception (
|
||||
guard, status, pContext, type, count );
|
||||
this->~netReadNotifyIO ();
|
||||
recycle.recycleReadNotifyIO ( guard, *this );
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
#include "db_access.h" // for dbf_type_to_text
|
||||
#include "caerr.h"
|
||||
|
||||
netSubscription::netSubscription (
|
||||
privateInterfaceForIO & chanIn,
|
||||
unsigned typeIn, arrayElementCount countIn,
|
||||
netSubscription::netSubscription (
|
||||
privateInterfaceForIO & chanIn,
|
||||
unsigned typeIn, arrayElementCount countIn,
|
||||
unsigned maskIn, cacStateNotify & notifyIn ) :
|
||||
count ( countIn ), privateChanForIO ( chanIn ),
|
||||
notify ( notifyIn ), type ( typeIn ), mask ( maskIn ),
|
||||
@@ -46,11 +46,11 @@ netSubscription::netSubscription (
|
||||
}
|
||||
}
|
||||
|
||||
netSubscription::~netSubscription ()
|
||||
netSubscription::~netSubscription ()
|
||||
{
|
||||
}
|
||||
|
||||
void netSubscription::destroy (
|
||||
void netSubscription::destroy (
|
||||
epicsGuard < epicsMutex > & guard, cacRecycle & recycle )
|
||||
{
|
||||
this->~netSubscription ();
|
||||
@@ -64,26 +64,26 @@ class netSubscription * netSubscription::isSubscription ()
|
||||
|
||||
void netSubscription::show ( unsigned /* level */ ) const
|
||||
{
|
||||
::printf ( "event subscription IO at %p, type %s, element count %lu, mask %u\n",
|
||||
static_cast < const void * > ( this ),
|
||||
dbf_type_to_text ( static_cast < int > ( this->type ) ),
|
||||
::printf ( "event subscription IO at %p, type %s, element count %lu, mask %u\n",
|
||||
static_cast < const void * > ( this ),
|
||||
dbf_type_to_text ( static_cast < int > ( this->type ) ),
|
||||
this->count, this->mask );
|
||||
}
|
||||
|
||||
void netSubscription::show (
|
||||
void netSubscription::show (
|
||||
epicsGuard < epicsMutex > &, unsigned level ) const
|
||||
{
|
||||
this->show ( level );
|
||||
}
|
||||
|
||||
void netSubscription::completion (
|
||||
void netSubscription::completion (
|
||||
epicsGuard < epicsMutex > &, cacRecycle & )
|
||||
{
|
||||
errlogPrintf ( "subscription update w/o data ?\n" );
|
||||
}
|
||||
|
||||
void netSubscription::exception (
|
||||
epicsGuard < epicsMutex > & guard, cacRecycle & recycle,
|
||||
void netSubscription::exception (
|
||||
epicsGuard < epicsMutex > & guard, cacRecycle & recycle,
|
||||
int status, const char * pContext )
|
||||
{
|
||||
if ( status == ECA_DISCONN ) {
|
||||
@@ -91,7 +91,7 @@ void netSubscription::exception (
|
||||
}
|
||||
if ( status == ECA_CHANDESTROY ) {
|
||||
this->privateChanForIO.ioCompletionNotify ( guard, *this );
|
||||
this->notify.exception (
|
||||
this->notify.exception (
|
||||
guard, status, pContext, UINT_MAX, 0 );
|
||||
this->~netSubscription ();
|
||||
recycle.recycleSubscription ( guard, *this );
|
||||
@@ -99,15 +99,15 @@ void netSubscription::exception (
|
||||
else {
|
||||
// guard.assertIdenticalMutex ( this->mutex );
|
||||
if ( this->privateChanForIO.connected ( guard ) ) {
|
||||
this->notify.exception (
|
||||
this->notify.exception (
|
||||
guard, status, pContext, UINT_MAX, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void netSubscription::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
cacRecycle & recycle, int status, const char * pContext,
|
||||
void netSubscription::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
cacRecycle & recycle, int status, const char * pContext,
|
||||
unsigned typeIn, arrayElementCount countIn )
|
||||
{
|
||||
if ( status == ECA_DISCONN ) {
|
||||
@@ -115,7 +115,7 @@ void netSubscription::exception (
|
||||
}
|
||||
if ( status == ECA_CHANDESTROY ) {
|
||||
this->privateChanForIO.ioCompletionNotify ( guard, *this );
|
||||
this->notify.exception (
|
||||
this->notify.exception (
|
||||
guard, status, pContext, UINT_MAX, 0 );
|
||||
this->~netSubscription ();
|
||||
recycle.recycleSubscription ( guard, *this );
|
||||
@@ -123,20 +123,20 @@ void netSubscription::exception (
|
||||
else {
|
||||
//guard.assertIdenticalMutex ( this->mutex );
|
||||
if ( this->privateChanForIO.connected ( guard ) ) {
|
||||
this->notify.exception (
|
||||
this->notify.exception (
|
||||
guard, status, pContext, typeIn, countIn );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void netSubscription::completion (
|
||||
void netSubscription::completion (
|
||||
epicsGuard < epicsMutex > & guard, cacRecycle &,
|
||||
unsigned typeIn, arrayElementCount countIn,
|
||||
unsigned typeIn, arrayElementCount countIn,
|
||||
const void * pDataIn )
|
||||
{
|
||||
// guard.assertIdenticalMutex ( this->mutex );
|
||||
if ( this->privateChanForIO.connected ( guard ) ) {
|
||||
this->notify.current (
|
||||
this->notify.current (
|
||||
guard, typeIn, countIn, pDataIn );
|
||||
}
|
||||
}
|
||||
@@ -145,17 +145,17 @@ void netSubscription::subscribeIfRequired (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan )
|
||||
{
|
||||
if ( ! this->subscribed ) {
|
||||
chan.getPIIU(guard)->subscriptionRequest (
|
||||
chan.getPIIU(guard)->subscriptionRequest (
|
||||
guard, chan, *this );
|
||||
this->subscribed = true;
|
||||
}
|
||||
}
|
||||
|
||||
void netSubscription::unsubscribeIfRequired (
|
||||
void netSubscription::unsubscribeIfRequired (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan )
|
||||
{
|
||||
if ( this->subscribed ) {
|
||||
chan.getPIIU(guard)->subscriptionCancelRequest (
|
||||
chan.getPIIU(guard)->subscriptionCancelRequest (
|
||||
guard, chan, *this );
|
||||
this->subscribed = false;
|
||||
}
|
||||
@@ -164,7 +164,7 @@ void netSubscription::unsubscribeIfRequired (
|
||||
void netSubscription::forceSubscriptionUpdate (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan )
|
||||
{
|
||||
chan.getPIIU(guard)->subscriptionUpdateRequest (
|
||||
chan.getPIIU(guard)->subscriptionUpdateRequest (
|
||||
guard, chan, *this );
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "nciu.h"
|
||||
#include "cac.h"
|
||||
|
||||
netWriteNotifyIO::netWriteNotifyIO (
|
||||
netWriteNotifyIO::netWriteNotifyIO (
|
||||
privateInterfaceForIO & ioComplIntf, cacWriteNotify & notifyIn ) :
|
||||
notify ( notifyIn ), privateChanForIO ( ioComplIntf )
|
||||
{
|
||||
@@ -40,19 +40,19 @@ netWriteNotifyIO::~netWriteNotifyIO ()
|
||||
|
||||
void netWriteNotifyIO::show ( unsigned /* level */ ) const
|
||||
{
|
||||
::printf ( "read write notify IO at %p\n",
|
||||
::printf ( "read write notify IO at %p\n",
|
||||
static_cast < const void * > ( this ) );
|
||||
}
|
||||
|
||||
void netWriteNotifyIO::show (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void netWriteNotifyIO::show (
|
||||
epicsGuard < epicsMutex > &,
|
||||
unsigned level ) const
|
||||
{
|
||||
this->show ( level );
|
||||
}
|
||||
|
||||
void netWriteNotifyIO::destroy (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
void netWriteNotifyIO::destroy (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
cacRecycle & recycle )
|
||||
{
|
||||
this->~netWriteNotifyIO ();
|
||||
@@ -69,10 +69,10 @@ void netWriteNotifyIO::completion (
|
||||
recycle.recycleWriteNotifyIO ( guard, *this );
|
||||
}
|
||||
|
||||
void netWriteNotifyIO::completion (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
void netWriteNotifyIO::completion (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
cacRecycle & recycle,
|
||||
unsigned /* type */, arrayElementCount /* count */,
|
||||
unsigned /* type */, arrayElementCount /* count */,
|
||||
const void * /* pData */ )
|
||||
{
|
||||
//this->chan.getClient().printf ( "Write response with data ?\n" );
|
||||
@@ -81,26 +81,26 @@ void netWriteNotifyIO::completion (
|
||||
recycle.recycleWriteNotifyIO ( guard, *this );
|
||||
}
|
||||
|
||||
void netWriteNotifyIO::exception (
|
||||
void netWriteNotifyIO::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
cacRecycle & recycle,
|
||||
int status, const char * pContext )
|
||||
{
|
||||
this->privateChanForIO.ioCompletionNotify ( guard, *this );
|
||||
this->notify.exception (
|
||||
this->notify.exception (
|
||||
guard, status, pContext, UINT_MAX, 0u );
|
||||
this->~netWriteNotifyIO ();
|
||||
recycle.recycleWriteNotifyIO ( guard, *this );
|
||||
}
|
||||
|
||||
void netWriteNotifyIO::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
void netWriteNotifyIO::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
cacRecycle & recycle,
|
||||
int status, const char *pContext,
|
||||
int status, const char *pContext,
|
||||
unsigned type, arrayElementCount count )
|
||||
{
|
||||
this->privateChanForIO.ioCompletionNotify ( guard, *this );
|
||||
this->notify.exception (
|
||||
this->notify.exception (
|
||||
guard, status, pContext, type, count );
|
||||
this->~netWriteNotifyIO ();
|
||||
recycle.recycleWriteNotifyIO ( guard, *this );
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
\*************************************************************************/
|
||||
/*
|
||||
*
|
||||
* Author: J. Hill
|
||||
* Author: J. Hill
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,7 @@ extern "C" {
|
||||
typedef unsigned long arrayElementCount;
|
||||
|
||||
LIBCA_API int caNetConvert (
|
||||
unsigned type, const void *pSrc, void *pDest,
|
||||
unsigned type, const void *pSrc, void *pDest,
|
||||
int hton, arrayElementCount count );
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string> // vxWorks 6.0 requires this include
|
||||
#include <string> // vxWorks 6.0 requires this include
|
||||
|
||||
#include <limits.h>
|
||||
#include <float.h>
|
||||
@@ -46,51 +46,51 @@ bool netiiu::ca_v41_ok (
|
||||
return false;
|
||||
}
|
||||
|
||||
void netiiu::writeRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
void netiiu::writeRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
unsigned, arrayElementCount, const void * )
|
||||
{
|
||||
throw cacChannel::notConnected();
|
||||
}
|
||||
|
||||
void netiiu::writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netWriteNotifyIO &, unsigned,
|
||||
void netiiu::writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netWriteNotifyIO &, unsigned,
|
||||
arrayElementCount, const void * )
|
||||
{
|
||||
throw cacChannel::notConnected();
|
||||
}
|
||||
|
||||
void netiiu::readNotifyRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void netiiu::readNotifyRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netReadNotifyIO &, unsigned, arrayElementCount )
|
||||
{
|
||||
throw cacChannel::notConnected();
|
||||
}
|
||||
|
||||
void netiiu::clearChannelRequest (
|
||||
void netiiu::clearChannelRequest (
|
||||
epicsGuard < epicsMutex > &, ca_uint32_t, ca_uint32_t )
|
||||
{
|
||||
}
|
||||
|
||||
void netiiu::subscriptionRequest (
|
||||
void netiiu::subscriptionRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &, netSubscription & )
|
||||
{
|
||||
}
|
||||
|
||||
void netiiu::subscriptionCancelRequest (
|
||||
void netiiu::subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &, netSubscription & )
|
||||
{
|
||||
}
|
||||
|
||||
void netiiu::subscriptionUpdateRequest (
|
||||
void netiiu::subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &, netSubscription & )
|
||||
{
|
||||
}
|
||||
|
||||
static const char * const pHostNameNetIIU = "<disconnected>";
|
||||
|
||||
unsigned netiiu::getHostName (
|
||||
unsigned netiiu::getHostName (
|
||||
epicsGuard < epicsMutex > &,
|
||||
char * pBuf, unsigned bufLen ) const throw ()
|
||||
{
|
||||
@@ -123,18 +123,18 @@ osiSockAddr netiiu::getNetworkAddress (
|
||||
return addr;
|
||||
}
|
||||
|
||||
void netiiu::flushRequest (
|
||||
void netiiu::flushRequest (
|
||||
epicsGuard < epicsMutex > & )
|
||||
{
|
||||
}
|
||||
|
||||
unsigned netiiu::requestMessageBytesPending (
|
||||
unsigned netiiu::requestMessageBytesPending (
|
||||
epicsGuard < epicsMutex > & )
|
||||
{
|
||||
return 0u;
|
||||
}
|
||||
|
||||
void netiiu::flush (
|
||||
void netiiu::flush (
|
||||
epicsGuard < epicsMutex > & )
|
||||
{
|
||||
}
|
||||
@@ -144,7 +144,7 @@ void netiiu::requestRecvProcessPostponedFlush (
|
||||
{
|
||||
}
|
||||
|
||||
void netiiu::uninstallChan (
|
||||
void netiiu::uninstallChan (
|
||||
epicsGuard < epicsMutex > &, nciu & )
|
||||
{
|
||||
throw cacChannel::notConnected();
|
||||
@@ -156,15 +156,15 @@ double netiiu::receiveWatchdogDelay (
|
||||
return - DBL_MAX;
|
||||
}
|
||||
|
||||
void netiiu::uninstallChanDueToSuccessfulSearchResponse (
|
||||
void netiiu::uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > &, nciu &, const epicsTime & )
|
||||
{
|
||||
throw std::runtime_error (
|
||||
throw std::runtime_error (
|
||||
"search response occured when not attached to udpiiu?" );
|
||||
}
|
||||
|
||||
bool netiiu::searchMsg (
|
||||
epicsGuard < epicsMutex > &, ca_uint32_t /* id */,
|
||||
epicsGuard < epicsMutex > &, ca_uint32_t /* id */,
|
||||
const char * /* pName */, unsigned /* nameLength */ )
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_netiiu_H
|
||||
@@ -37,8 +37,8 @@ class nciu;
|
||||
class netiiu {
|
||||
public:
|
||||
virtual ~netiiu () = 0;
|
||||
virtual unsigned getHostName (
|
||||
epicsGuard < epicsMutex > &, char * pBuf,
|
||||
virtual unsigned getHostName (
|
||||
epicsGuard < epicsMutex > &, char * pBuf,
|
||||
unsigned bufLength ) const throw () = 0;
|
||||
virtual const char * pHostName (
|
||||
epicsGuard < epicsMutex > & ) const throw () = 0;
|
||||
@@ -46,50 +46,50 @@ public:
|
||||
epicsGuard < epicsMutex > & ) const = 0;
|
||||
virtual bool ca_v42_ok (
|
||||
epicsGuard < epicsMutex > & ) const = 0;
|
||||
virtual unsigned requestMessageBytesPending (
|
||||
virtual unsigned requestMessageBytesPending (
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
|
||||
virtual void flush (
|
||||
virtual void flush (
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
|
||||
virtual void writeRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
virtual void writeRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
const void *pValue ) = 0;
|
||||
virtual void writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netWriteNotifyIO &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
virtual void writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netWriteNotifyIO &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
const void *pValue ) = 0;
|
||||
virtual void readNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
netReadNotifyIO &, unsigned type,
|
||||
virtual void readNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
netReadNotifyIO &, unsigned type,
|
||||
arrayElementCount nElem ) = 0;
|
||||
virtual void clearChannelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
virtual void clearChannelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
ca_uint32_t sid, ca_uint32_t cid ) = 0;
|
||||
virtual void subscriptionRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
virtual void subscriptionRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netSubscription & ) = 0;
|
||||
virtual void subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
virtual void subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netSubscription & ) = 0;
|
||||
virtual void subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
virtual void subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu & chan, netSubscription & subscr ) = 0;
|
||||
virtual void flushRequest (
|
||||
virtual void flushRequest (
|
||||
epicsGuard < epicsMutex > & ) = 0;
|
||||
virtual void requestRecvProcessPostponedFlush (
|
||||
epicsGuard < epicsMutex > & ) = 0;
|
||||
virtual osiSockAddr getNetworkAddress (
|
||||
epicsGuard < epicsMutex > & ) const = 0;
|
||||
virtual void uninstallChan (
|
||||
virtual void uninstallChan (
|
||||
epicsGuard < epicsMutex > &, nciu & ) = 0;
|
||||
virtual void uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
virtual void uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
const class epicsTime & currentTime ) = 0;
|
||||
virtual double receiveWatchdogDelay (
|
||||
epicsGuard < epicsMutex > & ) const = 0;
|
||||
virtual bool searchMsg (
|
||||
epicsGuard < epicsMutex > &, ca_uint32_t id,
|
||||
epicsGuard < epicsMutex > &, ca_uint32_t id,
|
||||
const char * pName, unsigned nameLength ) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#include "osiSock.h"
|
||||
@@ -27,11 +27,11 @@
|
||||
|
||||
noopiiu noopIIU;
|
||||
|
||||
noopiiu::~noopiiu ()
|
||||
noopiiu::~noopiiu ()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned noopiiu::getHostName (
|
||||
unsigned noopiiu::getHostName (
|
||||
epicsGuard < epicsMutex > & cacGuard,
|
||||
char * pBuf, unsigned bufLength ) const throw ()
|
||||
{
|
||||
@@ -56,71 +56,71 @@ bool noopiiu::ca_v41_ok (
|
||||
return netiiu::ca_v41_ok ( cacGuard );
|
||||
}
|
||||
|
||||
void noopiiu::writeRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
nciu & chan, unsigned type,
|
||||
void noopiiu::writeRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
nciu & chan, unsigned type,
|
||||
arrayElementCount nElem, const void * pValue )
|
||||
{
|
||||
netiiu::writeRequest ( guard, chan, type, nElem, pValue );
|
||||
}
|
||||
|
||||
void noopiiu::writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
netWriteNotifyIO & io, unsigned type,
|
||||
void noopiiu::writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
netWriteNotifyIO & io, unsigned type,
|
||||
arrayElementCount nElem, const void *pValue )
|
||||
{
|
||||
netiiu::writeNotifyRequest ( guard, chan, io, type, nElem, pValue );
|
||||
}
|
||||
|
||||
void noopiiu::readNotifyRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
void noopiiu::readNotifyRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
netReadNotifyIO & io, unsigned type, arrayElementCount nElem )
|
||||
{
|
||||
netiiu::readNotifyRequest ( guard, chan, io, type, nElem );
|
||||
}
|
||||
|
||||
void noopiiu::clearChannelRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
void noopiiu::clearChannelRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
ca_uint32_t sid, ca_uint32_t cid )
|
||||
{
|
||||
netiiu::clearChannelRequest ( guard, sid, cid );
|
||||
}
|
||||
|
||||
void noopiiu::subscriptionRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
void noopiiu::subscriptionRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
netSubscription & subscr )
|
||||
{
|
||||
netiiu::subscriptionRequest ( guard, chan, subscr );
|
||||
}
|
||||
|
||||
void noopiiu::subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
void noopiiu::subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
netSubscription & subscr )
|
||||
{
|
||||
netiiu::subscriptionUpdateRequest (
|
||||
guard, chan, subscr );
|
||||
}
|
||||
|
||||
void noopiiu::subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
void noopiiu::subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
nciu & chan, netSubscription & subscr )
|
||||
{
|
||||
netiiu::subscriptionCancelRequest ( guard, chan, subscr );
|
||||
}
|
||||
|
||||
void noopiiu::flushRequest (
|
||||
void noopiiu::flushRequest (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
netiiu::flushRequest ( guard );
|
||||
}
|
||||
|
||||
unsigned noopiiu::requestMessageBytesPending (
|
||||
unsigned noopiiu::requestMessageBytesPending (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
return netiiu::requestMessageBytesPending ( guard );
|
||||
}
|
||||
|
||||
void noopiiu::flush (
|
||||
void noopiiu::flush (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
netiiu::flush ( guard );
|
||||
@@ -144,14 +144,14 @@ double noopiiu::receiveWatchdogDelay (
|
||||
return netiiu::receiveWatchdogDelay ( guard );
|
||||
}
|
||||
|
||||
void noopiiu::uninstallChan (
|
||||
void noopiiu::uninstallChan (
|
||||
epicsGuard < epicsMutex > &, nciu & )
|
||||
{
|
||||
// intentionally does not call default in netiiu
|
||||
}
|
||||
|
||||
void noopiiu::uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
void noopiiu::uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
const class epicsTime & currentTime )
|
||||
{
|
||||
netiiu::uninstallChanDueToSuccessfulSearchResponse (
|
||||
@@ -159,7 +159,7 @@ void noopiiu::uninstallChanDueToSuccessfulSearchResponse (
|
||||
}
|
||||
|
||||
bool noopiiu::searchMsg (
|
||||
epicsGuard < epicsMutex > & guard, ca_uint32_t id,
|
||||
epicsGuard < epicsMutex > & guard, ca_uint32_t id,
|
||||
const char * pName, unsigned nameLength )
|
||||
{
|
||||
return netiiu::searchMsg (
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_noopiiu_H
|
||||
@@ -29,60 +29,60 @@
|
||||
class noopiiu : public netiiu {
|
||||
public:
|
||||
~noopiiu ();
|
||||
unsigned getHostName (
|
||||
epicsGuard < epicsMutex > &, char * pBuf,
|
||||
unsigned getHostName (
|
||||
epicsGuard < epicsMutex > &, char * pBuf,
|
||||
unsigned bufLength ) const throw ();
|
||||
const char * pHostName (
|
||||
epicsGuard < epicsMutex > & ) const throw ();
|
||||
epicsGuard < epicsMutex > & ) const throw ();
|
||||
bool ca_v41_ok (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
bool ca_v42_ok (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
unsigned requestMessageBytesPending (
|
||||
unsigned requestMessageBytesPending (
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard );
|
||||
void flush (
|
||||
void flush (
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard );
|
||||
void writeRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
void writeRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
const void *pValue );
|
||||
void writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netWriteNotifyIO &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
void writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netWriteNotifyIO &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
const void *pValue );
|
||||
void readNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
netReadNotifyIO &, unsigned type,
|
||||
void readNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
netReadNotifyIO &, unsigned type,
|
||||
arrayElementCount nElem );
|
||||
void clearChannelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void clearChannelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
ca_uint32_t sid, ca_uint32_t cid );
|
||||
void subscriptionRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void subscriptionRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netSubscription & );
|
||||
void subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netSubscription & );
|
||||
void subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu & chan, netSubscription & subscr );
|
||||
void flushRequest (
|
||||
void flushRequest (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void requestRecvProcessPostponedFlush (
|
||||
epicsGuard < epicsMutex > & );
|
||||
osiSockAddr getNetworkAddress (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
void uninstallChan (
|
||||
epicsGuard < epicsMutex > & mutex,
|
||||
void uninstallChan (
|
||||
epicsGuard < epicsMutex > & mutex,
|
||||
nciu & );
|
||||
void uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
void uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
const class epicsTime & currentTime );
|
||||
double receiveWatchdogDelay (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
bool searchMsg (
|
||||
epicsGuard < epicsMutex > &, ca_uint32_t id,
|
||||
epicsGuard < epicsMutex > &, ca_uint32_t id,
|
||||
const char * pName, unsigned nameLength );
|
||||
};
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
* Copyright, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_oldAccess_H
|
||||
@@ -185,8 +185,8 @@ private:
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > &, int status,
|
||||
const char *pContext, unsigned type, arrayElementCount count );
|
||||
getCopy ( const getCopy & );
|
||||
getCopy & operator = ( const getCopy & );
|
||||
getCopy ( const getCopy & );
|
||||
getCopy & operator = ( const getCopy & );
|
||||
void operator delete ( void * );
|
||||
};
|
||||
|
||||
@@ -210,8 +210,8 @@ private:
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > &, int status,
|
||||
const char * pContext, unsigned type, arrayElementCount count );
|
||||
getCallback ( const getCallback & );
|
||||
getCallback & operator = ( const getCallback & );
|
||||
getCallback ( const getCallback & );
|
||||
getCallback & operator = ( const getCallback & );
|
||||
void operator delete ( void * );
|
||||
};
|
||||
|
||||
@@ -233,8 +233,8 @@ private:
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > &, int status, const char *pContext,
|
||||
unsigned type, arrayElementCount count );
|
||||
putCallback ( const putCallback & );
|
||||
putCallback & operator = ( const putCallback & );
|
||||
putCallback ( const putCallback & );
|
||||
putCallback & operator = ( const putCallback & );
|
||||
void operator delete ( void * );
|
||||
};
|
||||
|
||||
@@ -273,8 +273,8 @@ private:
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > &, int status,
|
||||
const char *pContext, unsigned type, arrayElementCount count );
|
||||
oldSubscription ( const oldSubscription & );
|
||||
oldSubscription & operator = ( const oldSubscription & );
|
||||
oldSubscription ( const oldSubscription & );
|
||||
oldSubscription & operator = ( const oldSubscription & );
|
||||
void operator delete ( void * );
|
||||
};
|
||||
|
||||
@@ -374,7 +374,7 @@ public:
|
||||
friend int ca_sync_group_destroy ( CallbackGuard & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
ca_client_context & cac, const CA_SYNC_GID gid );
|
||||
friend void sync_group_reset ( ca_client_context & client,
|
||||
friend void sync_group_reset ( ca_client_context & client,
|
||||
CASG & sg );
|
||||
|
||||
// exceptions
|
||||
@@ -571,7 +571,7 @@ inline unsigned ca_client_context::sequenceNumberOfOutstandingIO (
|
||||
}
|
||||
|
||||
template < class T >
|
||||
void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO (
|
||||
void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO (
|
||||
epicsGuard < epicsMutex > & guard, T & io )
|
||||
{
|
||||
if ( this->pCallbackGuard.get() &&
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -26,12 +26,12 @@
|
||||
#include "oldAccess.h"
|
||||
|
||||
oldSubscription::oldSubscription (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
oldChannelNotify & chanIn, cacChannel & io,
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
oldChannelNotify & chanIn, cacChannel & io,
|
||||
unsigned type, arrayElementCount nElem, unsigned mask,
|
||||
caEventCallBackFunc * pFuncIn, void * pPrivateIn,
|
||||
evid * pEventId ) :
|
||||
chan ( chanIn ), id ( UINT_MAX ), pFunc ( pFuncIn ),
|
||||
chan ( chanIn ), id ( UINT_MAX ), pFunc ( pFuncIn ),
|
||||
pPrivate ( pPrivateIn )
|
||||
{
|
||||
// The users event id *must* be set prior to potentially
|
||||
@@ -49,7 +49,7 @@ oldSubscription::~oldSubscription ()
|
||||
{
|
||||
}
|
||||
|
||||
void oldSubscription::current (
|
||||
void oldSubscription::current (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
unsigned type, arrayElementCount count, const void * pData )
|
||||
{
|
||||
@@ -66,10 +66,10 @@ void oldSubscription::current (
|
||||
( *pFuncTmp ) ( args );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void oldSubscription::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
int status, const char * /* pContext */,
|
||||
int status, const char * /* pContext */,
|
||||
unsigned type, arrayElementCount count )
|
||||
{
|
||||
if ( status == ECA_CHANDESTROY ) {
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
@@ -30,8 +30,8 @@
|
||||
#include "iocinf.h"
|
||||
#include "oldAccess.h"
|
||||
|
||||
putCallback::putCallback (
|
||||
oldChannelNotify & chanIn, caEventCallBackFunc * pFuncIn,
|
||||
putCallback::putCallback (
|
||||
oldChannelNotify & chanIn, caEventCallBackFunc * pFuncIn,
|
||||
void * pPrivateIn ) :
|
||||
chan ( chanIn ), pFunc ( pFuncIn ), pPrivate ( pPrivateIn )
|
||||
{
|
||||
@@ -61,9 +61,9 @@ void putCallback::completion ( epicsGuard < epicsMutex > & guard )
|
||||
}
|
||||
}
|
||||
|
||||
void putCallback::exception (
|
||||
void putCallback::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
int status, const char * /* pContext */,
|
||||
int status, const char * /* pContext */,
|
||||
unsigned type, arrayElementCount count )
|
||||
{
|
||||
if ( status != ECA_CHANDESTROY ) {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
* received it goes to all sockets on the same port, but if a unicast is
|
||||
* received it goes to only one of the sockets on the same port (we can only
|
||||
* guess at which one it will be).
|
||||
*
|
||||
*
|
||||
* I have observed this behavior under winsock II:
|
||||
* o only one of the sockets on the same port receives the message if we
|
||||
* send to the loopback address
|
||||
@@ -76,7 +76,7 @@
|
||||
#include "addrList.h"
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* these can be external since there is only one instance
|
||||
* per machine so we dont care about reentrancy
|
||||
*/
|
||||
@@ -89,7 +89,7 @@ static const unsigned short PORT_ANY = 0u;
|
||||
*/
|
||||
static int makeSocket ( unsigned short port, bool reuseAddr, SOCKET * pSock )
|
||||
{
|
||||
SOCKET sock = epicsSocketCreate ( AF_INET, SOCK_DGRAM, 0 );
|
||||
SOCKET sock = epicsSocketCreate ( AF_INET, SOCK_DGRAM, 0 );
|
||||
|
||||
if ( sock == INVALID_SOCKET ) {
|
||||
*pSock = sock;
|
||||
@@ -108,8 +108,8 @@ static int makeSocket ( unsigned short port, bool reuseAddr, SOCKET * pSock )
|
||||
|
||||
memset ( (char *) &bd, 0, sizeof (bd) );
|
||||
bd.ia.sin_family = AF_INET;
|
||||
bd.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
|
||||
bd.ia.sin_port = htons ( port );
|
||||
bd.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
|
||||
bd.ia.sin_port = htons ( port );
|
||||
status = bind ( sock, &bd.sa, (int) sizeof(bd) );
|
||||
if ( status < 0 ) {
|
||||
status = SOCKERRNO;
|
||||
@@ -139,7 +139,7 @@ bool repeaterClient::connect ()
|
||||
|
||||
if ( int sockerrno = makeSocket ( PORT_ANY, false, & this->sock ) ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrorToString (
|
||||
epicsSocketConvertErrorToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ), sockerrno );
|
||||
fprintf ( stderr, "%s: no client sock because \"%s\"\n",
|
||||
__FILE__, sockErrBuf );
|
||||
@@ -149,7 +149,7 @@ bool repeaterClient::connect ()
|
||||
status = ::connect ( this->sock, &this->from.sa, sizeof ( this->from.sa ) );
|
||||
if ( status < 0 ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
fprintf ( stderr, "%s: unable to connect client sock because \"%s\"\n",
|
||||
__FILE__, sockErrBuf );
|
||||
@@ -178,7 +178,7 @@ bool repeaterClient::sendConfirm ()
|
||||
}
|
||||
else {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
debugPrintf ( ( "CA Repeater: confirm req err was \"%s\"\n", sockErrBuf) );
|
||||
return false;
|
||||
@@ -227,7 +227,7 @@ repeaterClient::~repeaterClient ()
|
||||
}
|
||||
|
||||
void repeaterClient::operator delete ( void * )
|
||||
{
|
||||
{
|
||||
// Visual C++ .net appears to require operator delete if
|
||||
// placement operator delete is defined? I smell a ms rat
|
||||
// because if I declare placement new and delete, but
|
||||
@@ -237,16 +237,16 @@ void repeaterClient::operator delete ( void * )
|
||||
__FILE__, __LINE__ );
|
||||
}
|
||||
|
||||
void * repeaterClient::operator new ( size_t size,
|
||||
void * repeaterClient::operator new ( size_t size,
|
||||
tsFreeList < repeaterClient, 0x20 > & freeList )
|
||||
{
|
||||
{
|
||||
return freeList.allocate ( size );
|
||||
}
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
void repeaterClient::operator delete ( void *pCadaver,
|
||||
tsFreeList < repeaterClient, 0x20 > & freeList )
|
||||
{
|
||||
void repeaterClient::operator delete ( void *pCadaver,
|
||||
tsFreeList < repeaterClient, 0x20 > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
#endif
|
||||
@@ -326,7 +326,7 @@ static void verifyClients ( tsFreeList < repeaterClient, 0x20 > & freeList )
|
||||
/*
|
||||
* fanOut()
|
||||
*/
|
||||
static void fanOut ( const osiSockAddr & from, const void * pMsg,
|
||||
static void fanOut ( const osiSockAddr & from, const void * pMsg,
|
||||
unsigned msgSize, tsFreeList < repeaterClient, 0x20 > & freeList )
|
||||
{
|
||||
static tsDLList < repeaterClient > theClients;
|
||||
@@ -354,7 +354,7 @@ static void fanOut ( const osiSockAddr & from, const void * pMsg,
|
||||
/*
|
||||
* register_new_client()
|
||||
*/
|
||||
static void register_new_client ( osiSockAddr & from,
|
||||
static void register_new_client ( osiSockAddr & from,
|
||||
tsFreeList < repeaterClient, 0x20 > & freeList )
|
||||
{
|
||||
bool newClient = false;
|
||||
@@ -375,7 +375,7 @@ static void register_new_client ( osiSockAddr & from,
|
||||
SOCKET sock;
|
||||
if ( int sockerrno = makeSocket ( PORT_ANY, true, & sock ) ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrorToString (
|
||||
epicsSocketConvertErrorToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ), sockerrno );
|
||||
fprintf ( stderr, "%s: Unable to create repeater bind test socket because \"%s\"\n",
|
||||
__FILE__, sockErrBuf );
|
||||
@@ -391,7 +391,7 @@ static void register_new_client ( osiSockAddr & from,
|
||||
* repeater would not always allow the loopback address
|
||||
* as a local client address so current clients alternate
|
||||
* between the address of the first non-loopback interface
|
||||
* found and the loopback addresss when subscribing with
|
||||
* found and the loopback addresss when subscribing with
|
||||
* the CA repeater until all CA repeaters have been updated
|
||||
* to current code.
|
||||
*/
|
||||
@@ -418,8 +418,8 @@ static void register_new_client ( osiSockAddr & from,
|
||||
break;
|
||||
}
|
||||
pclient++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
repeaterClient *pNewClient;
|
||||
if ( pclient.valid () ) {
|
||||
pNewClient = pclient.pointer ();
|
||||
@@ -435,7 +435,7 @@ static void register_new_client ( osiSockAddr & from,
|
||||
freeList.release ( pNewClient );
|
||||
return;
|
||||
}
|
||||
client_list.add ( *pNewClient );
|
||||
client_list.add ( *pNewClient );
|
||||
newClient = true;
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ static void register_new_client ( osiSockAddr & from,
|
||||
}
|
||||
|
||||
/*
|
||||
* send a noop message to all other clients so that we dont
|
||||
* send a noop message to all other clients so that we dont
|
||||
* accumulate sockets when there are no beacons
|
||||
*/
|
||||
caHdr noop;
|
||||
@@ -479,14 +479,14 @@ static void register_new_client ( osiSockAddr & from,
|
||||
/*
|
||||
* ca_repeater ()
|
||||
*/
|
||||
void ca_repeater ()
|
||||
void ca_repeater ()
|
||||
{
|
||||
tsFreeList < repeaterClient, 0x20 > freeList;
|
||||
int size;
|
||||
SOCKET sock;
|
||||
osiSockAddr from;
|
||||
unsigned short port;
|
||||
char * pBuf;
|
||||
char * pBuf;
|
||||
|
||||
pBuf = new char [MAX_UDP_RECV];
|
||||
|
||||
@@ -508,7 +508,7 @@ void ca_repeater ()
|
||||
return;
|
||||
}
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrorToString (
|
||||
epicsSocketConvertErrorToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ), sockerrno );
|
||||
fprintf ( stderr, "%s: Unable to create repeater socket because \"%s\" - fatal\n",
|
||||
__FILE__, sockErrBuf );
|
||||
@@ -584,7 +584,7 @@ void ca_repeater ()
|
||||
continue;
|
||||
}
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
fprintf ( stderr, "CA Repeater: unexpected UDP recv err: %s\n",
|
||||
sockErrBuf );
|
||||
@@ -621,7 +621,7 @@ void ca_repeater ()
|
||||
continue;
|
||||
}
|
||||
|
||||
fanOut ( from, pMsg, size, freeList );
|
||||
fanOut ( from, pMsg, size, freeList );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_repeaterClient_H
|
||||
@@ -47,9 +47,9 @@ public:
|
||||
bool verify ();
|
||||
bool identicalAddress ( const osiSockAddr &from );
|
||||
bool identicalPort ( const osiSockAddr &from );
|
||||
void * operator new ( size_t size,
|
||||
void * operator new ( size_t size,
|
||||
tsFreeList < repeaterClient, 0x20 > & );
|
||||
epicsPlacementDeleteOperator (( void *,
|
||||
epicsPlacementDeleteOperator (( void *,
|
||||
tsFreeList < repeaterClient, 0x20 > & ))
|
||||
private:
|
||||
osiSockAddr from;
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
static const double repeaterSubscribeTimerInitialPeriod = 10.0; // sec
|
||||
static const double repeaterSubscribeTimerPeriod = 1.0; // sec
|
||||
|
||||
repeaterSubscribeTimer::repeaterSubscribeTimer (
|
||||
repeaterSubscribeTimer::repeaterSubscribeTimer (
|
||||
repeaterTimerNotify & iiuIn, epicsTimerQueue & queueIn,
|
||||
epicsMutex & cbMutexIn, cacContextNotify & ctxNotifyIn ) :
|
||||
timer ( queueIn.createTimer () ), iiu ( iiuIn ),
|
||||
timer ( queueIn.createTimer () ), iiu ( iiuIn ),
|
||||
cbMutex ( cbMutexIn ),ctxNotify ( ctxNotifyIn ),
|
||||
stateMutex(__FILE__, __LINE__),
|
||||
attempts ( 0 ), registered ( false ), once ( false )
|
||||
@@ -46,7 +46,7 @@ repeaterSubscribeTimer::~repeaterSubscribeTimer ()
|
||||
|
||||
void repeaterSubscribeTimer::start ()
|
||||
{
|
||||
this->timer.start (
|
||||
this->timer.start (
|
||||
*this, repeaterSubscribeTimerInitialPeriod );
|
||||
}
|
||||
|
||||
@@ -65,12 +65,12 @@ epicsTimerNotify::expireStatus repeaterSubscribeTimer::
|
||||
expire ( const epicsTime & /* currentTime */ )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->stateMutex );
|
||||
|
||||
|
||||
static const unsigned nTriesToMsg = 50;
|
||||
if ( this->attempts > nTriesToMsg && ! this->once ) {
|
||||
callbackManager mgr ( this->ctxNotify, this->cbMutex );
|
||||
this->iiu.printFormated ( mgr.cbGuard,
|
||||
"CA client library is unable to contact CA repeater after %u tries.\n",
|
||||
"CA client library is unable to contact CA repeater after %u tries.\n",
|
||||
nTriesToMsg );
|
||||
this->iiu.printFormated ( mgr.cbGuard,
|
||||
"Silence this message by starting a CA repeater daemon\n") ;
|
||||
@@ -93,7 +93,7 @@ epicsTimerNotify::expireStatus repeaterSubscribeTimer::
|
||||
void repeaterSubscribeTimer::show ( unsigned /* level */ ) const
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->stateMutex );
|
||||
|
||||
|
||||
::printf ( "repeater subscribe timer: attempts=%u registered=%u once=%u\n",
|
||||
this->attempts, this->registered, this->once );
|
||||
}
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_repeaterSubscribeTimer_H
|
||||
@@ -35,17 +35,17 @@ class cacContextNotify;
|
||||
class repeaterTimerNotify {
|
||||
public:
|
||||
virtual ~repeaterTimerNotify () = 0;
|
||||
virtual void repeaterRegistrationMessage (
|
||||
virtual void repeaterRegistrationMessage (
|
||||
unsigned attemptNumber ) = 0;
|
||||
virtual int printFormated (
|
||||
epicsGuard < epicsMutex > & callbackControl,
|
||||
virtual int printFormated (
|
||||
epicsGuard < epicsMutex > & callbackControl,
|
||||
const char * pformat, ... ) = 0;
|
||||
};
|
||||
|
||||
class repeaterSubscribeTimer : private epicsTimerNotify {
|
||||
public:
|
||||
repeaterSubscribeTimer (
|
||||
repeaterTimerNotify &, epicsTimerQueue &,
|
||||
repeaterSubscribeTimer (
|
||||
repeaterTimerNotify &, epicsTimerQueue &,
|
||||
epicsMutex & cbMutex, cacContextNotify & ctxNotify );
|
||||
virtual ~repeaterSubscribeTimer ();
|
||||
void start ();
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
void confirmNotify ();
|
||||
void show ( unsigned level ) const;
|
||||
void show ( unsigned level ) const;
|
||||
private:
|
||||
epicsTimer & timer;
|
||||
repeaterTimerNotify & iiu;
|
||||
@@ -63,9 +63,9 @@ private:
|
||||
unsigned attempts;
|
||||
bool registered;
|
||||
bool once;
|
||||
expireStatus expire ( const epicsTime & currentTime );
|
||||
repeaterSubscribeTimer ( const repeaterSubscribeTimer & );
|
||||
repeaterSubscribeTimer & operator = ( const repeaterSubscribeTimer & );
|
||||
expireStatus expire ( const epicsTime & currentTime );
|
||||
repeaterSubscribeTimer ( const repeaterSubscribeTimer & );
|
||||
repeaterSubscribeTimer & operator = ( const repeaterSubscribeTimer & );
|
||||
};
|
||||
|
||||
#endif // ifdef INC_repeaterSubscribeTimer_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
//
|
||||
//
|
||||
//
|
||||
// L O S A L A M O S
|
||||
// Los Alamos National Laboratory
|
||||
@@ -18,7 +18,7 @@
|
||||
//
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string> // vxWorks 6.0 requires this include
|
||||
#include <string> // vxWorks 6.0 requires this include
|
||||
#include <limits.h>
|
||||
|
||||
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
|
||||
@@ -30,15 +30,15 @@
|
||||
#include "nciu.h"
|
||||
|
||||
static const unsigned initialTriesPerFrame = 1u; // initial UDP frames per search try
|
||||
static const unsigned maxTriesPerFrame = 64u; // max UDP frames per search try
|
||||
static const unsigned maxTriesPerFrame = 64u; // max UDP frames per search try
|
||||
|
||||
//
|
||||
// searchTimer::searchTimer ()
|
||||
//
|
||||
searchTimer::searchTimer (
|
||||
searchTimerNotify & iiuIn,
|
||||
epicsTimerQueue & queueIn,
|
||||
const unsigned indexIn,
|
||||
searchTimer::searchTimer (
|
||||
searchTimerNotify & iiuIn,
|
||||
epicsTimerQueue & queueIn,
|
||||
const unsigned indexIn,
|
||||
epicsMutex & mutexIn,
|
||||
bool boostPossibleIn ) :
|
||||
timeAtLastSend ( epicsTime::getCurrent () ),
|
||||
@@ -71,7 +71,7 @@ searchTimer::~searchTimer ()
|
||||
this->timer.destroy ();
|
||||
}
|
||||
|
||||
void searchTimer::shutdown (
|
||||
void searchTimer::shutdown (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
@@ -85,25 +85,25 @@ void searchTimer::shutdown (
|
||||
}
|
||||
|
||||
while ( nciu * pChan = this->chanListReqPending.get () ) {
|
||||
pChan->channelNode::listMember =
|
||||
pChan->channelNode::listMember =
|
||||
channelNode::cs_none;
|
||||
pChan->serviceShutdownNotify ( cbGuard, guard );
|
||||
}
|
||||
while ( nciu * pChan = this->chanListRespPending.get () ) {
|
||||
pChan->channelNode::listMember =
|
||||
pChan->channelNode::listMember =
|
||||
channelNode::cs_none;
|
||||
pChan->serviceShutdownNotify ( cbGuard, guard );
|
||||
}
|
||||
}
|
||||
|
||||
void searchTimer::installChannel (
|
||||
void searchTimer::installChannel (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan )
|
||||
{
|
||||
this->chanListReqPending.add ( chan );
|
||||
chan.channelNode::setReqPendingState ( guard, this->index );
|
||||
}
|
||||
|
||||
void searchTimer::moveChannels (
|
||||
void searchTimer::moveChannels (
|
||||
epicsGuard < epicsMutex > & guard, searchTimer & dest )
|
||||
{
|
||||
while ( nciu * pChan = this->chanListRespPending.get () ) {
|
||||
@@ -120,25 +120,25 @@ void searchTimer::moveChannels (
|
||||
//
|
||||
// searchTimer::expire ()
|
||||
//
|
||||
epicsTimerNotify::expireStatus searchTimer::expire (
|
||||
epicsTimerNotify::expireStatus searchTimer::expire (
|
||||
const epicsTime & currentTime )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
|
||||
while ( nciu * pChan = this->chanListRespPending.get () ) {
|
||||
pChan->channelNode::listMember =
|
||||
pChan->channelNode::listMember =
|
||||
channelNode::cs_none;
|
||||
this->iiu.noSearchRespNotify (
|
||||
this->iiu.noSearchRespNotify (
|
||||
guard, *pChan, this->index );
|
||||
}
|
||||
|
||||
|
||||
this->timeAtLastSend = currentTime;
|
||||
|
||||
// boost search period for channels not recently
|
||||
// searched for if there was some success
|
||||
if ( this->searchResponses && this->boostPossible ) {
|
||||
while ( nciu * pChan = this->chanListReqPending.get () ) {
|
||||
pChan->channelNode::listMember =
|
||||
pChan->channelNode::listMember =
|
||||
channelNode::cs_none;
|
||||
this->iiu.boostChannel ( guard, *pChan );
|
||||
}
|
||||
@@ -147,8 +147,8 @@ epicsTimerNotify::expireStatus searchTimer::expire (
|
||||
if ( this->searchAttempts ) {
|
||||
#if 0
|
||||
//
|
||||
// dynamically adjust the number of UDP frames per
|
||||
// try depending how many search requests are not
|
||||
// dynamically adjust the number of UDP frames per
|
||||
// try depending how many search requests are not
|
||||
// replied to
|
||||
//
|
||||
// The variable this->framesPerTry
|
||||
@@ -158,13 +158,13 @@ epicsTimerNotify::expireStatus searchTimer::expire (
|
||||
// network bandwidth. If it is too low we will
|
||||
// use very little of the incoming UDP message
|
||||
// buffer associated with the server's port and
|
||||
// will therefore take longer to connect. We
|
||||
// initialize this->framesPerTry to a prime number
|
||||
// will therefore take longer to connect. We
|
||||
// initialize this->framesPerTry to a prime number
|
||||
// so that it is less likely that the
|
||||
// same channel is in the last UDP frame
|
||||
// sent every time that this is called (and
|
||||
// potentially discarded by a CA server with
|
||||
// a small UDP input queue).
|
||||
// a small UDP input queue).
|
||||
//
|
||||
// increase frames per try only if we see better than
|
||||
// a 93.75% success rate for one pass through the list
|
||||
@@ -180,19 +180,19 @@ epicsTimerNotify::expireStatus searchTimer::expire (
|
||||
else {
|
||||
this->framesPerTry += (this->framesPerTry/8) + 1;
|
||||
}
|
||||
debugPrintf ( ("Increasing frame count to %u t=%u r=%u\n",
|
||||
debugPrintf ( ("Increasing frame count to %u t=%u r=%u\n",
|
||||
this->framesPerTry, this->searchAttempts, this->searchResponses) );
|
||||
}
|
||||
}
|
||||
// if we detect congestion because we have less than a 87.5% success
|
||||
// if we detect congestion because we have less than a 87.5% success
|
||||
// rate then gradually reduce the frames per try
|
||||
else if ( this->searchResponses <
|
||||
else if ( this->searchResponses <
|
||||
( this->searchAttempts - (this->searchAttempts/8u) ) ) {
|
||||
if ( this->framesPerTry > 1 ) {
|
||||
this->framesPerTry--;
|
||||
}
|
||||
this->framesPerTryCongestThresh = this->framesPerTry/2 + 1;
|
||||
debugPrintf ( ("Congestion detected - set frames per try to %f t=%u r=%u\n",
|
||||
debugPrintf ( ("Congestion detected - set frames per try to %f t=%u r=%u\n",
|
||||
this->framesPerTry, this->searchAttempts, this->searchResponses) );
|
||||
}
|
||||
#else
|
||||
@@ -212,20 +212,20 @@ epicsTimerNotify::expireStatus searchTimer::expire (
|
||||
else {
|
||||
this->framesPerTry += 1.0 / this->framesPerTry;
|
||||
}
|
||||
debugPrintf ( ("Increasing frame count to %g t=%u r=%u\n",
|
||||
debugPrintf ( ("Increasing frame count to %g t=%u r=%u\n",
|
||||
this->framesPerTry, this->searchAttempts, this->searchResponses) );
|
||||
}
|
||||
}
|
||||
else {
|
||||
this->framesPerTryCongestThresh = this->framesPerTry / 2.0;
|
||||
this->framesPerTry = 1u;
|
||||
debugPrintf ( ("Congestion detected - set frames per try to %g t=%u r=%u\n",
|
||||
debugPrintf ( ("Congestion detected - set frames per try to %g t=%u r=%u\n",
|
||||
this->framesPerTry, this->searchAttempts, this->searchResponses) );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
this->dgSeqNoAtTimerExpireBegin =
|
||||
this->dgSeqNoAtTimerExpireBegin =
|
||||
this->iiu.datagramSeqNumber ( guard );
|
||||
|
||||
this->searchAttempts = 0;
|
||||
@@ -238,9 +238,9 @@ epicsTimerNotify::expireStatus searchTimer::expire (
|
||||
break;
|
||||
}
|
||||
|
||||
pChan->channelNode::listMember =
|
||||
pChan->channelNode::listMember =
|
||||
channelNode::cs_none;
|
||||
|
||||
|
||||
bool success = pChan->searchMsg ( guard );
|
||||
if ( ! success ) {
|
||||
if ( this->iiu.datagramFlush ( guard, currentTime ) ) {
|
||||
@@ -251,14 +251,14 @@ epicsTimerNotify::expireStatus searchTimer::expire (
|
||||
}
|
||||
if ( ! success ) {
|
||||
this->chanListReqPending.push ( *pChan );
|
||||
pChan->channelNode::setReqPendingState (
|
||||
pChan->channelNode::setReqPendingState (
|
||||
guard, this->index );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this->chanListRespPending.add ( *pChan );
|
||||
pChan->channelNode::setRespPendingState (
|
||||
pChan->channelNode::setRespPendingState (
|
||||
guard, this->index );
|
||||
|
||||
if ( this->searchAttempts < UINT_MAX ) {
|
||||
@@ -271,14 +271,14 @@ epicsTimerNotify::expireStatus searchTimer::expire (
|
||||
nFrameSent++;
|
||||
}
|
||||
|
||||
this->dgSeqNoAtTimerExpireEnd =
|
||||
this->dgSeqNoAtTimerExpireEnd =
|
||||
this->iiu.datagramSeqNumber ( guard ) - 1u;
|
||||
|
||||
# ifdef DEBUG
|
||||
if ( this->searchAttempts ) {
|
||||
char buf[64];
|
||||
currentTime.strftime ( buf, sizeof(buf), "%M:%S.%09f");
|
||||
debugPrintf ( ("sent %u delay sec=%f Rts=%s\n",
|
||||
debugPrintf ( ("sent %u delay sec=%f Rts=%s\n",
|
||||
nFrameSent, this->period(), buf ) );
|
||||
}
|
||||
# endif
|
||||
@@ -291,22 +291,22 @@ void searchTimer :: show ( unsigned level ) const
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
::printf ( "searchTimer with period %f\n", this->period ( guard ) );
|
||||
if ( level > 0 ) {
|
||||
::printf ( "channels with search request pending = %u\n",
|
||||
::printf ( "channels with search request pending = %u\n",
|
||||
this->chanListReqPending.count () );
|
||||
if ( level > 1u ) {
|
||||
tsDLIterConst < nciu > pChan =
|
||||
tsDLIterConst < nciu > pChan =
|
||||
this->chanListReqPending.firstIter ();
|
||||
while ( pChan.valid () ) {
|
||||
while ( pChan.valid () ) {
|
||||
pChan->show ( level - 2u );
|
||||
pChan++;
|
||||
}
|
||||
}
|
||||
::printf ( "channels with search response pending = %u\n",
|
||||
::printf ( "channels with search response pending = %u\n",
|
||||
this->chanListRespPending.count () );
|
||||
if ( level > 1u ) {
|
||||
tsDLIterConst < nciu > pChan =
|
||||
tsDLIterConst < nciu > pChan =
|
||||
this->chanListRespPending.firstIter ();
|
||||
while ( pChan.valid () ) {
|
||||
while ( pChan.valid () ) {
|
||||
pChan->show ( level - 2u );
|
||||
pChan++;
|
||||
}
|
||||
@@ -319,9 +319,9 @@ void searchTimer :: show ( unsigned level ) const
|
||||
// at least one response. However, dont reset this delay if we
|
||||
// get a delayed response to an old search request.
|
||||
//
|
||||
void searchTimer::uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
ca_uint32_t respDatagramSeqNo, bool seqNumberIsValid,
|
||||
void searchTimer::uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
ca_uint32_t respDatagramSeqNo, bool seqNumberIsValid,
|
||||
const epicsTime & currentTime )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
@@ -333,8 +333,8 @@ void searchTimer::uninstallChanDueToSuccessfulSearchResponse (
|
||||
|
||||
bool validResponse = true;
|
||||
if ( seqNumberIsValid ) {
|
||||
validResponse =
|
||||
this->dgSeqNoAtTimerExpireBegin <= respDatagramSeqNo &&
|
||||
validResponse =
|
||||
this->dgSeqNoAtTimerExpireBegin <= respDatagramSeqNo &&
|
||||
this->dgSeqNoAtTimerExpireEnd >= respDatagramSeqNo;
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ void searchTimer::uninstallChanDueToSuccessfulSearchResponse (
|
||||
if ( this->searchResponses == this->searchAttempts ) {
|
||||
if ( this->chanListReqPending.count () ) {
|
||||
//
|
||||
// when we get 100% success immediately
|
||||
// when we get 100% success immediately
|
||||
// send another search request
|
||||
//
|
||||
debugPrintf ( ( "All requests succesful, set timer delay to zero\n" ) );
|
||||
@@ -364,25 +364,25 @@ void searchTimer::uninstallChan (
|
||||
epicsGuard < epicsMutex > & cacGuard, nciu & chan )
|
||||
{
|
||||
cacGuard.assertIdenticalMutex ( this->mutex );
|
||||
unsigned ulistmem =
|
||||
static_cast <unsigned> ( chan.channelNode::listMember );
|
||||
unsigned uReqBase =
|
||||
static_cast <unsigned> ( channelNode::cs_searchReqPending0 );
|
||||
unsigned ulistmem =
|
||||
static_cast <unsigned> ( chan.channelNode::listMember );
|
||||
unsigned uReqBase =
|
||||
static_cast <unsigned> ( channelNode::cs_searchReqPending0 );
|
||||
if ( ulistmem == this->index + uReqBase ) {
|
||||
this->chanListReqPending.remove ( chan );
|
||||
}
|
||||
else {
|
||||
unsigned uRespBase =
|
||||
static_cast <unsigned > (
|
||||
channelNode::cs_searchRespPending0 );
|
||||
if ( ulistmem == this->index + uRespBase ) {
|
||||
this->chanListRespPending.remove ( chan );
|
||||
}
|
||||
else {
|
||||
throw std::runtime_error (
|
||||
"uninstalling channel search timer, but channel "
|
||||
"state is wrong" );
|
||||
}
|
||||
else {
|
||||
unsigned uRespBase =
|
||||
static_cast <unsigned > (
|
||||
channelNode::cs_searchRespPending0 );
|
||||
if ( ulistmem == this->index + uRespBase ) {
|
||||
this->chanListRespPending.remove ( chan );
|
||||
}
|
||||
else {
|
||||
throw std::runtime_error (
|
||||
"uninstalling channel search timer, but channel "
|
||||
"state is wrong" );
|
||||
}
|
||||
}
|
||||
chan.channelNode::listMember = channelNode::cs_none;
|
||||
}
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// L O S A L A M O S
|
||||
// Los Alamos National Laboratory
|
||||
// Los Alamos, New Mexico 87545
|
||||
//
|
||||
//
|
||||
// Copyright, 1986, The Regents of the University of California.
|
||||
//
|
||||
//
|
||||
// Author Jeffrey O. Hill
|
||||
// johill@lanl.gov
|
||||
// 505 665 1831
|
||||
//
|
||||
//
|
||||
// Author Jeffrey O. Hill
|
||||
// johill@lanl.gov
|
||||
// 505 665 1831
|
||||
//
|
||||
|
||||
#ifndef INC_searchTimer_H
|
||||
@@ -36,14 +36,14 @@
|
||||
class searchTimerNotify {
|
||||
public:
|
||||
virtual ~searchTimerNotify () = 0;
|
||||
virtual void boostChannel (
|
||||
virtual void boostChannel (
|
||||
epicsGuard < epicsMutex > &, nciu & ) = 0;
|
||||
virtual void noSearchRespNotify (
|
||||
virtual void noSearchRespNotify (
|
||||
epicsGuard < epicsMutex > &, nciu &, unsigned ) = 0;
|
||||
virtual double getRTTE ( epicsGuard < epicsMutex > & ) const = 0;
|
||||
virtual void updateRTTE ( epicsGuard < epicsMutex > &, double rtte ) = 0;
|
||||
virtual bool datagramFlush (
|
||||
epicsGuard < epicsMutex > &,
|
||||
virtual bool datagramFlush (
|
||||
epicsGuard < epicsMutex > &,
|
||||
const epicsTime & currentTime ) = 0;
|
||||
virtual ca_uint32_t datagramSeqNumber (
|
||||
epicsGuard < epicsMutex > & ) const = 0;
|
||||
@@ -51,24 +51,24 @@ public:
|
||||
|
||||
class searchTimer : private epicsTimerNotify {
|
||||
public:
|
||||
searchTimer (
|
||||
class searchTimerNotify &, epicsTimerQueue &,
|
||||
searchTimer (
|
||||
class searchTimerNotify &, epicsTimerQueue &,
|
||||
const unsigned index, epicsMutex &,
|
||||
bool boostPossible );
|
||||
virtual ~searchTimer ();
|
||||
void start ( epicsGuard < epicsMutex > & );
|
||||
void shutdown (
|
||||
void shutdown (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
void moveChannels (
|
||||
void moveChannels (
|
||||
epicsGuard < epicsMutex > &, searchTimer & dest );
|
||||
void installChannel (
|
||||
void installChannel (
|
||||
epicsGuard < epicsMutex > &, nciu & );
|
||||
void uninstallChan (
|
||||
void uninstallChan (
|
||||
epicsGuard < epicsMutex > &, nciu & );
|
||||
void uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
ca_uint32_t respDatagramSeqNo, bool seqNumberIsValid,
|
||||
void uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
ca_uint32_t respDatagramSeqNo, bool seqNumberIsValid,
|
||||
const epicsTime & currentTime );
|
||||
void show ( unsigned level ) const;
|
||||
private:
|
||||
@@ -84,15 +84,15 @@ private:
|
||||
unsigned searchAttempts; /* num search tries after last timer experation */
|
||||
unsigned searchResponses; /* num search resp after last timer experation */
|
||||
const unsigned index;
|
||||
ca_uint32_t dgSeqNoAtTimerExpireBegin;
|
||||
ca_uint32_t dgSeqNoAtTimerExpireBegin;
|
||||
ca_uint32_t dgSeqNoAtTimerExpireEnd;
|
||||
const bool boostPossible;
|
||||
bool stopped;
|
||||
|
||||
expireStatus expire ( const epicsTime & currentTime );
|
||||
double period ( epicsGuard < epicsMutex > & ) const;
|
||||
searchTimer ( const searchTimer & ); // not implemented
|
||||
searchTimer & operator = ( const searchTimer & ); // not implemented
|
||||
searchTimer ( const searchTimer & ); // not implemented
|
||||
searchTimer & operator = ( const searchTimer & ); // not implemented
|
||||
};
|
||||
|
||||
#endif // ifdef INC_searchTimer_H
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_sgAutoPtr_H
|
||||
@@ -39,18 +39,18 @@ private:
|
||||
T * pNotify;
|
||||
struct CASG & sg;
|
||||
epicsGuard < epicsMutex > & guard;
|
||||
sgAutoPtr & operator = ( const sgAutoPtr & );
|
||||
sgAutoPtr & operator = ( const sgAutoPtr & );
|
||||
};
|
||||
|
||||
template < class T >
|
||||
inline sgAutoPtr < T > :: sgAutoPtr (
|
||||
epicsGuard < epicsMutex > & guardIn, struct CASG & sgIn ) :
|
||||
inline sgAutoPtr < T > :: sgAutoPtr (
|
||||
epicsGuard < epicsMutex > & guardIn, struct CASG & sgIn ) :
|
||||
pNotify ( 0 ), sg ( sgIn ), guard ( guardIn )
|
||||
{
|
||||
}
|
||||
|
||||
template < class T >
|
||||
inline sgAutoPtr < T > :: ~sgAutoPtr ()
|
||||
inline sgAutoPtr < T > :: ~sgAutoPtr ()
|
||||
{
|
||||
if ( this->pNotify ) {
|
||||
this->sg.ioPendingList.remove ( *this->pNotify );
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_syncGroup_H
|
||||
@@ -60,7 +60,7 @@ struct CASG;
|
||||
|
||||
class syncGroupReadNotify : public syncGroupNotify, public cacReadNotify {
|
||||
public:
|
||||
typedef void ( CASG :: * PRecycleFunc )
|
||||
typedef void ( CASG :: * PRecycleFunc )
|
||||
( epicsGuard < epicsMutex > &, syncGroupReadNotify & );
|
||||
static syncGroupReadNotify * factory (
|
||||
tsFreeList < class syncGroupReadNotify, 128, epicsMutexNOOP > &,
|
||||
@@ -105,7 +105,7 @@ private:
|
||||
|
||||
class syncGroupWriteNotify : public syncGroupNotify, public cacWriteNotify {
|
||||
public:
|
||||
typedef void ( CASG :: * PRecycleFunc )
|
||||
typedef void ( CASG :: * PRecycleFunc )
|
||||
( epicsGuard < epicsMutex > &, syncGroupWriteNotify & );
|
||||
static syncGroupWriteNotify * factory (
|
||||
tsFreeList < class syncGroupWriteNotify, 128, epicsMutexNOOP > &,
|
||||
@@ -140,7 +140,7 @@ private:
|
||||
void completion ( epicsGuard < epicsMutex > & );
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > &, int status, const char *pContext,
|
||||
unsigned type, arrayElementCount count );
|
||||
unsigned type, arrayElementCount count );
|
||||
syncGroupWriteNotify ( const syncGroupWriteNotify & );
|
||||
syncGroupWriteNotify & operator = ( const syncGroupWriteNotify & );
|
||||
};
|
||||
@@ -164,9 +164,9 @@ public:
|
||||
void reset ( CallbackGuard &, epicsGuard < epicsMutex > & );
|
||||
void show ( epicsGuard < epicsMutex > &, unsigned level ) const;
|
||||
void show ( unsigned level ) const;
|
||||
void get ( epicsGuard < epicsMutex > &, chid pChan,
|
||||
void get ( epicsGuard < epicsMutex > &, chid pChan,
|
||||
unsigned type, arrayElementCount count, void * pValue );
|
||||
void put ( epicsGuard < epicsMutex > &, chid pChan,
|
||||
void put ( epicsGuard < epicsMutex > &, chid pChan,
|
||||
unsigned type, arrayElementCount count, const void * pValue );
|
||||
void completionNotify (
|
||||
epicsGuard < epicsMutex > &, syncGroupNotify & );
|
||||
@@ -198,9 +198,9 @@ private:
|
||||
void destroyCompletedIO (
|
||||
CallbackGuard & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
void recycleReadNotifyIO ( epicsGuard < epicsMutex > &,
|
||||
void recycleReadNotifyIO ( epicsGuard < epicsMutex > &,
|
||||
syncGroupReadNotify & );
|
||||
void recycleWriteNotifyIO ( epicsGuard < epicsMutex > &,
|
||||
void recycleWriteNotifyIO ( epicsGuard < epicsMutex > &,
|
||||
syncGroupWriteNotify & );
|
||||
|
||||
CASG ( const CASG & );
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "syncGroup.h"
|
||||
#include "oldAccess.h"
|
||||
|
||||
syncGroupNotify::syncGroupNotify ()
|
||||
syncGroupNotify::syncGroupNotify ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
syncGroupReadNotify::syncGroupReadNotify (
|
||||
CASG & sgIn, PRecycleFunc pRecycleFuncIn,
|
||||
chid pChan, void * pValueIn ) :
|
||||
chan ( pChan ), pRecycleFunc ( pRecycleFuncIn ),
|
||||
chan ( pChan ), pRecycleFunc ( pRecycleFuncIn ),
|
||||
sg ( sgIn ), pValue ( pValueIn ),
|
||||
magic ( CASG_MAGIC ), id ( 0u ),
|
||||
idIsValid ( false ), ioComplete ( false )
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "syncGroup.h"
|
||||
#include "oldAccess.h"
|
||||
|
||||
syncGroupWriteNotify::syncGroupWriteNotify ( CASG & sgIn,
|
||||
syncGroupWriteNotify::syncGroupWriteNotify ( CASG & sgIn,
|
||||
PRecycleFunc pRecycleFuncIn, chid pChan ) :
|
||||
chan ( pChan ), pRecycleFunc ( pRecycleFuncIn ),
|
||||
sg ( sgIn ), magic ( CASG_MAGIC ),
|
||||
|
||||
@@ -100,7 +100,7 @@ void sync_group_reset ( ca_client_context & client, CASG & sg )
|
||||
epicsGuard < epicsMutex > guard ( client.mutex );
|
||||
sg.reset ( *client.pCallbackGuard.get(), guard );
|
||||
}
|
||||
else {
|
||||
else {
|
||||
//
|
||||
// we will definately stall out here if all of the
|
||||
// following are true
|
||||
@@ -260,7 +260,7 @@ extern "C" int epicsStdCall ca_sg_array_put ( const CA_SYNC_GID gid, chtype type
|
||||
}
|
||||
|
||||
try {
|
||||
pcasg->put ( guard, pChan, type,
|
||||
pcasg->put ( guard, pChan, type,
|
||||
static_cast < unsigned > ( count ), pValue );
|
||||
return ECA_NORMAL;
|
||||
}
|
||||
@@ -322,7 +322,7 @@ extern "C" int epicsStdCall ca_sg_array_get ( const CA_SYNC_GID gid, chtype type
|
||||
}
|
||||
|
||||
try {
|
||||
pcasg->get ( guard, pChan, type,
|
||||
pcasg->get ( guard, pChan, type,
|
||||
static_cast < unsigned > ( count ), pValue );
|
||||
return ECA_NORMAL;
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
//
|
||||
// the recv watchdog timer is active when this object is created
|
||||
//
|
||||
tcpRecvWatchdog::tcpRecvWatchdog
|
||||
tcpRecvWatchdog::tcpRecvWatchdog
|
||||
( epicsMutex & cbMutexIn, cacContextNotify & ctxNotifyIn,
|
||||
epicsMutex & mutexIn, tcpiiu & iiuIn,
|
||||
epicsMutex & mutexIn, tcpiiu & iiuIn,
|
||||
double periodIn, epicsTimerQueue & queueIn ) :
|
||||
period ( periodIn ), timer ( queueIn.createTimer () ),
|
||||
cbMutex ( cbMutexIn ), ctxNotify ( ctxNotifyIn ),
|
||||
mutex ( mutexIn ), iiu ( iiuIn ),
|
||||
probeResponsePending ( false ), beaconAnomaly ( true ),
|
||||
cbMutex ( cbMutexIn ), ctxNotify ( ctxNotifyIn ),
|
||||
mutex ( mutexIn ), iiu ( iiuIn ),
|
||||
probeResponsePending ( false ), beaconAnomaly ( true ),
|
||||
probeTimeoutDetected ( false ), shuttingDown ( false )
|
||||
{
|
||||
}
|
||||
@@ -60,15 +60,15 @@ tcpRecvWatchdog::expire ( const epicsTime & /* currentTime */ )
|
||||
char hostName[128];
|
||||
this->iiu.getHostName ( guard, hostName, sizeof (hostName) );
|
||||
debugPrintf ( ( "CA server \"%s\" unresponsive after %g inactive sec"
|
||||
"- disconnecting.\n",
|
||||
"- disconnecting.\n",
|
||||
hostName, this->period ) );
|
||||
# endif
|
||||
// to get the callback lock safely we must reorder
|
||||
// to get the callback lock safely we must reorder
|
||||
// the lock hierarchy
|
||||
epicsGuardRelease < epicsMutex > unguard ( guard );
|
||||
{
|
||||
// callback lock is required because channel disconnect
|
||||
// state change is initiated from this thread, and
|
||||
// state change is initiated from this thread, and
|
||||
// this can cause their disconnect notify callback
|
||||
// to be invoked.
|
||||
callbackManager mgr ( this->ctxNotify, this->cbMutex );
|
||||
@@ -90,7 +90,7 @@ tcpRecvWatchdog::expire ( const epicsTime & /* currentTime */ )
|
||||
}
|
||||
}
|
||||
|
||||
void tcpRecvWatchdog::beaconArrivalNotify (
|
||||
void tcpRecvWatchdog::beaconArrivalNotify (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
@@ -102,12 +102,12 @@ void tcpRecvWatchdog::beaconArrivalNotify (
|
||||
|
||||
//
|
||||
// be careful about using beacons to reset the connection
|
||||
// time out watchdog until we have received a ping response
|
||||
// time out watchdog until we have received a ping response
|
||||
// from the IOC (this makes the software detect reconnects
|
||||
// faster when the server is rebooted twice in rapid
|
||||
// faster when the server is rebooted twice in rapid
|
||||
// succession before a 1st or 2nd beacon has been received)
|
||||
//
|
||||
void tcpRecvWatchdog::beaconAnomalyNotify (
|
||||
void tcpRecvWatchdog::beaconAnomalyNotify (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
@@ -115,7 +115,7 @@ void tcpRecvWatchdog::beaconAnomalyNotify (
|
||||
debugPrintf ( ("Saw an abnormal beacon\n") );
|
||||
}
|
||||
|
||||
void tcpRecvWatchdog::messageArrivalNotify (
|
||||
void tcpRecvWatchdog::messageArrivalNotify (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
@@ -127,7 +127,7 @@ void tcpRecvWatchdog::messageArrivalNotify (
|
||||
}
|
||||
}
|
||||
|
||||
void tcpRecvWatchdog::probeResponseNotify (
|
||||
void tcpRecvWatchdog::probeResponseNotify (
|
||||
epicsGuard < epicsMutex > & cbGuard )
|
||||
{
|
||||
bool restartNeeded = false;
|
||||
@@ -157,27 +157,27 @@ void tcpRecvWatchdog::probeResponseNotify (
|
||||
}
|
||||
|
||||
//
|
||||
// The thread for outgoing requests in the client runs
|
||||
// The thread for outgoing requests in the client runs
|
||||
// at a higher priority than the thread in the client
|
||||
// that receives responses. Therefore, there could
|
||||
// be considerable large array write send backlog that
|
||||
// is delaying departure of an echo request and also
|
||||
// interrupting delivery of an echo response.
|
||||
// We must be careful not to timeout the echo response as
|
||||
// long as we see indication of regular departures of
|
||||
// message buffers from the client in a situation where
|
||||
// we know that the TCP send queueing has been exceeded.
|
||||
// The send watchdog will be responsible for detecting
|
||||
// that receives responses. Therefore, there could
|
||||
// be considerable large array write send backlog that
|
||||
// is delaying departure of an echo request and also
|
||||
// interrupting delivery of an echo response.
|
||||
// We must be careful not to timeout the echo response as
|
||||
// long as we see indication of regular departures of
|
||||
// message buffers from the client in a situation where
|
||||
// we know that the TCP send queueing has been exceeded.
|
||||
// The send watchdog will be responsible for detecting
|
||||
// dead connections in this case.
|
||||
//
|
||||
void tcpRecvWatchdog::sendBacklogProgressNotify (
|
||||
void tcpRecvWatchdog::sendBacklogProgressNotify (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
|
||||
// We dont set "beaconAnomaly" to be false here because, after we see a
|
||||
// beacon anomaly (which could be transiently detecting a reboot) we will
|
||||
// not trust the beacon as an indicator of a healthy server until we
|
||||
// beacon anomaly (which could be transiently detecting a reboot) we will
|
||||
// not trust the beacon as an indicator of a healthy server until we
|
||||
// receive at least one message from the server.
|
||||
if ( this->probeResponsePending && ! this->shuttingDown ) {
|
||||
this->timer.start ( *this, CA_ECHO_TIMEOUT );
|
||||
@@ -196,7 +196,7 @@ void tcpRecvWatchdog::connectNotify (
|
||||
debugPrintf ( ("connected to the server - initiating circuit recv watchdog\n") );
|
||||
}
|
||||
|
||||
void tcpRecvWatchdog::sendTimeoutNotify (
|
||||
void tcpRecvWatchdog::sendTimeoutNotify (
|
||||
epicsGuard < epicsMutex > & /* cbGuard */,
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
@@ -242,7 +242,7 @@ void tcpRecvWatchdog::show ( unsigned level ) const
|
||||
static_cast <const void *> ( this ), this->period );
|
||||
if ( level > 0u ) {
|
||||
::printf ( "\t%s %s %s\n",
|
||||
this->probeResponsePending ? "probe-response-pending" : "",
|
||||
this->probeResponsePending ? "probe-response-pending" : "",
|
||||
this->beaconAnomaly ? "beacon-anomaly-detected" : "",
|
||||
this->probeTimeoutDetected ? "probe-response-timeout" : "" );
|
||||
}
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_tcpRecvWatchdog_H
|
||||
@@ -33,18 +33,18 @@ class tcpiiu;
|
||||
|
||||
class tcpRecvWatchdog : private epicsTimerNotify {
|
||||
public:
|
||||
tcpRecvWatchdog ( epicsMutex & cbMutex,
|
||||
tcpRecvWatchdog ( epicsMutex & cbMutex,
|
||||
cacContextNotify & ctxNotify,
|
||||
epicsMutex & mutex, tcpiiu &,
|
||||
epicsMutex & mutex, tcpiiu &,
|
||||
double periodIn, epicsTimerQueue & );
|
||||
virtual ~tcpRecvWatchdog ();
|
||||
void sendBacklogProgressNotify (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void messageArrivalNotify (
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
void probeResponseNotify (
|
||||
void probeResponseNotify (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void beaconArrivalNotify (
|
||||
void beaconArrivalNotify (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void beaconAnomalyNotify ( epicsGuard < epicsMutex > & );
|
||||
void connectNotify (
|
||||
@@ -68,8 +68,8 @@ private:
|
||||
bool probeTimeoutDetected;
|
||||
bool shuttingDown;
|
||||
expireStatus expire ( const epicsTime & currentTime );
|
||||
tcpRecvWatchdog ( const tcpRecvWatchdog & );
|
||||
tcpRecvWatchdog & operator = ( const tcpRecvWatchdog & );
|
||||
tcpRecvWatchdog ( const tcpRecvWatchdog & );
|
||||
tcpRecvWatchdog & operator = ( const tcpRecvWatchdog & );
|
||||
};
|
||||
|
||||
#endif // #ifndef INC_tcpRecvWatchdog_H
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
@@ -24,8 +24,8 @@
|
||||
#include "cac.h"
|
||||
#include "virtualCircuit.h"
|
||||
|
||||
tcpSendWatchdog::tcpSendWatchdog (
|
||||
epicsMutex & cbMutexIn, cacContextNotify & ctxNotifyIn,
|
||||
tcpSendWatchdog::tcpSendWatchdog (
|
||||
epicsMutex & cbMutexIn, cacContextNotify & ctxNotifyIn,
|
||||
epicsMutex & mutexIn, tcpiiu & iiuIn,
|
||||
double periodIn, epicsTimerQueue & queueIn ) :
|
||||
period ( periodIn ), timer ( queueIn.createTimer () ),
|
||||
@@ -39,7 +39,7 @@ tcpSendWatchdog::~tcpSendWatchdog ()
|
||||
this->timer.destroy ();
|
||||
}
|
||||
|
||||
epicsTimerNotify::expireStatus tcpSendWatchdog::expire (
|
||||
epicsTimerNotify::expireStatus tcpSendWatchdog::expire (
|
||||
const epicsTime & /* currentTime */ )
|
||||
{
|
||||
{
|
||||
@@ -54,7 +54,7 @@ epicsTimerNotify::expireStatus tcpSendWatchdog::expire (
|
||||
# ifdef DEBUG
|
||||
char hostName[128];
|
||||
this->iiu.getHostName ( guard, hostName, sizeof ( hostName ) );
|
||||
debugPrintf ( ( "Request not accepted by CA server %s for %g sec. Disconnecting.\n",
|
||||
debugPrintf ( ( "Request not accepted by CA server %s for %g sec. Disconnecting.\n",
|
||||
hostName, this->period ) );
|
||||
# endif
|
||||
this->iiu.sendTimeoutNotify ( mgr, guard );
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_tcpSendWatchdog_H
|
||||
@@ -46,8 +46,8 @@ private:
|
||||
epicsMutex & mutex;
|
||||
tcpiiu & iiu;
|
||||
expireStatus expire ( const epicsTime & currentTime );
|
||||
tcpSendWatchdog ( const tcpSendWatchdog & );
|
||||
tcpSendWatchdog & operator = ( const tcpSendWatchdog & );
|
||||
tcpSendWatchdog ( const tcpSendWatchdog & );
|
||||
tcpSendWatchdog & operator = ( const tcpSendWatchdog & );
|
||||
};
|
||||
|
||||
#endif // #ifndef INC_tcpSendWatchdog_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,11 +5,11 @@
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
* Author: Jeff Hill
|
||||
* Date: 07-01-91
|
||||
* Author: Jeff Hill
|
||||
* Date: 07-01-91
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -32,24 +32,24 @@ static unsigned long outstanding;
|
||||
|
||||
|
||||
/*
|
||||
* ca_test
|
||||
* ca_test
|
||||
*
|
||||
* find channel, write a value if supplied, and
|
||||
* read back the current value
|
||||
* find channel, write a value if supplied, and
|
||||
* read back the current value
|
||||
*
|
||||
*/
|
||||
int ca_test(
|
||||
char *pname,
|
||||
char *pvalue
|
||||
char *pname,
|
||||
char *pvalue
|
||||
)
|
||||
{
|
||||
int status;
|
||||
if(pvalue){
|
||||
status = capft(pname,pvalue);
|
||||
}
|
||||
else{
|
||||
status = cagft(pname);
|
||||
}
|
||||
if(pvalue){
|
||||
status = capft(pname,pvalue);
|
||||
}
|
||||
else{
|
||||
status = cagft(pname);
|
||||
}
|
||||
ca_task_exit();
|
||||
return status;
|
||||
}
|
||||
@@ -57,244 +57,244 @@ char *pvalue
|
||||
|
||||
|
||||
/*
|
||||
* cagft()
|
||||
* cagft()
|
||||
*
|
||||
* ca get field test
|
||||
* ca get field test
|
||||
*
|
||||
* test ca get over the range of CA data types
|
||||
* test ca get over the range of CA data types
|
||||
*/
|
||||
static int cagft(char *pname)
|
||||
{
|
||||
const unsigned maxTries = 1000ul;
|
||||
unsigned ntries = 0u;
|
||||
chid chan_id;
|
||||
int status;
|
||||
int i;
|
||||
{
|
||||
const unsigned maxTries = 1000ul;
|
||||
unsigned ntries = 0u;
|
||||
chid chan_id;
|
||||
int status;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* convert name to chan id
|
||||
*/
|
||||
status = ca_search(pname, &chan_id);
|
||||
SEVCHK(status,NULL);
|
||||
status = ca_pend_io(5.0);
|
||||
if(status != ECA_NORMAL){
|
||||
/*
|
||||
* convert name to chan id
|
||||
*/
|
||||
status = ca_search(pname, &chan_id);
|
||||
SEVCHK(status,NULL);
|
||||
status = ca_pend_io(5.0);
|
||||
if(status != ECA_NORMAL){
|
||||
SEVCHK(ca_clear_channel(chan_id),NULL);
|
||||
printf("Not Found %s\n", pname);
|
||||
return -1;
|
||||
}
|
||||
printf("Not Found %s\n", pname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("name:\t%s\n",
|
||||
printf("name:\t%s\n",
|
||||
ca_name(chan_id));
|
||||
printf("native type:\t%s\n",
|
||||
printf("native type:\t%s\n",
|
||||
dbr_type_to_text(ca_field_type(chan_id)));
|
||||
printf("native count:\t%lu\n",
|
||||
printf("native count:\t%lu\n",
|
||||
ca_element_count(chan_id));
|
||||
|
||||
|
||||
/*
|
||||
* fetch as each type
|
||||
*/
|
||||
for(i=0; i<=LAST_BUFFER_TYPE; i++){
|
||||
if(ca_field_type(chan_id)==DBR_STRING) {
|
||||
if( (i!=DBR_STRING)
|
||||
&& (i!=DBR_STS_STRING)
|
||||
&& (i!=DBR_TIME_STRING)
|
||||
&& (i!=DBR_GR_STRING)
|
||||
/*
|
||||
* fetch as each type
|
||||
*/
|
||||
for(i=0; i<=LAST_BUFFER_TYPE; i++){
|
||||
if(ca_field_type(chan_id)==DBR_STRING) {
|
||||
if( (i!=DBR_STRING)
|
||||
&& (i!=DBR_STS_STRING)
|
||||
&& (i!=DBR_TIME_STRING)
|
||||
&& (i!=DBR_GR_STRING)
|
||||
&& (i!=DBR_CTRL_STRING)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/* ignore write only types */
|
||||
if (
|
||||
i == DBR_PUT_ACKT ||
|
||||
if (
|
||||
i == DBR_PUT_ACKT ||
|
||||
i == DBR_PUT_ACKS ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
status = ca_array_get_callback(
|
||||
i,
|
||||
ca_element_count(chan_id),
|
||||
chan_id,
|
||||
printit,
|
||||
NULL);
|
||||
SEVCHK(status, NULL);
|
||||
status = ca_array_get_callback(
|
||||
i,
|
||||
ca_element_count(chan_id),
|
||||
chan_id,
|
||||
printit,
|
||||
NULL);
|
||||
SEVCHK(status, NULL);
|
||||
|
||||
outstanding++;
|
||||
}
|
||||
outstanding++;
|
||||
}
|
||||
|
||||
/*
|
||||
* wait for the operation to complete
|
||||
* before returning
|
||||
*/
|
||||
while ( ntries < maxTries ) {
|
||||
unsigned long oldOut;
|
||||
/*
|
||||
* wait for the operation to complete
|
||||
* before returning
|
||||
*/
|
||||
while ( ntries < maxTries ) {
|
||||
unsigned long oldOut;
|
||||
|
||||
oldOut = outstanding;
|
||||
ca_pend_event ( 0.05 );
|
||||
oldOut = outstanding;
|
||||
ca_pend_event ( 0.05 );
|
||||
|
||||
if ( ! outstanding ) {
|
||||
if ( ! outstanding ) {
|
||||
SEVCHK ( ca_clear_channel ( chan_id ), NULL );
|
||||
printf ( "\n\n" );
|
||||
return 0;
|
||||
}
|
||||
printf ( "\n\n" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( outstanding == oldOut ) {
|
||||
ntries++;
|
||||
}
|
||||
}
|
||||
if ( outstanding == oldOut ) {
|
||||
ntries++;
|
||||
}
|
||||
}
|
||||
|
||||
SEVCHK ( ca_clear_channel ( chan_id ), NULL );
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* PRINTIT()
|
||||
* PRINTIT()
|
||||
*/
|
||||
static void printit ( struct event_handler_args args )
|
||||
{
|
||||
if ( args.status == ECA_NORMAL ) {
|
||||
ca_dump_dbr ( args.type, args.count, args.dbr );
|
||||
}
|
||||
else {
|
||||
if ( args.status == ECA_NORMAL ) {
|
||||
ca_dump_dbr ( args.type, args.count, args.dbr );
|
||||
}
|
||||
else {
|
||||
printf ( "%s\t%s\n", dbr_text[args.type], ca_message(args.status) );
|
||||
}
|
||||
}
|
||||
|
||||
outstanding--;
|
||||
outstanding--;
|
||||
}
|
||||
|
||||
/*
|
||||
* capft
|
||||
* capft
|
||||
*
|
||||
* test ca_put() over a range of data types
|
||||
*
|
||||
* test ca_put() over a range of data types
|
||||
*
|
||||
*/
|
||||
static int capft(
|
||||
char *pname,
|
||||
char *pvalue
|
||||
char *pname,
|
||||
char *pvalue
|
||||
)
|
||||
{
|
||||
dbr_short_t shortvalue;
|
||||
dbr_long_t longvalue;
|
||||
dbr_float_t floatvalue;
|
||||
dbr_char_t charvalue;
|
||||
dbr_double_t doublevalue;
|
||||
unsigned long ntries = 10ul;
|
||||
int status;
|
||||
chid chan_id;
|
||||
dbr_short_t shortvalue;
|
||||
dbr_long_t longvalue;
|
||||
dbr_float_t floatvalue;
|
||||
dbr_char_t charvalue;
|
||||
dbr_double_t doublevalue;
|
||||
unsigned long ntries = 10ul;
|
||||
int status;
|
||||
chid chan_id;
|
||||
|
||||
if (((*pname < ' ') || (*pname > 'z'))
|
||||
|| ((*pvalue < ' ') || (*pvalue > 'z'))){
|
||||
printf("\nusage \"pv name\",\"value\"\n");
|
||||
return -1;
|
||||
}
|
||||
if (((*pname < ' ') || (*pname > 'z'))
|
||||
|| ((*pvalue < ' ') || (*pvalue > 'z'))){
|
||||
printf("\nusage \"pv name\",\"value\"\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* convert name to chan id
|
||||
*/
|
||||
status = ca_search(pname, &chan_id);
|
||||
SEVCHK(status,NULL);
|
||||
status = ca_pend_io(5.0);
|
||||
if(status != ECA_NORMAL){
|
||||
/*
|
||||
* convert name to chan id
|
||||
*/
|
||||
status = ca_search(pname, &chan_id);
|
||||
SEVCHK(status,NULL);
|
||||
status = ca_pend_io(5.0);
|
||||
if(status != ECA_NORMAL){
|
||||
SEVCHK(ca_clear_channel(chan_id),NULL);
|
||||
printf("Not Found %s\n", pname);
|
||||
return -1;
|
||||
}
|
||||
printf("Not Found %s\n", pname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("name:\t%s\n", ca_name(chan_id));
|
||||
printf("native type:\t%d\n", ca_field_type(chan_id));
|
||||
printf("native count:\t%lu\n", ca_element_count(chan_id));
|
||||
printf("name:\t%s\n", ca_name(chan_id));
|
||||
printf("native type:\t%d\n", ca_field_type(chan_id));
|
||||
printf("native count:\t%lu\n", ca_element_count(chan_id));
|
||||
|
||||
/*
|
||||
* string value ca_put
|
||||
*/
|
||||
status = ca_put(
|
||||
DBR_STRING,
|
||||
chan_id,
|
||||
pvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_STRING);
|
||||
/*
|
||||
* string value ca_put
|
||||
*/
|
||||
status = ca_put(
|
||||
DBR_STRING,
|
||||
chan_id,
|
||||
pvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_STRING);
|
||||
|
||||
if(ca_field_type(chan_id)==0)goto skip_rest;
|
||||
if(ca_field_type(chan_id)==0)goto skip_rest;
|
||||
|
||||
if(sscanf(pvalue,"%hd",&shortvalue)==1) {
|
||||
/*
|
||||
* short integer ca_put
|
||||
*/
|
||||
status = ca_put(
|
||||
DBR_SHORT,
|
||||
chan_id,
|
||||
&shortvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_SHORT);
|
||||
status = ca_put(
|
||||
DBR_ENUM,
|
||||
chan_id,
|
||||
&shortvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_ENUM);
|
||||
charvalue=(dbr_char_t)shortvalue;
|
||||
status = ca_put(
|
||||
DBR_CHAR,
|
||||
chan_id,
|
||||
&charvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_CHAR);
|
||||
}
|
||||
if(sscanf(pvalue,"%d",&longvalue)==1) {
|
||||
/*
|
||||
* long integer ca_put
|
||||
*/
|
||||
status = ca_put(
|
||||
DBR_LONG,
|
||||
chan_id,
|
||||
&longvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_LONG);
|
||||
}
|
||||
if(epicsScanFloat(pvalue, &floatvalue)==1) {
|
||||
/*
|
||||
* single precision float ca_put
|
||||
*/
|
||||
status = ca_put(
|
||||
DBR_FLOAT,
|
||||
chan_id,
|
||||
&floatvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_FLOAT);
|
||||
}
|
||||
if(epicsScanDouble(pvalue, &doublevalue)==1) {
|
||||
/*
|
||||
* double precision float ca_put
|
||||
*/
|
||||
status = ca_put(
|
||||
DBR_DOUBLE,
|
||||
chan_id,
|
||||
&doublevalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_DOUBLE);
|
||||
}
|
||||
if(sscanf(pvalue,"%hd",&shortvalue)==1) {
|
||||
/*
|
||||
* short integer ca_put
|
||||
*/
|
||||
status = ca_put(
|
||||
DBR_SHORT,
|
||||
chan_id,
|
||||
&shortvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_SHORT);
|
||||
status = ca_put(
|
||||
DBR_ENUM,
|
||||
chan_id,
|
||||
&shortvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_ENUM);
|
||||
charvalue=(dbr_char_t)shortvalue;
|
||||
status = ca_put(
|
||||
DBR_CHAR,
|
||||
chan_id,
|
||||
&charvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_CHAR);
|
||||
}
|
||||
if(sscanf(pvalue,"%d",&longvalue)==1) {
|
||||
/*
|
||||
* long integer ca_put
|
||||
*/
|
||||
status = ca_put(
|
||||
DBR_LONG,
|
||||
chan_id,
|
||||
&longvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_LONG);
|
||||
}
|
||||
if(epicsScanFloat(pvalue, &floatvalue)==1) {
|
||||
/*
|
||||
* single precision float ca_put
|
||||
*/
|
||||
status = ca_put(
|
||||
DBR_FLOAT,
|
||||
chan_id,
|
||||
&floatvalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_FLOAT);
|
||||
}
|
||||
if(epicsScanDouble(pvalue, &doublevalue)==1) {
|
||||
/*
|
||||
* double precision float ca_put
|
||||
*/
|
||||
status = ca_put(
|
||||
DBR_DOUBLE,
|
||||
chan_id,
|
||||
&doublevalue);
|
||||
SEVCHK(status, NULL);
|
||||
verify_value(chan_id, DBR_DOUBLE);
|
||||
}
|
||||
|
||||
skip_rest:
|
||||
|
||||
/*
|
||||
* wait for the operation to complete
|
||||
* (outstabnding decrements to zero)
|
||||
*/
|
||||
while(ntries){
|
||||
ca_pend_event(1.0);
|
||||
/*
|
||||
* wait for the operation to complete
|
||||
* (outstabnding decrements to zero)
|
||||
*/
|
||||
while(ntries){
|
||||
ca_pend_event(1.0);
|
||||
|
||||
if(!outstanding){
|
||||
if(!outstanding){
|
||||
SEVCHK(ca_clear_channel(chan_id),NULL);
|
||||
printf("\n\n");
|
||||
return 0;
|
||||
}
|
||||
printf("\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
ntries--;
|
||||
}
|
||||
ntries--;
|
||||
}
|
||||
|
||||
SEVCHK(ca_clear_channel(chan_id),NULL);
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -305,19 +305,19 @@ skip_rest:
|
||||
*/
|
||||
static void verify_value(chid chan_id, chtype type)
|
||||
{
|
||||
int status;
|
||||
int status;
|
||||
|
||||
/*
|
||||
* issue a get which calls back `printit'
|
||||
* upon completion
|
||||
*/
|
||||
status = ca_array_get_callback(
|
||||
type,
|
||||
ca_element_count(chan_id),
|
||||
chan_id,
|
||||
printit,
|
||||
NULL);
|
||||
SEVCHK(status, NULL);
|
||||
/*
|
||||
* issue a get which calls back `printit'
|
||||
* upon completion
|
||||
*/
|
||||
status = ca_array_get_callback(
|
||||
type,
|
||||
ca_element_count(chan_id),
|
||||
chan_id,
|
||||
printit,
|
||||
NULL);
|
||||
SEVCHK(status, NULL);
|
||||
|
||||
outstanding++;
|
||||
outstanding++;
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
* Author: Jeff Hill
|
||||
* Date: 21JAN2000
|
||||
* Author: Jeff Hill
|
||||
* Date: 21JAN2000
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
* Author: Jeff Hill
|
||||
* Date: 21JAN2000
|
||||
* Author: Jeff Hill
|
||||
* Date: 21JAN2000
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@@ -20,36 +20,36 @@
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
/*
|
||||
* print error and return if arguments are invalid
|
||||
*/
|
||||
if(argc < 2 || argc > 3){
|
||||
printf("usage: %s <PV name> [optional value to be written]\n", argv[0]);
|
||||
printf("the following arguments were received\n");
|
||||
while(argc>0) {
|
||||
printf("%s\n",argv[0]);
|
||||
argv++; argc--;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
/*
|
||||
* print error and return if arguments are invalid
|
||||
*/
|
||||
if(argc < 2 || argc > 3){
|
||||
printf("usage: %s <PV name> [optional value to be written]\n", argv[0]);
|
||||
printf("the following arguments were received\n");
|
||||
while(argc>0) {
|
||||
printf("%s\n",argv[0]);
|
||||
argv++; argc--;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* check for supplied value
|
||||
*/
|
||||
if(argc == 2){
|
||||
return ca_test(argv[1], NULL);
|
||||
}
|
||||
else if(argc == 3){
|
||||
char *pt;
|
||||
/*
|
||||
* check for supplied value
|
||||
*/
|
||||
if(argc == 2){
|
||||
return ca_test(argv[1], NULL);
|
||||
}
|
||||
else if(argc == 3){
|
||||
char *pt;
|
||||
|
||||
/* strip leading and trailing quotes*/
|
||||
if(argv[2][1]=='"') argv[2]++;
|
||||
if( (pt=strchr(argv[2],'"')) ) *pt = 0;
|
||||
return ca_test(argv[1], argv[2]);
|
||||
}
|
||||
else{
|
||||
return -1;
|
||||
}
|
||||
/* strip leading and trailing quotes*/
|
||||
if(argv[2][1]=='"') argv[2]++;
|
||||
if( (pt=strchr(argv[2],'"')) ) *pt = 0;
|
||||
return ca_test(argv[1], argv[2]);
|
||||
}
|
||||
else{
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ extern "C" void epicsStdCall ca_test_event ( struct event_handler_args args )
|
||||
}
|
||||
}
|
||||
|
||||
printf ( "ca_test_event() for channel \"%s\" with native type %s\n",
|
||||
printf ( "ca_test_event() for channel \"%s\" with native type %s\n",
|
||||
ca_name(args.chid), pNativeTypeName );
|
||||
|
||||
if ( ! ( CA_M_SUCCESS & args.status ) ) {
|
||||
@@ -130,7 +130,7 @@ extern "C" void epicsStdCall ca_dump_dbr (
|
||||
case DBR_GR_STRING:
|
||||
case DBR_CTRL_STRING:
|
||||
{
|
||||
struct dbr_sts_string *pvalue
|
||||
struct dbr_sts_string *pvalue
|
||||
= (struct dbr_sts_string *) pbuffer;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf("\tValue: %s",pvalue->value);
|
||||
@@ -217,7 +217,7 @@ extern "C" void epicsStdCall ca_dump_dbr (
|
||||
}
|
||||
case DBR_TIME_STRING:
|
||||
{
|
||||
struct dbr_time_string *pvalue
|
||||
struct dbr_time_string *pvalue
|
||||
= (struct dbr_time_string *) pbuffer;
|
||||
|
||||
epicsTimeToStrftime(tsString,sizeof(tsString),
|
||||
@@ -562,12 +562,12 @@ extern "C" void epicsStdCall ca_dump_dbr (
|
||||
}
|
||||
case DBR_STSACK_STRING:
|
||||
{
|
||||
struct dbr_stsack_string *pvalue
|
||||
= (struct dbr_stsack_string *)pbuffer;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf(" %2d %2d",pvalue->ackt,pvalue->acks);
|
||||
printf(" %s",pvalue->value);
|
||||
break;
|
||||
struct dbr_stsack_string *pvalue
|
||||
= (struct dbr_stsack_string *)pbuffer;
|
||||
printf("%2d %2d",pvalue->status,pvalue->severity);
|
||||
printf(" %2d %2d",pvalue->ackt,pvalue->acks);
|
||||
printf(" %s",pvalue->value);
|
||||
break;
|
||||
}
|
||||
case DBR_CLASS_NAME:
|
||||
{
|
||||
@@ -577,7 +577,7 @@ extern "C" void epicsStdCall ca_dump_dbr (
|
||||
break;
|
||||
}
|
||||
default:
|
||||
printf (
|
||||
printf (
|
||||
"unsupported by ca_dbrDump()" );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "disconnectGovernorTimer.h"
|
||||
|
||||
// UDP protocol dispatch table
|
||||
const udpiiu::pProtoStubUDP udpiiu::udpJumpTableCAC [] =
|
||||
const udpiiu::pProtoStubUDP udpiiu::udpJumpTableCAC [] =
|
||||
{
|
||||
&udpiiu::versionAction,
|
||||
&udpiiu::badUDPRespAction,
|
||||
@@ -112,16 +112,16 @@ unsigned getNTimers(double maxPeriod)
|
||||
//
|
||||
// udpiiu::udpiiu ()
|
||||
//
|
||||
udpiiu::udpiiu (
|
||||
udpiiu::udpiiu (
|
||||
epicsGuard < epicsMutex > & cacGuard,
|
||||
epicsTimerQueueActive & timerQueue,
|
||||
epicsMutex & cbMutexIn,
|
||||
epicsTimerQueueActive & timerQueue,
|
||||
epicsMutex & cbMutexIn,
|
||||
epicsMutex & cacMutexIn,
|
||||
cacContextNotify & ctxNotifyIn,
|
||||
cac & cac,
|
||||
unsigned port,
|
||||
tsDLList < SearchDest > & searchDestListIn ) :
|
||||
recvThread ( *this, ctxNotifyIn, cbMutexIn, "CAC-UDP",
|
||||
recvThread ( *this, ctxNotifyIn, cbMutexIn, "CAC-UDP",
|
||||
epicsThreadGetStackSize ( epicsThreadStackMedium ),
|
||||
cac::lowestPriorityLevelAbove (
|
||||
cac::lowestPriorityLevelAbove (
|
||||
@@ -158,19 +158,19 @@ udpiiu::udpiiu (
|
||||
}
|
||||
|
||||
for ( unsigned i = 0; i < this->nTimers; i++ ) {
|
||||
this->ppSearchTmr[i].reset (
|
||||
new searchTimer ( *this, timerQueue, i, cacMutexIn,
|
||||
i > this->beaconAnomalyTimerIndex ) );
|
||||
this->ppSearchTmr[i].reset (
|
||||
new searchTimer ( *this, timerQueue, i, cacMutexIn,
|
||||
i > this->beaconAnomalyTimerIndex ) );
|
||||
}
|
||||
|
||||
this->repeaterPort =
|
||||
this->repeaterPort =
|
||||
envGetInetPortConfigParam ( &EPICS_CA_REPEATER_PORT,
|
||||
static_cast <unsigned short> (CA_REPEATER_PORT) );
|
||||
|
||||
this->sock = epicsSocketCreate ( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
|
||||
if ( this->sock == INVALID_SOCKET ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
errlogPrintf ("CAC: unable to create datagram socket because = \"%s\"\n",
|
||||
sockErrBuf );
|
||||
@@ -207,11 +207,11 @@ udpiiu::udpiiu (
|
||||
#endif
|
||||
|
||||
int boolValue = true;
|
||||
int status = setsockopt ( this->sock, SOL_SOCKET, SO_BROADCAST,
|
||||
int status = setsockopt ( this->sock, SOL_SOCKET, SO_BROADCAST,
|
||||
(char *) &boolValue, sizeof ( boolValue ) );
|
||||
if ( status < 0 ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
errlogPrintf ("CAC: IP broadcasting enable failed because = \"%s\"\n",
|
||||
sockErrBuf );
|
||||
@@ -243,26 +243,26 @@ udpiiu::udpiiu (
|
||||
osiSockAddr addr;
|
||||
memset ( (char *)&addr, 0 , sizeof (addr) );
|
||||
addr.ia.sin_family = AF_INET;
|
||||
addr.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
|
||||
addr.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
|
||||
addr.ia.sin_port = htons ( PORT_ANY );
|
||||
status = bind (this->sock, &addr.sa, sizeof (addr) );
|
||||
if ( status < 0 ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
epicsSocketDestroy (this->sock);
|
||||
errlogPrintf ( "CAC: unable to bind to an unconstrained address because = \"%s\"\n",
|
||||
sockErrBuf );
|
||||
throwWithLocation ( noSocket () );
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
osiSockAddr tmpAddr;
|
||||
osiSocklen_t saddr_length = sizeof ( tmpAddr );
|
||||
status = getsockname ( this->sock, &tmpAddr.sa, &saddr_length );
|
||||
if ( status < 0 ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
epicsSocketDestroy ( this->sock );
|
||||
errlogPrintf ( "CAC: getsockname () error was \"%s\"\n", sockErrBuf );
|
||||
@@ -283,9 +283,9 @@ udpiiu::udpiiu (
|
||||
ELLLIST dest;
|
||||
ellInit ( & dest );
|
||||
configureChannelAccessAddressList ( & dest, this->sock, this->serverPort );
|
||||
while ( osiSockAddrNode *
|
||||
while ( osiSockAddrNode *
|
||||
pNode = reinterpret_cast < osiSockAddrNode * > ( ellGet ( & dest ) ) ) {
|
||||
SearchDestUDP & searchDest = *
|
||||
SearchDestUDP & searchDest = *
|
||||
new SearchDestUDP ( pNode->addr, *this );
|
||||
_searchDestList.add ( searchDest );
|
||||
free ( pNode );
|
||||
@@ -293,14 +293,14 @@ udpiiu::udpiiu (
|
||||
|
||||
/* add list of tcp name service addresses */
|
||||
_searchDestList.add ( searchDestListIn );
|
||||
|
||||
|
||||
caStartRepeaterIfNotInstalled ( this->repeaterPort );
|
||||
|
||||
this->pushVersionMsg ();
|
||||
|
||||
// start timers and receive thread
|
||||
for ( unsigned j =0; j < this->nTimers; j++ ) {
|
||||
this->ppSearchTmr[j]->start ( cacGuard );
|
||||
this->ppSearchTmr[j]->start ( cacGuard );
|
||||
}
|
||||
this->govTmr.start ();
|
||||
this->repeaterSubscribeTmr.start ();
|
||||
@@ -325,19 +325,19 @@ udpiiu::~udpiiu ()
|
||||
iter++;
|
||||
delete & curr;
|
||||
}
|
||||
|
||||
|
||||
epicsSocketDestroy ( this->sock );
|
||||
}
|
||||
|
||||
void udpiiu::shutdown (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
void udpiiu::shutdown (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
// stop all of the timers
|
||||
this->repeaterSubscribeTmr.shutdown ( cbGuard, guard );
|
||||
this->govTmr.shutdown ( cbGuard, guard );
|
||||
for ( unsigned i =0; i < this->nTimers; i++ ) {
|
||||
this->ppSearchTmr[i]->shutdown ( cbGuard, guard );
|
||||
this->ppSearchTmr[i]->shutdown ( cbGuard, guard );
|
||||
}
|
||||
|
||||
{
|
||||
@@ -367,13 +367,13 @@ void udpiiu::shutdown (
|
||||
}
|
||||
}
|
||||
|
||||
udpRecvThread::udpRecvThread (
|
||||
udpRecvThread::udpRecvThread (
|
||||
udpiiu & iiuIn, cacContextNotify & ctxNotifyIn, epicsMutex & cbMutexIn,
|
||||
const char * pName, unsigned stackSize, unsigned priority ) :
|
||||
iiu ( iiuIn ), cbMutex ( cbMutexIn ), ctxNotify ( ctxNotifyIn ),
|
||||
iiu ( iiuIn ), cbMutex ( cbMutexIn ), ctxNotify ( ctxNotifyIn ),
|
||||
thread ( *this, pName, stackSize, priority ) {}
|
||||
|
||||
udpRecvThread::~udpRecvThread ()
|
||||
udpRecvThread::~udpRecvThread ()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -394,18 +394,18 @@ void udpRecvThread::show ( unsigned /* level */ ) const
|
||||
void udpRecvThread::run ()
|
||||
{
|
||||
epicsThreadPrivateSet ( caClientCallbackThreadId, &this->iiu );
|
||||
|
||||
if ( this->iiu._searchDestList.count () == 0 ) {
|
||||
|
||||
if ( this->iiu._searchDestList.count () == 0 ) {
|
||||
callbackManager mgr ( this->ctxNotify, this->cbMutex );
|
||||
epicsGuard < epicsMutex > guard ( this->iiu.cacMutex );
|
||||
genLocalExcep ( mgr.cbGuard, guard,
|
||||
genLocalExcep ( mgr.cbGuard, guard,
|
||||
this->iiu.cacRef, ECA_NOSEARCHADDR, NULL );
|
||||
}
|
||||
|
||||
do {
|
||||
osiSockAddr src;
|
||||
osiSocklen_t src_size = sizeof ( src );
|
||||
int status = recvfrom ( this->iiu.sock,
|
||||
int status = recvfrom ( this->iiu.sock,
|
||||
this->iiu.recvBuf, sizeof ( this->iiu.recvBuf ), 0,
|
||||
& src.sa, & src_size );
|
||||
|
||||
@@ -413,7 +413,7 @@ void udpRecvThread::run ()
|
||||
|
||||
if ( status < 0 ) {
|
||||
int errnoCpy = SOCKERRNO;
|
||||
if (
|
||||
if (
|
||||
errnoCpy != SOCK_EINTR &&
|
||||
errnoCpy != SOCK_SHUTDOWN &&
|
||||
errnoCpy != SOCK_ENOTSOCK &&
|
||||
@@ -425,15 +425,15 @@ void udpRecvThread::run ()
|
||||
errnoCpy != SOCK_ECONNRESET ) {
|
||||
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
errlogPrintf ( "CAC: UDP recv error was \"%s\"\n",
|
||||
errlogPrintf ( "CAC: UDP recv error was \"%s\"\n",
|
||||
sockErrBuf );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( status > 0 ) {
|
||||
this->iiu.postMsg ( src, this->iiu.recvBuf,
|
||||
this->iiu.postMsg ( src, this->iiu.recvBuf,
|
||||
(arrayElementCount) status, epicsTime::getCurrent() );
|
||||
}
|
||||
|
||||
@@ -441,14 +441,14 @@ void udpRecvThread::run ()
|
||||
}
|
||||
|
||||
/* for sunpro compiler */
|
||||
udpiiu::M_repeaterTimerNotify::~M_repeaterTimerNotify ()
|
||||
udpiiu::M_repeaterTimerNotify::~M_repeaterTimerNotify ()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* udpiiu::M_repeaterTimerNotify::repeaterRegistrationMessage ()
|
||||
*
|
||||
* register with the repeater
|
||||
* register with the repeater
|
||||
*/
|
||||
void udpiiu :: M_repeaterTimerNotify :: repeaterRegistrationMessage ( unsigned attemptNumber )
|
||||
{
|
||||
@@ -459,7 +459,7 @@ void udpiiu :: M_repeaterTimerNotify :: repeaterRegistrationMessage ( unsigned a
|
||||
/*
|
||||
* caRepeaterRegistrationMessage ()
|
||||
*
|
||||
* register with the repeater
|
||||
* register with the repeater
|
||||
*/
|
||||
void epicsStdCall caRepeaterRegistrationMessage (
|
||||
SOCKET sock, unsigned repeaterPort, unsigned attemptNumber )
|
||||
@@ -469,19 +469,19 @@ void epicsStdCall caRepeaterRegistrationMessage (
|
||||
int status;
|
||||
int len;
|
||||
|
||||
assert ( repeaterPort <= USHRT_MAX );
|
||||
unsigned short port = static_cast <unsigned short> ( repeaterPort );
|
||||
assert ( repeaterPort <= USHRT_MAX );
|
||||
unsigned short port = static_cast <unsigned short> ( repeaterPort );
|
||||
|
||||
/*
|
||||
* In 3.13 beta 11 and before the CA repeater calls local_addr()
|
||||
* to determine a local address and does not allow registration
|
||||
* messages originating from other addresses. In these
|
||||
* In 3.13 beta 11 and before the CA repeater calls local_addr()
|
||||
* to determine a local address and does not allow registration
|
||||
* messages originating from other addresses. In these
|
||||
* releases local_addr() returned the address of the first enabled
|
||||
* interface found, and this address may or may not have been the loop
|
||||
* back address. Starting with 3.13 beta 12 local_addr() was
|
||||
* changed to always return the address of the first enabled
|
||||
* changed to always return the address of the first enabled
|
||||
* non-loopback interface because a valid non-loopback local
|
||||
* address is required in the beacon messages. Therefore, to
|
||||
* address is required in the beacon messages. Therefore, to
|
||||
* guarantee compatibility with past versions of the repeater
|
||||
* we alternate between the address returned by local_addr()
|
||||
* and the loopback address here.
|
||||
@@ -526,9 +526,9 @@ void epicsStdCall caRepeaterRegistrationMessage (
|
||||
*/
|
||||
# if defined ( DOES_NOT_ACCEPT_ZERO_LENGTH_UDP )
|
||||
len = sizeof (msg);
|
||||
# else
|
||||
# else
|
||||
len = 0;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
status = sendto ( sock, (char *) &msg, len, 0,
|
||||
&saddr.sa, sizeof ( saddr ) );
|
||||
@@ -542,13 +542,13 @@ void epicsStdCall caRepeaterRegistrationMessage (
|
||||
* Linux returns SOCK_ECONNREFUSED
|
||||
* Windows 2000 returns SOCK_ECONNRESET
|
||||
*/
|
||||
if ( errnoCpy != SOCK_EINTR &&
|
||||
errnoCpy != SOCK_ECONNREFUSED &&
|
||||
if ( errnoCpy != SOCK_EINTR &&
|
||||
errnoCpy != SOCK_ECONNREFUSED &&
|
||||
errnoCpy != SOCK_ECONNRESET ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
fprintf ( stderr, "error sending registration message to CA repeater daemon was \"%s\"\n",
|
||||
fprintf ( stderr, "error sending registration message to CA repeater daemon was \"%s\"\n",
|
||||
sockErrBuf );
|
||||
}
|
||||
}
|
||||
@@ -564,7 +564,7 @@ void epicsStdCall caRepeaterRegistrationMessage (
|
||||
* however the repeater detects this, prints a message,
|
||||
* and lets the other task start the repeater.
|
||||
*
|
||||
* QUESTION: is there a better way to test for a port in use?
|
||||
* QUESTION: is there a better way to test for a port in use?
|
||||
* ANSWER: none that I can find.
|
||||
*
|
||||
* Problems with checking for the repeater installed
|
||||
@@ -584,7 +584,7 @@ void epicsStdCall caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
|
||||
int status;
|
||||
SOCKET tmpSock;
|
||||
union {
|
||||
struct sockaddr_in ia;
|
||||
struct sockaddr_in ia;
|
||||
struct sockaddr sa;
|
||||
} bd;
|
||||
|
||||
@@ -598,8 +598,8 @@ void epicsStdCall caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
|
||||
ca_uint16_t port = static_cast < ca_uint16_t > ( repeaterPort );
|
||||
memset ( (char *) &bd, 0, sizeof ( bd ) );
|
||||
bd.ia.sin_family = AF_INET;
|
||||
bd.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
|
||||
bd.ia.sin_port = htons ( port );
|
||||
bd.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
|
||||
bd.ia.sin_port = htons ( port );
|
||||
status = bind ( tmpSock, &bd.sa, sizeof ( bd ) );
|
||||
if ( status < 0 ) {
|
||||
if ( SOCKERRNO == SOCK_EADDRINUSE ) {
|
||||
@@ -620,14 +620,14 @@ void epicsStdCall caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
|
||||
epicsSocketDestroy ( tmpSock );
|
||||
|
||||
if ( ! installed ) {
|
||||
|
||||
/*
|
||||
* This is not called if the repeater is known to be
|
||||
* already running. (in the event of a race condition
|
||||
* the 2nd repeater exits when unable to attach to the
|
||||
* repeater's port)
|
||||
*/
|
||||
osiSpawnDetachedProcessReturn osptr =
|
||||
|
||||
/*
|
||||
* This is not called if the repeater is known to be
|
||||
* already running. (in the event of a race condition
|
||||
* the 2nd repeater exits when unable to attach to the
|
||||
* repeater's port)
|
||||
*/
|
||||
osiSpawnDetachedProcessReturn osptr =
|
||||
osiSpawnDetachedProcess ( "CA Repeater", "caRepeater" );
|
||||
if ( osptr == osiSpawnDetachedProcessNoSupport ) {
|
||||
epicsThreadId tid;
|
||||
@@ -644,19 +644,19 @@ void epicsStdCall caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
|
||||
}
|
||||
}
|
||||
|
||||
bool udpiiu::badUDPRespAction (
|
||||
bool udpiiu::badUDPRespAction (
|
||||
const caHdr &msg, const osiSockAddr &netAddr, const epicsTime ¤tTime )
|
||||
{
|
||||
char buf[64];
|
||||
sockAddrToDottedIP ( &netAddr.sa, buf, sizeof ( buf ) );
|
||||
char date[64];
|
||||
currentTime.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S");
|
||||
errlogPrintf ( "CAC: Undecipherable ( bad msg code %u ) UDP message from %s at %s\n",
|
||||
errlogPrintf ( "CAC: Undecipherable ( bad msg code %u ) UDP message from %s at %s\n",
|
||||
msg.m_cmmd, buf, date );
|
||||
return false;
|
||||
}
|
||||
|
||||
bool udpiiu::versionAction (
|
||||
bool udpiiu::versionAction (
|
||||
const caHdr & hdr, const osiSockAddr &, const epicsTime & /* currentTime */ )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->cacMutex );
|
||||
@@ -670,12 +670,12 @@ bool udpiiu::versionAction (
|
||||
return true;
|
||||
}
|
||||
|
||||
bool udpiiu :: searchRespAction (
|
||||
const caHdr & msg, const osiSockAddr & addr,
|
||||
bool udpiiu :: searchRespAction (
|
||||
const caHdr & msg, const osiSockAddr & addr,
|
||||
const epicsTime & currentTime )
|
||||
{
|
||||
/*
|
||||
* we dont currently know what to do with channel's
|
||||
* we dont currently know what to do with channel's
|
||||
* found to be at non-IP type addresses
|
||||
*/
|
||||
if ( addr.sa.sa_family != AF_INET ) {
|
||||
@@ -693,7 +693,7 @@ bool udpiiu :: searchRespAction (
|
||||
* care is taken here not to break gcc 3.2 aggressive alias
|
||||
* analysis rules
|
||||
*/
|
||||
const ca_uint8_t * pPayLoad =
|
||||
const ca_uint8_t * pPayLoad =
|
||||
reinterpret_cast < const ca_uint8_t *> ( & msg + 1 );
|
||||
unsigned byte0 = pPayLoad[0];
|
||||
unsigned byte1 = pPayLoad[1];
|
||||
@@ -728,21 +728,21 @@ bool udpiiu :: searchRespAction (
|
||||
}
|
||||
|
||||
if ( CA_V42 ( minorVersion ) ) {
|
||||
cacRef.transferChanToVirtCircuit
|
||||
( msg.m_available, msg.m_cid, 0xffff,
|
||||
cacRef.transferChanToVirtCircuit
|
||||
( msg.m_available, msg.m_cid, 0xffff,
|
||||
0, minorVersion, serverAddr, currentTime );
|
||||
}
|
||||
else {
|
||||
cacRef.transferChanToVirtCircuit
|
||||
( msg.m_available, msg.m_cid, msg.m_dataType,
|
||||
cacRef.transferChanToVirtCircuit
|
||||
( msg.m_available, msg.m_cid, msg.m_dataType,
|
||||
msg.m_count, minorVersion, serverAddr, currentTime );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool udpiiu::beaconAction (
|
||||
const caHdr & msg,
|
||||
bool udpiiu::beaconAction (
|
||||
const caHdr & msg,
|
||||
const osiSockAddr & net_addr, const epicsTime & currentTime )
|
||||
{
|
||||
struct sockaddr_in ina;
|
||||
@@ -753,9 +753,9 @@ bool udpiiu::beaconAction (
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* this allows a fan-out server to potentially
|
||||
* insert the true address of the CA server
|
||||
* insert the true address of the CA server
|
||||
*
|
||||
* old servers:
|
||||
* 1) set this field to one of the ip addresses of the host _or_
|
||||
@@ -782,29 +782,29 @@ bool udpiiu::beaconAction (
|
||||
unsigned protocolRevision = msg.m_dataType;
|
||||
ca_uint32_t beaconNumber = msg.m_cid;
|
||||
|
||||
this->cacRef.beaconNotify ( ina, currentTime,
|
||||
this->cacRef.beaconNotify ( ina, currentTime,
|
||||
beaconNumber, protocolRevision );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool udpiiu::repeaterAckAction (
|
||||
const caHdr &,
|
||||
bool udpiiu::repeaterAckAction (
|
||||
const caHdr &,
|
||||
const osiSockAddr &, const epicsTime &)
|
||||
{
|
||||
this->repeaterSubscribeTmr.confirmNotify ();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool udpiiu::notHereRespAction (
|
||||
const caHdr &,
|
||||
bool udpiiu::notHereRespAction (
|
||||
const caHdr &,
|
||||
const osiSockAddr &, const epicsTime & )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool udpiiu::exceptionRespAction (
|
||||
const caHdr &msg,
|
||||
bool udpiiu::exceptionRespAction (
|
||||
const caHdr &msg,
|
||||
const osiSockAddr & net_addr, const epicsTime & currentTime )
|
||||
{
|
||||
const caHdr &reqMsg = * ( &msg + 1 );
|
||||
@@ -814,22 +814,22 @@ bool udpiiu::exceptionRespAction (
|
||||
currentTime.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S");
|
||||
|
||||
if ( msg.m_postsize > sizeof ( caHdr ) ){
|
||||
errlogPrintf (
|
||||
"error condition \"%s\" detected by %s with context \"%s\" at %s\n",
|
||||
ca_message ( msg.m_available ),
|
||||
errlogPrintf (
|
||||
"error condition \"%s\" detected by %s with context \"%s\" at %s\n",
|
||||
ca_message ( msg.m_available ),
|
||||
name, reinterpret_cast <const char *> ( &reqMsg + 1 ), date );
|
||||
}
|
||||
else{
|
||||
errlogPrintf (
|
||||
"error condition \"%s\" detected by %s at %s\n",
|
||||
errlogPrintf (
|
||||
"error condition \"%s\" detected by %s at %s\n",
|
||||
ca_message ( msg.m_available ), name, date );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void udpiiu::postMsg (
|
||||
const osiSockAddr & net_addr,
|
||||
void udpiiu::postMsg (
|
||||
const osiSockAddr & net_addr,
|
||||
char * pInBuf, arrayElementCount blockSize,
|
||||
const epicsTime & currentTime )
|
||||
{
|
||||
@@ -844,16 +844,16 @@ void udpiiu::postMsg (
|
||||
if ( blockSize < sizeof ( *pCurMsg ) ) {
|
||||
char buf[64];
|
||||
sockAddrToDottedIP ( &net_addr.sa, buf, sizeof ( buf ) );
|
||||
errlogPrintf (
|
||||
"%s: Undecipherable (too small) UDP msg from %s ignored\n",
|
||||
errlogPrintf (
|
||||
"%s: Undecipherable (too small) UDP msg from %s ignored\n",
|
||||
__FILE__, buf );
|
||||
return;
|
||||
}
|
||||
|
||||
pCurMsg = reinterpret_cast < caHdr * > ( pInBuf );
|
||||
|
||||
/*
|
||||
* fix endian of bytes
|
||||
/*
|
||||
* fix endian of bytes
|
||||
*/
|
||||
pCurMsg->m_postsize = AlignedWireRef < epicsUInt16 > ( pCurMsg->m_postsize );
|
||||
pCurMsg->m_cmmd = AlignedWireRef < epicsUInt16 > ( pCurMsg->m_cmmd );
|
||||
@@ -881,8 +881,8 @@ void udpiiu::postMsg (
|
||||
if ( size > blockSize ) {
|
||||
char buf[64];
|
||||
sockAddrToDottedIP ( &net_addr.sa, buf, sizeof ( buf ) );
|
||||
errlogPrintf (
|
||||
"%s: Undecipherable (payload too small) UDP msg from %s ignored\n",
|
||||
errlogPrintf (
|
||||
"%s: Undecipherable (payload too small) UDP msg from %s ignored\n",
|
||||
__FILE__, buf );
|
||||
return;
|
||||
}
|
||||
@@ -919,14 +919,14 @@ bool udpiiu::pushVersionMsg ()
|
||||
caHdr msg;
|
||||
AlignedWireRef < epicsUInt16 > ( msg.m_cmmd ) = CA_PROTO_VERSION;
|
||||
AlignedWireRef < epicsUInt32 > ( msg.m_available ) = 0;
|
||||
AlignedWireRef < epicsUInt16 > ( msg.m_dataType ) = sequenceNoIsValid;
|
||||
AlignedWireRef < epicsUInt16 > ( msg.m_dataType ) = sequenceNoIsValid;
|
||||
AlignedWireRef < epicsUInt16 > ( msg.m_count ) = CA_MINOR_PROTOCOL_REVISION;
|
||||
AlignedWireRef < epicsUInt32 > ( msg.m_cid ) = this->sequenceNumber; // sequence number
|
||||
|
||||
return this->pushDatagramMsg ( guard, msg, 0, 0 );
|
||||
}
|
||||
|
||||
bool udpiiu::pushDatagramMsg ( epicsGuard < epicsMutex > & guard,
|
||||
bool udpiiu::pushDatagramMsg ( epicsGuard < epicsMutex > & guard,
|
||||
const caHdr & msg, const void * pExt, ca_uint16_t extsize )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->cacMutex );
|
||||
@@ -958,13 +958,13 @@ bool udpiiu::pushDatagramMsg ( epicsGuard < epicsMutex > & guard,
|
||||
return true;
|
||||
}
|
||||
|
||||
udpiiu :: SearchDestUDP :: SearchDestUDP (
|
||||
udpiiu :: SearchDestUDP :: SearchDestUDP (
|
||||
const osiSockAddr & destAddr, udpiiu & udpiiuIn ) :
|
||||
_lastError (0u), _destAddr ( destAddr ), _udpiiu ( udpiiuIn )
|
||||
{
|
||||
}
|
||||
|
||||
void udpiiu :: SearchDestUDP :: searchRequest (
|
||||
void udpiiu :: SearchDestUDP :: searchRequest (
|
||||
epicsGuard < epicsMutex > & guard, const char * pBuf, size_t bufSize )
|
||||
{
|
||||
guard.assertIdenticalMutex ( _udpiiu.cacMutex );
|
||||
@@ -972,7 +972,7 @@ void udpiiu :: SearchDestUDP :: searchRequest (
|
||||
int bufSizeAsInt = static_cast < int > ( bufSize );
|
||||
while ( true ) {
|
||||
// This const_cast is needed for vxWorks:
|
||||
int status = sendto ( _udpiiu.sock, const_cast<char *>(pBuf), bufSizeAsInt, 0,
|
||||
int status = sendto ( _udpiiu.sock, const_cast<char *>(pBuf), bufSizeAsInt, 0,
|
||||
& _destAddr.sa, sizeof ( _destAddr.sa ) );
|
||||
if ( status == bufSizeAsInt ) {
|
||||
if ( _lastError ) {
|
||||
@@ -1012,7 +1012,7 @@ void udpiiu :: SearchDestUDP :: searchRequest (
|
||||
break;
|
||||
} else {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
char buf[64];
|
||||
sockAddrToDottedIP ( &_destAddr.sa, buf, sizeof ( buf ) );
|
||||
@@ -1026,8 +1026,8 @@ void udpiiu :: SearchDestUDP :: searchRequest (
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void udpiiu :: SearchDestUDP :: show (
|
||||
|
||||
void udpiiu :: SearchDestUDP :: show (
|
||||
epicsGuard < epicsMutex > & guard, unsigned level ) const
|
||||
{
|
||||
guard.assertIdenticalMutex ( _udpiiu.cacMutex );
|
||||
@@ -1036,17 +1036,17 @@ void udpiiu :: SearchDestUDP :: show (
|
||||
:: printf ( "UDP Search destination \"%s\"\n", buf );
|
||||
}
|
||||
|
||||
udpiiu :: SearchRespCallback :: SearchRespCallback ( udpiiu & udpiiuIn ) :
|
||||
udpiiu :: SearchRespCallback :: SearchRespCallback ( udpiiu & udpiiuIn ) :
|
||||
_udpiiu ( udpiiuIn )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void udpiiu :: SearchRespCallback :: notify (
|
||||
const caHdr & msg, const void * pPayloadUntyped,
|
||||
const osiSockAddr & addr, const epicsTime & currentTime )
|
||||
{
|
||||
{
|
||||
/*
|
||||
* we dont currently know what to do with channel's
|
||||
* we dont currently know what to do with channel's
|
||||
* found to be at non-IP type addresses
|
||||
*/
|
||||
if ( addr.sa.sa_family != AF_INET ) {
|
||||
@@ -1098,25 +1098,25 @@ void udpiiu :: SearchRespCallback :: notify (
|
||||
}
|
||||
|
||||
if ( CA_V42 ( minorVersion ) ) {
|
||||
_udpiiu.cacRef.transferChanToVirtCircuit
|
||||
( msg.m_available, msg.m_cid, 0xffff,
|
||||
_udpiiu.cacRef.transferChanToVirtCircuit
|
||||
( msg.m_available, msg.m_cid, 0xffff,
|
||||
0, minorVersion, serverAddr, currentTime );
|
||||
}
|
||||
else {
|
||||
_udpiiu.cacRef.transferChanToVirtCircuit
|
||||
( msg.m_available, msg.m_cid, msg.m_dataType,
|
||||
_udpiiu.cacRef.transferChanToVirtCircuit
|
||||
( msg.m_available, msg.m_cid, msg.m_dataType,
|
||||
msg.m_count, minorVersion, serverAddr, currentTime );
|
||||
}
|
||||
}
|
||||
|
||||
void udpiiu :: SearchRespCallback :: show (
|
||||
void udpiiu :: SearchRespCallback :: show (
|
||||
epicsGuard < epicsMutex > & guard, unsigned level ) const
|
||||
{
|
||||
guard.assertIdenticalMutex ( _udpiiu.cacMutex );
|
||||
::printf ( "udpiiu :: SearchRespCallback\n" );
|
||||
}
|
||||
|
||||
bool udpiiu :: datagramFlush (
|
||||
bool udpiiu :: datagramFlush (
|
||||
epicsGuard < epicsMutex > & guard, const epicsTime & currentTime )
|
||||
{
|
||||
guard.assertIdenticalMutex ( cacMutex );
|
||||
@@ -1148,10 +1148,10 @@ void udpiiu :: show ( unsigned level ) const
|
||||
if ( level > 1u ) {
|
||||
::printf ("\trepeater port %u\n", this->repeaterPort );
|
||||
::printf ("\tdefault server port %u\n", this->serverPort );
|
||||
::printf ( "Search Destination List with %u items\n",
|
||||
::printf ( "Search Destination List with %u items\n",
|
||||
_searchDestList.count () );
|
||||
if ( level > 2u ) {
|
||||
tsDLIterConst < SearchDest > iter (
|
||||
tsDLIterConst < SearchDest > iter (
|
||||
_searchDestList.firstIter () );
|
||||
while ( iter.valid () )
|
||||
{
|
||||
@@ -1192,54 +1192,54 @@ bool udpiiu::wakeupMsg ()
|
||||
addr.ia.sin_port = htons ( this->localPort );
|
||||
|
||||
// send a wakeup msg so the UDP recv thread will exit
|
||||
int status = sendto ( this->sock, reinterpret_cast < char * > ( &msg ),
|
||||
int status = sendto ( this->sock, reinterpret_cast < char * > ( &msg ),
|
||||
sizeof (msg), 0, &addr.sa, sizeof ( addr.sa ) );
|
||||
return status == sizeof (msg);
|
||||
}
|
||||
|
||||
void udpiiu::beaconAnomalyNotify (
|
||||
epicsGuard < epicsMutex > & cacGuard )
|
||||
void udpiiu::beaconAnomalyNotify (
|
||||
epicsGuard < epicsMutex > & cacGuard )
|
||||
{
|
||||
for ( unsigned i = this->beaconAnomalyTimerIndex+1u;
|
||||
for ( unsigned i = this->beaconAnomalyTimerIndex+1u;
|
||||
i < this->nTimers; i++ ) {
|
||||
this->ppSearchTmr[i]->moveChannels ( cacGuard,
|
||||
this->ppSearchTmr[i]->moveChannels ( cacGuard,
|
||||
*this->ppSearchTmr[this->beaconAnomalyTimerIndex] );
|
||||
}
|
||||
}
|
||||
|
||||
void udpiiu::uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
void udpiiu::uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
const epicsTime & currentTime )
|
||||
{
|
||||
channelNode::channelState chanState =
|
||||
channelNode::channelState chanState =
|
||||
chan.channelNode::listMember;
|
||||
if ( chanState == channelNode::cs_disconnGov ) {
|
||||
this->govTmr.uninstallChan ( guard, chan );
|
||||
}
|
||||
else {
|
||||
this->ppSearchTmr[ chan.getSearchTimerIndex ( guard ) ]->
|
||||
uninstallChanDueToSuccessfulSearchResponse (
|
||||
guard, chan, this->lastReceivedSeqNo,
|
||||
this->ppSearchTmr[ chan.getSearchTimerIndex ( guard ) ]->
|
||||
uninstallChanDueToSuccessfulSearchResponse (
|
||||
guard, chan, this->lastReceivedSeqNo,
|
||||
this->lastReceivedSeqNoIsValid, currentTime );
|
||||
}
|
||||
}
|
||||
|
||||
void udpiiu::uninstallChan (
|
||||
void udpiiu::uninstallChan (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan )
|
||||
{
|
||||
channelNode::channelState chanState =
|
||||
channelNode::channelState chanState =
|
||||
chan.channelNode::listMember;
|
||||
if ( chanState == channelNode::cs_disconnGov ) {
|
||||
this->govTmr.uninstallChan ( guard, chan );
|
||||
}
|
||||
else {
|
||||
this->ppSearchTmr[ chan.getSearchTimerIndex ( guard ) ]->
|
||||
this->ppSearchTmr[ chan.getSearchTimerIndex ( guard ) ]->
|
||||
uninstallChan ( guard, chan );
|
||||
}
|
||||
}
|
||||
|
||||
bool udpiiu::searchMsg (
|
||||
epicsGuard < epicsMutex > & guard, ca_uint32_t id,
|
||||
epicsGuard < epicsMutex > & guard, ca_uint32_t id,
|
||||
const char * pName, unsigned nameLength )
|
||||
{
|
||||
caHdr msg;
|
||||
@@ -1248,25 +1248,25 @@ bool udpiiu::searchMsg (
|
||||
AlignedWireRef < epicsUInt16 > ( msg.m_dataType ) = DONTREPLY;
|
||||
AlignedWireRef < epicsUInt16 > ( msg.m_count ) = CA_MINOR_PROTOCOL_REVISION;
|
||||
AlignedWireRef < epicsUInt32 > ( msg.m_cid ) = id;
|
||||
return this->pushDatagramMsg (
|
||||
return this->pushDatagramMsg (
|
||||
guard, msg, pName, (ca_uint16_t) nameLength );
|
||||
}
|
||||
|
||||
void udpiiu::installNewChannel (
|
||||
void udpiiu::installNewChannel (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan, netiiu * & piiu )
|
||||
{
|
||||
piiu = this;
|
||||
this->ppSearchTmr[0]->installChannel ( guard, chan );
|
||||
}
|
||||
|
||||
void udpiiu::installDisconnectedChannel (
|
||||
void udpiiu::installDisconnectedChannel (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan )
|
||||
{
|
||||
chan.setServerAddressUnknown ( *this, guard );
|
||||
this->govTmr.installChan ( guard, chan );
|
||||
}
|
||||
|
||||
void udpiiu::noSearchRespNotify (
|
||||
void udpiiu::noSearchRespNotify (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan, unsigned index )
|
||||
{
|
||||
const unsigned nTimersMinusOne = this->nTimers - 1;
|
||||
@@ -1279,32 +1279,32 @@ void udpiiu::noSearchRespNotify (
|
||||
this->ppSearchTmr[index]->installChannel ( guard, chan );
|
||||
}
|
||||
|
||||
void udpiiu::boostChannel (
|
||||
void udpiiu::boostChannel (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan )
|
||||
{
|
||||
this->ppSearchTmr[this->beaconAnomalyTimerIndex]->
|
||||
installChannel ( guard, chan );
|
||||
}
|
||||
|
||||
void udpiiu::govExpireNotify (
|
||||
void udpiiu::govExpireNotify (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan )
|
||||
{
|
||||
this->ppSearchTmr[0]->installChannel ( guard, chan );
|
||||
}
|
||||
|
||||
int udpiiu :: M_repeaterTimerNotify :: printFormated (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
int udpiiu :: M_repeaterTimerNotify :: printFormated (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
const char * pformat, ... )
|
||||
{
|
||||
va_list theArgs;
|
||||
int status;
|
||||
|
||||
va_start ( theArgs, pformat );
|
||||
|
||||
|
||||
status = m_udpiiu.cacRef.varArgsPrintFormated ( cbGuard, pformat, theArgs );
|
||||
|
||||
|
||||
va_end ( theArgs );
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1331,7 +1331,7 @@ double udpiiu::getRTTE ( epicsGuard < epicsMutex > & guard ) const
|
||||
return this->rtteMean + 4 * this->rtteMeanDev;
|
||||
}
|
||||
|
||||
unsigned udpiiu::getHostName (
|
||||
unsigned udpiiu::getHostName (
|
||||
epicsGuard < epicsMutex > & cacGuard,
|
||||
char *pBuf, unsigned bufLength ) const throw ()
|
||||
{
|
||||
@@ -1356,71 +1356,71 @@ bool udpiiu::ca_v41_ok (
|
||||
return netiiu::ca_v41_ok ( cacGuard );
|
||||
}
|
||||
|
||||
void udpiiu::writeRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
nciu & chan, unsigned type,
|
||||
void udpiiu::writeRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
nciu & chan, unsigned type,
|
||||
arrayElementCount nElem, const void * pValue )
|
||||
{
|
||||
netiiu::writeRequest ( guard, chan, type, nElem, pValue );
|
||||
}
|
||||
|
||||
void udpiiu::writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
netWriteNotifyIO & io, unsigned type,
|
||||
void udpiiu::writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
netWriteNotifyIO & io, unsigned type,
|
||||
arrayElementCount nElem, const void *pValue )
|
||||
{
|
||||
netiiu::writeNotifyRequest ( guard, chan, io, type, nElem, pValue );
|
||||
}
|
||||
|
||||
void udpiiu::readNotifyRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
void udpiiu::readNotifyRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
netReadNotifyIO & io, unsigned type, arrayElementCount nElem )
|
||||
{
|
||||
netiiu::readNotifyRequest ( guard, chan, io, type, nElem );
|
||||
}
|
||||
|
||||
void udpiiu::clearChannelRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
void udpiiu::clearChannelRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
ca_uint32_t sid, ca_uint32_t cid )
|
||||
{
|
||||
netiiu::clearChannelRequest ( guard, sid, cid );
|
||||
}
|
||||
|
||||
void udpiiu::subscriptionRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
void udpiiu::subscriptionRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
netSubscription & subscr )
|
||||
{
|
||||
netiiu::subscriptionRequest ( guard, chan, subscr );
|
||||
}
|
||||
|
||||
void udpiiu::subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
void udpiiu::subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan,
|
||||
netSubscription & subscr )
|
||||
{
|
||||
netiiu::subscriptionUpdateRequest (
|
||||
guard, chan, subscr );
|
||||
}
|
||||
|
||||
void udpiiu::subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
void udpiiu::subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
nciu & chan, netSubscription & subscr )
|
||||
{
|
||||
netiiu::subscriptionCancelRequest ( guard, chan, subscr );
|
||||
}
|
||||
|
||||
void udpiiu::flushRequest (
|
||||
void udpiiu::flushRequest (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
netiiu::flushRequest ( guard );
|
||||
}
|
||||
|
||||
unsigned udpiiu::requestMessageBytesPending (
|
||||
unsigned udpiiu::requestMessageBytesPending (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
return netiiu::requestMessageBytesPending ( guard );
|
||||
}
|
||||
|
||||
void udpiiu::flush (
|
||||
void udpiiu::flush (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
netiiu::flush ( guard );
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_udpiiu_H
|
||||
@@ -52,10 +52,10 @@ LIBCA_API void ca_repeater ( void );
|
||||
class cac;
|
||||
class cacContextNotify;
|
||||
|
||||
class udpRecvThread :
|
||||
class udpRecvThread :
|
||||
private epicsThreadRunable {
|
||||
public:
|
||||
udpRecvThread (
|
||||
udpRecvThread (
|
||||
class udpiiu & iiuIn, cacContextNotify &, epicsMutex &,
|
||||
const char * pName, unsigned stackSize, unsigned priority );
|
||||
virtual ~udpRecvThread ();
|
||||
@@ -76,31 +76,31 @@ static const double maxSearchPeriodDefault = 5.0 * 60.0; // seconds
|
||||
static const double maxSearchPeriodLowerLimit = 60.0; // seconds
|
||||
static const double beaconAnomalySearchPeriod = 5.0; // seconds
|
||||
|
||||
class udpiiu :
|
||||
private netiiu,
|
||||
private searchTimerNotify,
|
||||
class udpiiu :
|
||||
private netiiu,
|
||||
private searchTimerNotify,
|
||||
private disconnectGovernorNotify {
|
||||
public:
|
||||
udpiiu (
|
||||
udpiiu (
|
||||
epicsGuard < epicsMutex > & cacGuard,
|
||||
class epicsTimerQueueActive &,
|
||||
epicsMutex & callbackControl,
|
||||
epicsMutex & mutualExclusion,
|
||||
class epicsTimerQueueActive &,
|
||||
epicsMutex & callbackControl,
|
||||
epicsMutex & mutualExclusion,
|
||||
cacContextNotify &,
|
||||
class cac &,
|
||||
unsigned port,
|
||||
tsDLList < SearchDest > & );
|
||||
virtual ~udpiiu ();
|
||||
void installNewChannel (
|
||||
void installNewChannel (
|
||||
epicsGuard < epicsMutex > &, nciu &, netiiu * & );
|
||||
void installDisconnectedChannel (
|
||||
void installDisconnectedChannel (
|
||||
epicsGuard < epicsMutex > &, nciu & );
|
||||
void beaconAnomalyNotify (
|
||||
void beaconAnomalyNotify (
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
void shutdown ( epicsGuard < epicsMutex > & cbGuard,
|
||||
void shutdown ( epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
void show ( unsigned level ) const;
|
||||
|
||||
|
||||
// exceptions
|
||||
class noSocket {};
|
||||
|
||||
@@ -109,43 +109,43 @@ private:
|
||||
public SearchDest {
|
||||
public:
|
||||
SearchDestUDP ( const osiSockAddr &, udpiiu & );
|
||||
void searchRequest (
|
||||
void searchRequest (
|
||||
epicsGuard < epicsMutex > &, const char * pBuf, size_t bufLen );
|
||||
void show (
|
||||
void show (
|
||||
epicsGuard < epicsMutex > &, unsigned level ) const;
|
||||
private:
|
||||
int _lastError;
|
||||
osiSockAddr _destAddr;
|
||||
udpiiu & _udpiiu;
|
||||
};
|
||||
class SearchRespCallback :
|
||||
class SearchRespCallback :
|
||||
public SearchDest :: Callback {
|
||||
public:
|
||||
SearchRespCallback ( udpiiu & );
|
||||
void notify (
|
||||
const caHdr &, const void * pPayload,
|
||||
const osiSockAddr &, const epicsTime & );
|
||||
void show (
|
||||
void show (
|
||||
epicsGuard < epicsMutex > &, unsigned level ) const;
|
||||
private:
|
||||
udpiiu & _udpiiu;
|
||||
};
|
||||
class M_repeaterTimerNotify :
|
||||
class M_repeaterTimerNotify :
|
||||
public repeaterTimerNotify {
|
||||
public:
|
||||
M_repeaterTimerNotify ( udpiiu & iiu ) :
|
||||
M_repeaterTimerNotify ( udpiiu & iiu ) :
|
||||
m_udpiiu ( iiu ) {}
|
||||
~M_repeaterTimerNotify (); /* for sunpro compiler */
|
||||
// repeaterTimerNotify
|
||||
void repeaterRegistrationMessage (
|
||||
void repeaterRegistrationMessage (
|
||||
unsigned attemptNumber );
|
||||
int printFormated (
|
||||
epicsGuard < epicsMutex > & callbackControl,
|
||||
int printFormated (
|
||||
epicsGuard < epicsMutex > & callbackControl,
|
||||
const char * pformat, ... );
|
||||
private:
|
||||
udpiiu & m_udpiiu;
|
||||
};
|
||||
char xmitBuf [MAX_UDP_SEND];
|
||||
char xmitBuf [MAX_UDP_SEND];
|
||||
char recvBuf [MAX_UDP_RECV];
|
||||
udpRecvThread recvThread;
|
||||
M_repeaterTimerNotify m_repeaterTimerNotify;
|
||||
@@ -182,120 +182,120 @@ private:
|
||||
|
||||
bool wakeupMsg ();
|
||||
|
||||
void postMsg (
|
||||
const osiSockAddr & net_addr,
|
||||
void postMsg (
|
||||
const osiSockAddr & net_addr,
|
||||
char *pInBuf, arrayElementCount blockSize,
|
||||
const epicsTime ¤Time );
|
||||
|
||||
bool pushDatagramMsg ( epicsGuard < epicsMutex > &,
|
||||
const caHdr & hdr, const void * pExt,
|
||||
bool pushDatagramMsg ( epicsGuard < epicsMutex > &,
|
||||
const caHdr & hdr, const void * pExt,
|
||||
ca_uint16_t extsize);
|
||||
|
||||
typedef bool ( udpiiu::*pProtoStubUDP ) (
|
||||
const caHdr &,
|
||||
typedef bool ( udpiiu::*pProtoStubUDP ) (
|
||||
const caHdr &,
|
||||
const osiSockAddr &, const epicsTime & );
|
||||
|
||||
// UDP protocol dispatch table
|
||||
static const pProtoStubUDP udpJumpTableCAC[];
|
||||
|
||||
// UDP protocol stubs
|
||||
bool versionAction (
|
||||
const caHdr &,
|
||||
bool versionAction (
|
||||
const caHdr &,
|
||||
const osiSockAddr &, const epicsTime & );
|
||||
bool badUDPRespAction (
|
||||
const caHdr &msg,
|
||||
bool badUDPRespAction (
|
||||
const caHdr &msg,
|
||||
const osiSockAddr &netAddr, const epicsTime & );
|
||||
bool searchRespAction (
|
||||
const caHdr &msg,
|
||||
bool searchRespAction (
|
||||
const caHdr &msg,
|
||||
const osiSockAddr &net_addr, const epicsTime & );
|
||||
bool exceptionRespAction (
|
||||
const caHdr &msg,
|
||||
bool exceptionRespAction (
|
||||
const caHdr &msg,
|
||||
const osiSockAddr &net_addr, const epicsTime & );
|
||||
bool beaconAction (
|
||||
const caHdr &msg,
|
||||
bool beaconAction (
|
||||
const caHdr &msg,
|
||||
const osiSockAddr &net_addr, const epicsTime & );
|
||||
bool notHereRespAction (
|
||||
const caHdr &msg,
|
||||
bool notHereRespAction (
|
||||
const caHdr &msg,
|
||||
const osiSockAddr &net_addr, const epicsTime & );
|
||||
bool repeaterAckAction (
|
||||
const caHdr &msg,
|
||||
bool repeaterAckAction (
|
||||
const caHdr &msg,
|
||||
const osiSockAddr &net_addr, const epicsTime & );
|
||||
|
||||
// netiiu stubs
|
||||
unsigned getHostName (
|
||||
epicsGuard < epicsMutex > &, char * pBuf,
|
||||
unsigned getHostName (
|
||||
epicsGuard < epicsMutex > &, char * pBuf,
|
||||
unsigned bufLength ) const throw ();
|
||||
const char * pHostName (
|
||||
epicsGuard < epicsMutex > & ) const throw ();
|
||||
epicsGuard < epicsMutex > & ) const throw ();
|
||||
bool ca_v41_ok (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
bool ca_v42_ok (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
unsigned requestMessageBytesPending (
|
||||
unsigned requestMessageBytesPending (
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard );
|
||||
void flush (
|
||||
void flush (
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard );
|
||||
void writeRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
void writeRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
const void *pValue );
|
||||
void writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netWriteNotifyIO &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
void writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netWriteNotifyIO &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
const void *pValue );
|
||||
void readNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
netReadNotifyIO &, unsigned type,
|
||||
void readNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
netReadNotifyIO &, unsigned type,
|
||||
arrayElementCount nElem );
|
||||
void clearChannelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void clearChannelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
ca_uint32_t sid, ca_uint32_t cid );
|
||||
void subscriptionRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void subscriptionRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netSubscription & );
|
||||
void subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netSubscription & );
|
||||
void subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu & chan, netSubscription & subscr );
|
||||
void flushRequest (
|
||||
void flushRequest (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void requestRecvProcessPostponedFlush (
|
||||
epicsGuard < epicsMutex > & );
|
||||
osiSockAddr getNetworkAddress (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
void uninstallChan (
|
||||
void uninstallChan (
|
||||
epicsGuard < epicsMutex > &, nciu & );
|
||||
void uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
void uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
const class epicsTime & currentTime );
|
||||
double receiveWatchdogDelay (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
bool searchMsg (
|
||||
epicsGuard < epicsMutex > &, ca_uint32_t id,
|
||||
epicsGuard < epicsMutex > &, ca_uint32_t id,
|
||||
const char * pName, unsigned nameLength );
|
||||
|
||||
// searchTimerNotify stubs
|
||||
double getRTTE ( epicsGuard < epicsMutex > & ) const;
|
||||
void updateRTTE ( epicsGuard < epicsMutex > &, double rtte );
|
||||
bool pushVersionMsg ();
|
||||
void boostChannel (
|
||||
void boostChannel (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan );
|
||||
void noSearchRespNotify (
|
||||
void noSearchRespNotify (
|
||||
epicsGuard < epicsMutex > &, nciu & chan, unsigned index );
|
||||
bool datagramFlush (
|
||||
bool datagramFlush (
|
||||
epicsGuard < epicsMutex > &, const epicsTime & currentTime );
|
||||
ca_uint32_t datagramSeqNumber (
|
||||
ca_uint32_t datagramSeqNumber (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
|
||||
// disconnectGovernorNotify
|
||||
void govExpireNotify (
|
||||
void govExpireNotify (
|
||||
epicsGuard < epicsMutex > &, nciu & );
|
||||
|
||||
udpiiu ( const udpiiu & );
|
||||
udpiiu & operator = ( const udpiiu & );
|
||||
udpiiu ( const udpiiu & );
|
||||
udpiiu & operator = ( const udpiiu & );
|
||||
|
||||
friend class udpRecvThread;
|
||||
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef INC_virtualCircuit_H
|
||||
@@ -42,19 +42,19 @@ class callbackManager;
|
||||
|
||||
// a modified ca header with capacity for large arrays
|
||||
struct caHdrLargeArray {
|
||||
ca_uint32_t m_postsize; // size of message extension
|
||||
ca_uint32_t m_count; // operation data count
|
||||
ca_uint32_t m_cid; // channel identifier
|
||||
ca_uint32_t m_postsize; // size of message extension
|
||||
ca_uint32_t m_count; // operation data count
|
||||
ca_uint32_t m_cid; // channel identifier
|
||||
ca_uint32_t m_available; // protocol stub dependent
|
||||
ca_uint16_t m_dataType; // operation data type
|
||||
ca_uint16_t m_cmmd; // operation to be performed
|
||||
ca_uint16_t m_dataType; // operation data type
|
||||
ca_uint16_t m_cmmd; // operation to be performed
|
||||
};
|
||||
|
||||
class ipAddrToAsciiEngine;
|
||||
|
||||
class tcpRecvThread : private epicsThreadRunable {
|
||||
public:
|
||||
tcpRecvThread (
|
||||
tcpRecvThread (
|
||||
class tcpiiu & iiuIn, epicsMutex & cbMutexIn, cacContextNotify &,
|
||||
const char * pName, unsigned int stackSize, unsigned int priority );
|
||||
virtual ~tcpRecvThread ();
|
||||
@@ -71,15 +71,15 @@ private:
|
||||
void run ();
|
||||
void connect (
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
bool validFillStatus (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
bool validFillStatus (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
const statusWireIO & stat );
|
||||
};
|
||||
|
||||
class tcpSendThread : private epicsThreadRunable {
|
||||
public:
|
||||
tcpSendThread (
|
||||
class tcpiiu & iiuIn, const char * pName,
|
||||
tcpSendThread (
|
||||
class tcpiiu & iiuIn, const char * pName,
|
||||
unsigned int stackSize, unsigned int priority );
|
||||
virtual ~tcpSendThread ();
|
||||
void start ();
|
||||
@@ -110,49 +110,49 @@ private:
|
||||
|
||||
class tcpiiu :
|
||||
public netiiu, public tsDLNode < tcpiiu >,
|
||||
public tsSLNode < tcpiiu >, public caServerID,
|
||||
public tsSLNode < tcpiiu >, public caServerID,
|
||||
private wireSendAdapter, private wireRecvAdapter {
|
||||
friend void SearchDestTCP::searchRequest ( epicsGuard < epicsMutex > & guard,
|
||||
const char * pbuf, size_t len );
|
||||
public:
|
||||
tcpiiu ( cac & cac, epicsMutex & mutualExclusion, epicsMutex & callbackControl,
|
||||
cacContextNotify &, double connectionTimeout, epicsTimerQueue & timerQueue,
|
||||
const osiSockAddr & addrIn, comBufMemoryManager &, unsigned minorVersion,
|
||||
tcpiiu ( cac & cac, epicsMutex & mutualExclusion, epicsMutex & callbackControl,
|
||||
cacContextNotify &, double connectionTimeout, epicsTimerQueue & timerQueue,
|
||||
const osiSockAddr & addrIn, comBufMemoryManager &, unsigned minorVersion,
|
||||
ipAddrToAsciiEngine & engineIn, const cacChannel::priLev & priorityIn,
|
||||
SearchDestTCP * pSearchDestIn = NULL);
|
||||
~tcpiiu ();
|
||||
void start (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void responsiveCircuitNotify (
|
||||
void responsiveCircuitNotify (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
void sendTimeoutNotify (
|
||||
void sendTimeoutNotify (
|
||||
callbackManager & cbMgr,
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
void receiveTimeoutNotify(
|
||||
void receiveTimeoutNotify(
|
||||
callbackManager &,
|
||||
epicsGuard < epicsMutex > & );
|
||||
void beaconAnomalyNotify (
|
||||
void beaconAnomalyNotify (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void beaconArrivalNotify (
|
||||
void beaconArrivalNotify (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void probeResponseNotify (
|
||||
void probeResponseNotify (
|
||||
epicsGuard < epicsMutex > & );
|
||||
|
||||
void flushRequest (
|
||||
void flushRequest (
|
||||
epicsGuard < epicsMutex > & );
|
||||
unsigned requestMessageBytesPending (
|
||||
unsigned requestMessageBytesPending (
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard );
|
||||
void flush (
|
||||
void flush (
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard );
|
||||
|
||||
void show ( unsigned level ) const;
|
||||
bool setEchoRequestPending (
|
||||
bool setEchoRequestPending (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void requestRecvProcessPostponedFlush (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void clearChannelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void clearChannelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
ca_uint32_t sid, ca_uint32_t cid );
|
||||
|
||||
bool ca_v41_ok (
|
||||
@@ -164,41 +164,41 @@ public:
|
||||
bool ca_v49_ok (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
|
||||
unsigned getHostName (
|
||||
unsigned getHostName (
|
||||
epicsGuard < epicsMutex > &,
|
||||
char *pBuf, unsigned bufLength ) const throw ();
|
||||
bool alive (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
bool connecting (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
bool receiveThreadIsBusy (
|
||||
bool receiveThreadIsBusy (
|
||||
epicsGuard < epicsMutex > & );
|
||||
osiSockAddr getNetworkAddress (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
int printFormated (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
int printFormated (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
const char *pformat, ... );
|
||||
unsigned channelCount (
|
||||
unsigned channelCount (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void disconnectAllChannels (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard, class udpiiu & );
|
||||
void unlinkAllChannels (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
void installChannel (
|
||||
epicsGuard < epicsMutex > &, nciu & chan,
|
||||
void installChannel (
|
||||
epicsGuard < epicsMutex > &, nciu & chan,
|
||||
unsigned sidIn, ca_uint16_t typeIn, arrayElementCount countIn );
|
||||
void uninstallChan (
|
||||
void uninstallChan (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan );
|
||||
bool connectNotify (
|
||||
bool connectNotify (
|
||||
epicsGuard < epicsMutex > &, nciu & chan );
|
||||
|
||||
void searchRespNotify (
|
||||
|
||||
void searchRespNotify (
|
||||
const epicsTime &, const caHdrLargeArray & );
|
||||
void versionRespNotify ( const caHdrLargeArray & );
|
||||
|
||||
void * operator new ( size_t size,
|
||||
void * operator new ( size_t size,
|
||||
tsFreeList < class tcpiiu, 32, epicsMutexNOOP > & );
|
||||
epicsPlacementDeleteOperator (( void *,
|
||||
tsFreeList < class tcpiiu, 32, epicsMutexNOOP > & ))
|
||||
@@ -230,7 +230,7 @@ private:
|
||||
epicsMutex & mutex;
|
||||
epicsMutex & cbMutex;
|
||||
unsigned minorProtocolVersion;
|
||||
enum iiu_conn_state {
|
||||
enum iiu_conn_state {
|
||||
iiucs_connecting, // pending circuit connect
|
||||
iiucs_connected, // live circuit
|
||||
iiucs_clean_shutdown, // live circuit will shutdown when flush completes
|
||||
@@ -248,7 +248,7 @@ private:
|
||||
bool _receiveThreadIsBusy;
|
||||
bool busyStateDetected; // only modified by the recv thread
|
||||
bool flowControlActive; // only modified by the send process thread
|
||||
bool echoRequestPending;
|
||||
bool echoRequestPending;
|
||||
bool oldMsgHeaderAvailable;
|
||||
bool msgHeaderAvailable;
|
||||
bool earlyFlush;
|
||||
@@ -257,93 +257,93 @@ private:
|
||||
bool socketHasBeenClosed;
|
||||
bool unresponsiveCircuit;
|
||||
|
||||
bool processIncoming (
|
||||
bool processIncoming (
|
||||
const epicsTime & currentTime, callbackManager & );
|
||||
unsigned sendBytes ( const void *pBuf,
|
||||
unsigned sendBytes ( const void *pBuf,
|
||||
unsigned nBytesInBuf, const epicsTime & currentTime );
|
||||
void recvBytes (
|
||||
void recvBytes (
|
||||
void * pBuf, unsigned nBytesInBuf, statusWireIO & );
|
||||
const char * pHostName (
|
||||
epicsGuard < epicsMutex > & ) const throw ();
|
||||
double receiveWatchdogDelay (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
void unresponsiveCircuitNotify (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
void unresponsiveCircuitNotify (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
void initiateCleanShutdown (
|
||||
void initiateCleanShutdown (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void initiateAbortShutdown (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void initiateAbortShutdown (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void disconnectNotify (
|
||||
epicsGuard < epicsMutex > & );
|
||||
bool bytesArePendingInOS () const;
|
||||
void decrementBlockingForFlushCount (
|
||||
void decrementBlockingForFlushCount (
|
||||
epicsGuard < epicsMutex > & guard );
|
||||
bool isNameService () const;
|
||||
|
||||
// send protocol stubs
|
||||
void echoRequest (
|
||||
void echoRequest (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void versionMessage (
|
||||
void versionMessage (
|
||||
epicsGuard < epicsMutex > &, const cacChannel::priLev & priority );
|
||||
void disableFlowControlRequest (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void enableFlowControlRequest (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void hostNameSetRequest (
|
||||
void hostNameSetRequest (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void userNameSetRequest (
|
||||
void userNameSetRequest (
|
||||
epicsGuard < epicsMutex > & );
|
||||
void createChannelRequest (
|
||||
void createChannelRequest (
|
||||
nciu &, epicsGuard < epicsMutex > & );
|
||||
void writeRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
void writeRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
unsigned type, arrayElementCount nElem, const void *pValue );
|
||||
void writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
netWriteNotifyIO &, unsigned type,
|
||||
void writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
netWriteNotifyIO &, unsigned type,
|
||||
arrayElementCount nElem, const void *pValue );
|
||||
void readNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
netReadNotifyIO &, unsigned type,
|
||||
void readNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &,
|
||||
netReadNotifyIO &, unsigned type,
|
||||
arrayElementCount nElem );
|
||||
void subscriptionRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void subscriptionRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu &, netSubscription & subscr );
|
||||
void subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void subscriptionUpdateRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu & chan, netSubscription & subscr );
|
||||
void subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
void subscriptionCancelRequest (
|
||||
epicsGuard < epicsMutex > &,
|
||||
nciu & chan, netSubscription & subscr );
|
||||
void flushIfRecvProcessRequested (
|
||||
epicsGuard < epicsMutex > & );
|
||||
bool sendThreadFlush (
|
||||
bool sendThreadFlush (
|
||||
epicsGuard < epicsMutex > & );
|
||||
|
||||
// netiiu stubs
|
||||
void uninstallChanDueToSuccessfulSearchResponse (
|
||||
void uninstallChanDueToSuccessfulSearchResponse (
|
||||
epicsGuard < epicsMutex > &, nciu &, const class epicsTime & );
|
||||
bool searchMsg (
|
||||
epicsGuard < epicsMutex > &, ca_uint32_t id,
|
||||
epicsGuard < epicsMutex > &, ca_uint32_t id,
|
||||
const char * pName, unsigned nameLength );
|
||||
|
||||
friend class tcpRecvThread;
|
||||
friend class tcpSendThread;
|
||||
|
||||
tcpiiu ( const tcpiiu & );
|
||||
tcpiiu & operator = ( const tcpiiu & );
|
||||
tcpiiu ( const tcpiiu & );
|
||||
tcpiiu & operator = ( const tcpiiu & );
|
||||
void operator delete ( void * );
|
||||
};
|
||||
|
||||
inline void * tcpiiu::operator new ( size_t size,
|
||||
inline void * tcpiiu::operator new ( size_t size,
|
||||
tsFreeList < class tcpiiu, 32, epicsMutexNOOP > & mgr )
|
||||
{
|
||||
return mgr.allocate ( size );
|
||||
}
|
||||
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void tcpiiu::operator delete ( void * pCadaver,
|
||||
inline void tcpiiu::operator delete ( void * pCadaver,
|
||||
tsFreeList < class tcpiiu, 32, epicsMutexNOOP > & mgr )
|
||||
{
|
||||
mgr.release ( pCadaver );
|
||||
@@ -371,7 +371,7 @@ inline bool tcpiiu::ca_v49_ok (
|
||||
inline bool tcpiiu::alive (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return ( this->state == iiucs_connecting ||
|
||||
return ( this->state == iiucs_connecting ||
|
||||
this->state == iiucs_connected );
|
||||
}
|
||||
|
||||
@@ -381,14 +381,14 @@ inline bool tcpiiu::connecting (
|
||||
return ( this->state == iiucs_connecting );
|
||||
}
|
||||
|
||||
inline bool tcpiiu::receiveThreadIsBusy (
|
||||
inline bool tcpiiu::receiveThreadIsBusy (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
return this->_receiveThreadIsBusy;
|
||||
}
|
||||
|
||||
inline void tcpiiu::beaconAnomalyNotify (
|
||||
inline void tcpiiu::beaconAnomalyNotify (
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
//guard.assertIdenticalMutex ( this->cacRef.mutexRef () );
|
||||
|
||||
@@ -134,7 +134,7 @@ garbage-collected by Perl.
|
||||
|
||||
=head2 Object Methods
|
||||
|
||||
The following methods are provided for channel objects returned by
|
||||
The following methods are provided for channel objects returned by
|
||||
C<< CA->new() >>.
|
||||
|
||||
=over 4
|
||||
@@ -232,7 +232,7 @@ below.
|
||||
Callback subroutines should only call Perl's C<exit>, C<die> or similar
|
||||
functions if they are expecting the program to exit at that time; attempts to
|
||||
C<die> with an exception object in the callback and catch that using C<eval> in
|
||||
the main thread are not likely to succeed and will probably result in a crash.
|
||||
the main thread are not likely to succeed and will probably result in a crash.
|
||||
Callbacks should not perform any operations that would block for more than a
|
||||
fraction of a second as this will hold up network communications with the
|
||||
relevant server and could cause the Perl program and/or the Channel Access
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
double data;
|
||||
chid mychid;
|
||||
double data;
|
||||
chid mychid;
|
||||
|
||||
if(argc != 2) {
|
||||
fprintf(stderr,"usage: caExample pvname\n");
|
||||
exit(1);
|
||||
fprintf(stderr,"usage: caExample pvname\n");
|
||||
exit(1);
|
||||
}
|
||||
SEVCHK(ca_context_create(ca_disable_preemptive_callback),"ca_context_create");
|
||||
SEVCHK(ca_create_channel(argv[1],NULL,NULL,10,&mychid),"ca_create_channel failure");
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#define MAX_PV_NAME_LEN 40
|
||||
|
||||
typedef struct{
|
||||
char value[20];
|
||||
chid mychid;
|
||||
evid myevid;
|
||||
char value[20];
|
||||
chid mychid;
|
||||
evid myevid;
|
||||
} MYNODE;
|
||||
|
||||
|
||||
@@ -28,16 +28,16 @@ static void printChidInfo(chid chid, char *message)
|
||||
{
|
||||
printf("\n%s\n",message);
|
||||
printf("pv: %s type(%d) nelements(%ld) host(%s)",
|
||||
ca_name(chid),ca_field_type(chid),ca_element_count(chid),
|
||||
ca_host_name(chid));
|
||||
ca_name(chid),ca_field_type(chid),ca_element_count(chid),
|
||||
ca_host_name(chid));
|
||||
printf(" read(%d) write(%d) state(%d)\n",
|
||||
ca_read_access(chid),ca_write_access(chid),ca_state(chid));
|
||||
ca_read_access(chid),ca_write_access(chid),ca_state(chid));
|
||||
}
|
||||
|
||||
static void exceptionCallback(struct exception_handler_args args)
|
||||
{
|
||||
chid chid = args.chid;
|
||||
long stat = args.stat; /* Channel access status code*/
|
||||
chid chid = args.chid;
|
||||
long stat = args.stat; /* Channel access status code*/
|
||||
const char *channel;
|
||||
static char *noname = "unknown";
|
||||
|
||||
@@ -51,39 +51,39 @@ static void exceptionCallback(struct exception_handler_args args)
|
||||
|
||||
static void connectionCallback(struct connection_handler_args args)
|
||||
{
|
||||
chid chid = args.chid;
|
||||
chid chid = args.chid;
|
||||
|
||||
printChidInfo(chid,"connectionCallback");
|
||||
}
|
||||
|
||||
static void accessRightsCallback(struct access_rights_handler_args args)
|
||||
{
|
||||
chid chid = args.chid;
|
||||
chid chid = args.chid;
|
||||
|
||||
printChidInfo(chid,"accessRightsCallback");
|
||||
}
|
||||
static void eventCallback(struct event_handler_args eha)
|
||||
{
|
||||
chid chid = eha.chid;
|
||||
chid chid = eha.chid;
|
||||
|
||||
if(eha.status!=ECA_NORMAL) {
|
||||
printChidInfo(chid,"eventCallback");
|
||||
printChidInfo(chid,"eventCallback");
|
||||
} else {
|
||||
char *pdata = (char *)eha.dbr;
|
||||
printf("Event Callback: %s = %s\n",ca_name(eha.chid),pdata);
|
||||
char *pdata = (char *)eha.dbr;
|
||||
printf("Event Callback: %s = %s\n",ca_name(eha.chid),pdata);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
char *filename;
|
||||
int npv = 0;
|
||||
MYNODE *pmynode[MAX_PV];
|
||||
char *pname[MAX_PV];
|
||||
int i;
|
||||
char tempStr[MAX_PV_NAME_LEN];
|
||||
char *pstr;
|
||||
FILE *fp;
|
||||
int npv = 0;
|
||||
MYNODE *pmynode[MAX_PV];
|
||||
char *pname[MAX_PV];
|
||||
int i;
|
||||
char tempStr[MAX_PV_NAME_LEN];
|
||||
char *pstr;
|
||||
FILE *fp;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr,"usage: caMonitor filename\n");
|
||||
@@ -112,17 +112,17 @@ int main(int argc,char **argv)
|
||||
fclose(fp);
|
||||
SEVCHK(ca_context_create(ca_disable_preemptive_callback),"ca_context_create");
|
||||
SEVCHK(ca_add_exception_event(exceptionCallback,NULL),
|
||||
"ca_add_exception_event");
|
||||
"ca_add_exception_event");
|
||||
for (i=0; i<npv; i++) {
|
||||
SEVCHK(ca_create_channel(pname[i],connectionCallback,
|
||||
pmynode[i],20,&pmynode[i]->mychid),
|
||||
"ca_create_channel");
|
||||
SEVCHK(ca_replace_access_rights_event(pmynode[i]->mychid,
|
||||
accessRightsCallback),
|
||||
"ca_replace_access_rights_event");
|
||||
SEVCHK(ca_create_subscription(DBR_STRING,1,pmynode[i]->mychid,
|
||||
DBE_VALUE,eventCallback,pmynode[i],&pmynode[i]->myevid),
|
||||
"ca_create_subscription");
|
||||
SEVCHK(ca_create_channel(pname[i],connectionCallback,
|
||||
pmynode[i],20,&pmynode[i]->mychid),
|
||||
"ca_create_channel");
|
||||
SEVCHK(ca_replace_access_rights_event(pmynode[i]->mychid,
|
||||
accessRightsCallback),
|
||||
"ca_replace_access_rights_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");
|
||||
|
||||
@@ -55,7 +55,7 @@ sub conn_callback {
|
||||
if ($opt_n && $type eq 'DBR_ENUM')
|
||||
|| (!$opt_S && $type eq 'DBR_CHAR');
|
||||
$type =~ s/^DBR_/DBR_TIME_/;
|
||||
|
||||
|
||||
$monitors{$chan} =
|
||||
$chan->create_subscription($opt_m, \&mon_callback, $type, 0+$opt_c);
|
||||
}
|
||||
@@ -93,7 +93,7 @@ sub display {
|
||||
my ($chan, $data) = @_;
|
||||
die "Internal error"
|
||||
unless ref $data eq 'HASH';
|
||||
|
||||
|
||||
my $type = $data->{TYPE};
|
||||
my $value = $data->{value};
|
||||
if (ref $value eq 'ARRAY') {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
|
||||
* Synchrotronstrahlung.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
@@ -109,12 +109,12 @@ static void usage (void)
|
||||
|
||||
/*+**************************************************************************
|
||||
*
|
||||
* Function: event_handler
|
||||
* Function: event_handler
|
||||
*
|
||||
* Description: CA event_handler for request type callback
|
||||
* Allocates the dbr structure and copies the data
|
||||
* Description: CA event_handler for request type callback
|
||||
* Allocates the dbr structure and copies the data
|
||||
*
|
||||
* Arg(s) In: args - event handler args (see CA manual)
|
||||
* Arg(s) In: args - event handler args (see CA manual)
|
||||
*
|
||||
**************************************************************************-*/
|
||||
|
||||
@@ -137,22 +137,22 @@ static void event_handler (evargs args)
|
||||
|
||||
/*+**************************************************************************
|
||||
*
|
||||
* Function: caget
|
||||
* Function: caget
|
||||
*
|
||||
* Description: Issue read requests, wait for incoming data
|
||||
* and print the data according to the selected format
|
||||
* Description: Issue read requests, wait for incoming data
|
||||
* and print the data according to the selected format
|
||||
*
|
||||
* Arg(s) In: pvs - Pointer to an array of pv structures
|
||||
* Arg(s) In: pvs - Pointer to an array of pv structures
|
||||
* nPvs - Number of elements in the pvs array
|
||||
* request - Request type
|
||||
* format - Output format
|
||||
* dbrType - Requested dbr type
|
||||
* reqElems - Requested number of (array) elements
|
||||
*
|
||||
* Return(s): Error code: 0 = OK, 1 = Error
|
||||
* Return(s): Error code: 0 = OK, 1 = Error
|
||||
*
|
||||
**************************************************************************-*/
|
||||
|
||||
|
||||
static int caget (pv *pvs, int nPvs, RequestT request, OutputT format,
|
||||
chtype dbrType, unsigned long reqElems)
|
||||
{
|
||||
@@ -350,23 +350,23 @@ static int caget (pv *pvs, int nPvs, RequestT request, OutputT format,
|
||||
|
||||
/*+**************************************************************************
|
||||
*
|
||||
* Function: main
|
||||
* Function: main
|
||||
*
|
||||
* Description: caget main()
|
||||
* Evaluate command line options, set up CA, connect the
|
||||
* channels, collect and print the data as requested
|
||||
* Description: caget main()
|
||||
* Evaluate command line options, set up CA, connect the
|
||||
* channels, collect and print the data as requested
|
||||
*
|
||||
* Arg(s) In: [options] <pv-name> ...
|
||||
* Arg(s) In: [options] <pv-name> ...
|
||||
*
|
||||
* Arg(s) Out: none
|
||||
* Arg(s) Out: none
|
||||
*
|
||||
* Return(s): Standard return code (0=success, 1=error)
|
||||
* Return(s): Standard return code (0=success, 1=error)
|
||||
*
|
||||
**************************************************************************-*/
|
||||
|
||||
static void complainIfNotPlainAndSet (OutputT *current, const OutputT requested)
|
||||
{
|
||||
if (*current != plain)
|
||||
if (*current != plain)
|
||||
fprintf(stderr,
|
||||
"Options t,d,a are mutually exclusive. "
|
||||
"('caget -h' for help.)\n");
|
||||
@@ -467,7 +467,7 @@ int main (int argc, char *argv[])
|
||||
case 'f':
|
||||
case 'g':
|
||||
if (sscanf(optarg, "%d", &digits) != 1)
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"Invalid precision argument '%s' "
|
||||
"for option '-%c' - ignored.\n", optarg, opt);
|
||||
else
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
|
||||
* Synchrotronstrahlung.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
@@ -51,17 +51,17 @@ void usage (void)
|
||||
|
||||
/*+**************************************************************************
|
||||
*
|
||||
* Function: cainfo
|
||||
* Function: cainfo
|
||||
*
|
||||
* Description: Print CA info data or call ca_client_status
|
||||
* Description: Print CA info data or call ca_client_status
|
||||
*
|
||||
* Arg(s) In: pvs - Pointer to an array of pv structures
|
||||
* Arg(s) In: pvs - Pointer to an array of pv structures
|
||||
* nPvs - Number of elements in the pvs array
|
||||
*
|
||||
* Return(s): Error code: 0 = OK, 1 = Error
|
||||
* Return(s): Error code: 0 = OK, 1 = Error
|
||||
*
|
||||
**************************************************************************-*/
|
||||
|
||||
|
||||
int cainfo (pv *pvs, int nPvs)
|
||||
{
|
||||
int n;
|
||||
@@ -114,17 +114,17 @@ int cainfo (pv *pvs, int nPvs)
|
||||
|
||||
/*+**************************************************************************
|
||||
*
|
||||
* Function: main
|
||||
* Function: main
|
||||
*
|
||||
* Description: cainfo main()
|
||||
* Evaluate command line options, set up CA, connect the
|
||||
* channels, print the data as requested
|
||||
* Description: cainfo main()
|
||||
* Evaluate command line options, set up CA, connect the
|
||||
* channels, print the data as requested
|
||||
*
|
||||
* Arg(s) In: [options] <pv-name> ...
|
||||
* Arg(s) In: [options] <pv-name> ...
|
||||
*
|
||||
* Arg(s) Out: none
|
||||
* Arg(s) Out: none
|
||||
*
|
||||
* Return(s): Standard return code (0=success, 1=error)
|
||||
* Return(s): Standard return code (0=success, 1=error)
|
||||
*
|
||||
**************************************************************************-*/
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user