cmRtNet.c: More changes to cmRtNetTest().

This commit is contained in:
kevin 2013-04-26 14:53:46 -07:00
commit 317d40b9d9

View File

@ -522,7 +522,7 @@ cmRtNetRC_t cmRtNetSyncModeRecv( cmRtNetH_t h, const char* data, unsigned dataB
cmRtNetNode_t* np = NULL; cmRtNetNode_t* np = NULL;
cmRtNetSyncMsg_t m; cmRtNetSyncMsg_t m;
assert( p->syncModeFl ); assert( cmRtNetIsSyncModeMsg(data,dataByteCnt));
if( _cmRtNetDeserializeSyncMsg(data,dataByteCnt,&m) != kOkNetRC ) if( _cmRtNetDeserializeSyncMsg(data,dataByteCnt,&m) != kOkNetRC )
{ {
@ -587,11 +587,13 @@ cmRtNetRC_t cmRtNetSyncModeRecv( cmRtNetH_t h, const char* data, unsigned dataB
break; break;
case kHelloAckSelNetId: // master response case kHelloAckSelNetId: // master response
assert( p->syncModeFl );
_cmRtNetRpt(p,"rcv hello ack\n"); _cmRtNetRpt(p,"rcv hello ack\n");
rc = _cmRtNetRecvAck(p,fromAddr,kWaitHelloAckStNetId,kSendEndpointStNetId); rc = _cmRtNetRecvAck(p,fromAddr,kWaitHelloAckStNetId,kSendEndpointStNetId);
break; break;
case kEndpointAckSelNetId: // master response case kEndpointAckSelNetId: // master response
assert( p->syncModeFl );
_cmRtNetRpt(p,"rcv endpoint ack\n"); _cmRtNetRpt(p,"rcv endpoint ack\n");
rc = _cmRtNetRecvAck(p,fromAddr,kWaitEndpointAckStNetId,kSendEndpointStNetId); rc = _cmRtNetRecvAck(p,fromAddr,kWaitEndpointAckStNetId,kSendEndpointStNetId);
break; break;
@ -643,8 +645,8 @@ cmRtNetRC_t _cmRtNetSendNodeSync( cmRtNet_t* p, cmRtNetNode_t* np )
{ {
cmTimeSpec_t t; cmTimeSpec_t t;
cmTimeGet(&t); cmTimeGet(&t);
unsigned fiveSecs = 5000000; unsigned twentySecs = 20000000;
if( cmTimeElapsedMicros(&np->lastSendTime,&t) > fiveSecs) if( cmTimeElapsedMicros(&np->lastSendTime,&t) > twentySecs)
{ {
const cmChar_t* ackStr = np->state==kWaitHelloAckStNetId ? "hello" : "endpoint"; const cmChar_t* ackStr = np->state==kWaitHelloAckStNetId ? "hello" : "endpoint";
rc = cmErrMsg(&p->err,kTimeOutErrNetRC,"The node %s:%s:%i did not give a '%s' acknowledge.",cmStringNullGuard(np->label),cmStringNullGuard(np->addr),np->port,ackStr); rc = cmErrMsg(&p->err,kTimeOutErrNetRC,"The node %s:%s:%i did not give a '%s' acknowledge.",cmStringNullGuard(np->label),cmStringNullGuard(np->addr),np->port,ackStr);