changed noop request to version request

This commit is contained in:
Jeff Hill
2001-08-29 17:48:02 +00:00
parent 2d662d4d08
commit 74b5d6093f
6 changed files with 23 additions and 16 deletions

View File

@@ -93,6 +93,9 @@
#define MAX_TCP ( 1024 * 16u ) /* so waveforms fit */
#define MAX_MSG_SIZE ( MAX_TCP ) /* the larger of tcp and udp max */
#define CA_PROTO_PRIORITY_MIN 0u
#define CA_PROTO_PRIORITY_MAX 99u
/*
* architecture independent types
*
@@ -105,7 +108,7 @@ typedef float ca_float32_t;
typedef ca_uint32_t caResId;
/* values for m_cmmd */
#define CA_PROTO_NOOP 0u /* do nothing, but verify TCP */
#define CA_PROTO_VERSION 0u /* set minor version and priority (used to be NOOP cmd) */
#define CA_PROTO_EVENT_ADD 1u /* add an event */
#define CA_PROTO_EVENT_CANCEL 2u /* cancel an event */
#define CA_PROTO_READ 3u /* read and return a channel value*/

View File

@@ -70,7 +70,7 @@ const cac::pProtoStubTCP cac::tcpJumpTableCAC [] =
// TCP exception dispatch table
const cac::pExcepProtoStubTCP cac::tcpExcepJumpTableCAC [] =
{
&cac::defaultExcep, // CA_PROTO_NOOP
&cac::defaultExcep, // CA_PROTO_VERSION
&cac::eventAddExcep, // CA_PROTO_EVENT_ADD
&cac::defaultExcep, // CA_PROTO_EVENT_CANCEL
&cac::readExcep, // CA_PROTO_READ

View File

@@ -457,7 +457,7 @@ LOCAL void register_new_client ( osiSockAddr &from )
*/
caHdr noop;
memset ( (char *) &noop, '\0', sizeof ( noop ) );
noop.m_cmmd = htons ( CA_PROTO_NOOP );
noop.m_cmmd = htons ( CA_PROTO_VERSION );
fanOut ( from, &noop, sizeof ( noop ) );
if ( newClient ) {

View File

@@ -78,7 +78,7 @@ extern "C" void cacSendThreadTCP ( void *pParam )
piiu->echoRequest ();
}
else {
piiu->noopRequest ();
piiu->versionMessage ( piiu->priority() );
}
}
@@ -217,6 +217,8 @@ extern "C" void cacRecvThreadTCP ( void *pParam )
piiu->connect ();
piiu->versionMessage ( piiu->priority() );
{
callbackAutoMutex autoMutex ( *piiu->pCAC() );
piiu->pCAC()->notifyNewFD ( piiu->sock );
@@ -373,10 +375,10 @@ extern "C" void cacRecvThreadTCP ( void *pParam )
//
// tcpiiu::tcpiiu ()
//
tcpiiu::tcpiiu ( cac &cac, double connectionTimeout,
tcpiiu::tcpiiu ( cac & cac, double connectionTimeout,
epicsTimerQueue & timerQueue, const osiSockAddr & addrIn,
unsigned minorVersion, ipAddrToAsciiEngine & engineIn,
cacChannel::priLev priorityIn ) :
const cacChannel::priLev & priorityIn ) :
netiiu ( &cac ),
caServerID ( addrIn.ia, priorityIn ),
recvDog ( *this, connectionTimeout, timerQueue ),
@@ -989,20 +991,22 @@ void tcpiiu::enableFlowControlRequest ()
this->sendQue.pushUInt32 ( 0u ); // available
}
void tcpiiu::noopRequest ()
void tcpiiu::versionMessage ( const cacChannel::priLev & priority )
{
assert ( priority <= 0xffff );
if ( this->sendQue.flushEarlyThreshold ( 16u ) ) {
this->flushRequest ();
}
epicsAutoMutex locker ( this->pCAC()->mutexRef() );
this->sendQue.pushUInt16 ( CA_PROTO_NOOP ); // cmd
this->sendQue.pushUInt16 ( 0u ); // postsize
this->sendQue.pushUInt16 ( 0u ); // dataType
this->sendQue.pushUInt16 ( 0u ); // count
this->sendQue.pushUInt32 ( 0u ); // cid
this->sendQue.pushUInt32 ( 0u ); // available
this->sendQue.pushUInt16 ( CA_PROTO_VERSION ); // cmd
this->sendQue.pushUInt16 ( 0u ); // postsize ( old possize field )
this->sendQue.pushUInt16 ( priority ); // old dataType field
this->sendQue.pushUInt16 ( CA_MINOR_PROTOCOL_REVISION ); // old count field
this->sendQue.pushUInt32 ( 0u ); // ( old cid field )
this->sendQue.pushUInt32 ( 0u ); // ( old available field )
}
void tcpiiu::echoRequest ()

View File

@@ -489,7 +489,7 @@ void udpiiu::shutdown ()
this->shutdownCmd = true;
caHdr msg;
msg.m_cmmd = htons ( CA_PROTO_NOOP );
msg.m_cmmd = htons ( CA_PROTO_VERSION );
msg.m_available = htonl ( 0u );
msg.m_dataType = htons ( 0u );
msg.m_count = htons ( 0u );

View File

@@ -216,7 +216,7 @@ public:
tcpiiu ( cac &cac, double connectionTimeout,
epicsTimerQueue &timerQueue, const osiSockAddr &addrIn,
unsigned minorVersion, ipAddrToAsciiEngine & engineIn,
cacChannel::priLev priorityIn );
const cacChannel::priLev & priorityIn );
~tcpiiu ();
void connect ();
void destroy ();
@@ -286,7 +286,7 @@ private:
// send protocol stubs
void echoRequest ();
void noopRequest ();
void versionMessage ( const cacChannel::priLev & priority );
void disableFlowControlRequest ();
void enableFlowControlRequest ();
void hostNameSetRequest ();