Browse Source

cmRtNet.h/c,cmRtSysMsg.h:Added cmRtNetMsg_t to suport use of rtSubIdx as part of endpoint description.

master
kpl 11 years ago
parent
commit
c1116f6fc0
3 changed files with 69 additions and 54 deletions
  1. 59
    51
      cmRtNet.c
  2. 3
    3
      cmRtNet.h
  3. 7
    0
      cmRtSysMsg.h

+ 59
- 51
cmRtNet.c View File

39
 {
39
 {
40
   cmChar_t*               label;
40
   cmChar_t*               label;
41
   unsigned                id;
41
   unsigned                id;
42
+  unsigned                rtSubIdx;
42
   struct cmRtNetNode_str* np;   // Owner node.
43
   struct cmRtNetNode_str* np;   // Owner node.
43
   struct cmRtNetEnd_str*  link;
44
   struct cmRtNetEnd_str*  link;
44
 } cmRtNetEnd_t;
45
 } cmRtNetEnd_t;
75
 // Network synchronization message format
76
 // Network synchronization message format
76
 typedef struct
77
 typedef struct
77
 {
78
 {
78
-  cmRtSysMsgHdr_t hdr;    // standard cmRtSys msg  header 
79
-  cmRtNetSelId_t  selId;  // message selector id (See kXXXSelNetId above)
80
-  const cmChar_t* label;  // node     or endpoint label
81
-  unsigned        id;     // endptCnt or endpoint id
79
+  cmRtSysMsgHdr_t hdr;      // standard cmRtSys msg  header 
80
+  cmRtNetSelId_t  selId;    // message selector id (See kXXXSelNetId above)
81
+  const cmChar_t* label;    // node         or endpoint label
82
+  unsigned        id;       // endptCnt     or endpoint id
83
+  unsigned        rtSubIdx; // cmInvalidIdx or rtSubIdx
82
 } cmRtNetSyncMsg_t;
84
 } cmRtNetSyncMsg_t;
83
 
85
 
84
 cmRtNetH_t      cmRtNetNullHandle      = cmSTATIC_NULL_HANDLE;
86
 cmRtNetH_t      cmRtNetNullHandle      = cmSTATIC_NULL_HANDLE;
217
   return rc;
219
   return rc;
218
 }
220
 }
219
 
221
 
220
-cmRtNetEnd_t* _cmRtNetFindNodeEnd(cmRtNetNode_t* np, const cmChar_t* endPtLabel )
222
+cmRtNetEnd_t* _cmRtNetFindNodeEnd(cmRtNetNode_t* np, unsigned rtSubIdx, const cmChar_t* endPtLabel )
221
 {
223
 {
222
   cmRtNetEnd_t* ep = np->ends;
224
   cmRtNetEnd_t* ep = np->ends;
223
   for(; ep!=NULL; ep=ep->link)
225
   for(; ep!=NULL; ep=ep->link)
224
-    if( strcmp(ep->label,endPtLabel)==0 )
226
+    if( ep->rtSubIdx==rtSubIdx && strcmp(ep->label,endPtLabel)==0 )
225
       return ep;
227
       return ep;
226
   return NULL;
228
   return NULL;
227
 }
229
 }
240
   return NULL;
242
   return NULL;
241
 }
243
 }
242
 
244
 
243
-cmRtNetRC_t _cmRtNetCreateEndpoint( cmRtNet_t* p, cmRtNetNode_t* np, const cmChar_t* endPtLabel, unsigned endPtId )
245
+cmRtNetRC_t _cmRtNetCreateEndpoint( cmRtNet_t* p, cmRtNetNode_t* np, unsigned rtSubIdx, const cmChar_t* endPtLabel, unsigned endPtId )
244
 {
246
 {
245
   if( endPtLabel == NULL )
247
   if( endPtLabel == NULL )
246
     return cmErrMsg(&p->err,kInvalidLabelNetRC,"A null or blank node label was encountered.");
248
     return cmErrMsg(&p->err,kInvalidLabelNetRC,"A null or blank node label was encountered.");
247
 
249
 
248
-  if( _cmRtNetFindNodeEnd( np, endPtLabel) != NULL)
250
+  if( _cmRtNetFindNodeEnd( np, rtSubIdx, endPtLabel) != NULL)
249
     return cmErrMsg(&p->err,kDuplEndNetRC,"A duplicate endpoint ('%s') was encountered on node '%s'.",endPtLabel,np->label);
251
     return cmErrMsg(&p->err,kDuplEndNetRC,"A duplicate endpoint ('%s') was encountered on node '%s'.",endPtLabel,np->label);
250
 
252
 
251
   cmRtNetRC_t   rc = kOkNetRC;
253
   cmRtNetRC_t   rc = kOkNetRC;
252
   cmRtNetEnd_t* ep = cmMemAllocZ(cmRtNetEnd_t,1);
254
   cmRtNetEnd_t* ep = cmMemAllocZ(cmRtNetEnd_t,1);
253
 
255
 
254
-  ep->label = cmMemAllocStr(endPtLabel);
255
-  ep->id    = endPtId;
256
-  ep->np    = np;
257
-  ep->link  = np->ends;
258
-  np->ends  = ep;
256
+  ep->label    = cmMemAllocStr(endPtLabel);
257
+  ep->id       = endPtId;
258
+  ep->rtSubIdx = rtSubIdx;
259
+  ep->np       = np;
260
+  ep->link     = np->ends;
261
+  np->ends     = ep;
259
 
262
 
260
   return rc;
263
   return rc;
261
 }
264
 }
295
   return kOkNetRC;
298
   return kOkNetRC;
296
 }
299
 }
297
 
300
 
298
-cmRtNetRC_t _cmRtNetSendSyncMsg( cmRtNet_t* p, cmRtNetNode_t* np, cmRtNetSelId_t selId, const cmChar_t* msgLabel, unsigned msgId )
301
+cmRtNetRC_t _cmRtNetSendSyncMsg( cmRtNet_t* p, cmRtNetNode_t* np, cmRtNetSelId_t selId, const cmChar_t* msgLabel, unsigned msgId, unsigned msgRtSubIdx )
299
 {
302
 {
300
   cmRtNetSyncMsg_t m;
303
   cmRtNetSyncMsg_t m;
301
   cmRtNetRC_t      rc = kOkNetRC;
304
   cmRtNetRC_t      rc = kOkNetRC;
306
   m.selId        = selId;
309
   m.selId        = selId;
307
   m.label        = msgLabel;
310
   m.label        = msgLabel;
308
   m.id           = msgId;
311
   m.id           = msgId;
312
+  m.rtSubIdx     = msgRtSubIdx;
309
 
313
 
310
   // determine size of msg to send
314
   // determine size of msg to send
311
   unsigned n  = _cmRtNetSyncMsgSerialByteCount(&m);
315
   unsigned n  = _cmRtNetSyncMsgSerialByteCount(&m);
415
 
419
 
416
 cmRtNetRC_t  _cmRtNetSendEndpointReplyMsg( cmRtNet_t* p, cmRtNetNode_t* np, cmRtNetSelId_t srcSelId )
420
 cmRtNetRC_t  _cmRtNetSendEndpointReplyMsg( cmRtNet_t* p, cmRtNetNode_t* np, cmRtNetSelId_t srcSelId )
417
 {
421
 {
418
-  cmRtNetRC_t     rc = kOkNetRC;
419
-  cmRtNetEnd_t*   ep;
420
-  const cmChar_t* msgLabel = NULL;
421
-  unsigned        msgId    = cmInvalidId;  
422
-  cmRtNetSelId_t  selId    = kEndpointSelNetId;
423
-  const cmChar_t* rptLabel = "endpoint";
422
+  cmRtNetRC_t     rc          = kOkNetRC;
423
+  cmRtNetEnd_t*   ep          = NULL;
424
+  const cmChar_t* msgLabel    = NULL;
425
+  unsigned        msgId       = cmInvalidId;
426
+  unsigned        msgRtSubIdx = cmInvalidIdx;
427
+  cmRtNetSelId_t  selId       = kEndpointSelNetId;
428
+  const cmChar_t* rptLabel    = "endpoint";
424
 
429
 
425
   if( np == NULL )
430
   if( np == NULL )
426
     return cmErrMsg(&p->err,kNodeNotFoundNetRC,"The net node associated with an endpoint reply was not found.");
431
     return cmErrMsg(&p->err,kNodeNotFoundNetRC,"The net node associated with an endpoint reply was not found.");
439
   // attempt to get the next local endpoint to send ...
444
   // attempt to get the next local endpoint to send ...
440
   if((ep = _cmRtNetIndexToEndpoint(p,p->localNode,np->endPtIdx)) != NULL )
445
   if((ep = _cmRtNetIndexToEndpoint(p,p->localNode,np->endPtIdx)) != NULL )
441
   {
446
   {
442
-    msgLabel = ep->label;  // ... send next local endpoint
443
-    msgId    = ep->id;
447
+    msgLabel    = ep->label;  // ... send next local endpoint
448
+    msgId       = ep->id;
449
+    msgRtSubIdx = ep->rtSubIdx;
444
   }
450
   }
445
   else // .... all local endpoints have been sent
451
   else // .... all local endpoints have been sent
446
   {
452
   {
462
   // selId is set to kInvalidSelNetId when we encounter the (stop) criteria
468
   // selId is set to kInvalidSelNetId when we encounter the (stop) criteria
463
   if( selId != kInvalidSelNetId )
469
   if( selId != kInvalidSelNetId )
464
   {
470
   {
465
-    if((rc = _cmRtNetSendSyncMsg(p,np,selId,msgLabel,msgId )) != kOkNetRC )
471
+    if((rc = _cmRtNetSendSyncMsg(p,np,selId,msgLabel,msgId,msgRtSubIdx)) != kOkNetRC )
466
       rc = cmErrMsg(&p->err,rc,"Send '%s' to %s:%s:%i failed.",rptLabel,cmStringNullGuard(np->label),cmStringNullGuard(np->addr),np->port);
472
       rc = cmErrMsg(&p->err,rc,"Send '%s' to %s:%s:%i failed.",rptLabel,cmStringNullGuard(np->label),cmStringNullGuard(np->addr),np->port);
467
     else
473
     else
468
       _cmRtNetRpt(p,"Sent %s.\n",cmStringNullGuard(rptLabel));
474
       _cmRtNetRpt(p,"Sent %s.\n",cmStringNullGuard(rptLabel));
545
         {
551
         {
546
           case kHelloSelNetId:
552
           case kHelloSelNetId:
547
             _cmRtNetRpt(p,"rcv hello\n"); // reply with local node
553
             _cmRtNetRpt(p,"rcv hello\n"); // reply with local node
548
-            rc = _cmRtNetSendSyncMsg( p, np, kNodeSelNetId, p->localNode->label, p->localNode->endPtCnt );
554
+            rc = _cmRtNetSendSyncMsg( p, np, kNodeSelNetId, p->localNode->label, p->localNode->endPtCnt, cmInvalidIdx );
549
             break;
555
             break;
550
 
556
 
551
           case kNodeSelNetId:
557
           case kNodeSelNetId:
577
         }
583
         }
578
         
584
         
579
         // attempt to find the end point 
585
         // attempt to find the end point 
580
-        if((ep = _cmRtNetFindNodeEnd(np,m.label)) != NULL )
586
+        if((ep = _cmRtNetFindNodeEnd(np, m.rtSubIdx, m.label)) != NULL )
581
           ep->id = m.id; // the endpoint was found update the endPtId
587
           ep->id = m.id; // the endpoint was found update the endPtId
582
         else
588
         else
583
         {
589
         {
584
           // create a local proxy for the endpoint
590
           // create a local proxy for the endpoint
585
-          if((rc = _cmRtNetCreateEndpoint(p,np,m.label,m.id)) != kOkNetRC )
591
+          if((rc = _cmRtNetCreateEndpoint(p,np,m.rtSubIdx,m.label,m.id)) != kOkNetRC )
586
             goto errLabel;
592
             goto errLabel;
587
         }
593
         }
588
 
594
 
666
 }
672
 }
667
 
673
 
668
 
674
 
669
-cmRtNetRC_t cmRtNetRegisterEndPoint( cmRtNetH_t h, const cmChar_t* endPtLabel, unsigned endPtId )
675
+cmRtNetRC_t cmRtNetRegisterEndPoint( cmRtNetH_t h, unsigned rtSubIdx, const cmChar_t* endPtLabel, unsigned endPtId )
670
 {
676
 {
671
   cmRtNetRC_t rc = kOkNetRC;
677
   cmRtNetRC_t rc = kOkNetRC;
672
   cmRtNet_t* p = _cmRtNetHandleToPtr(h);
678
   cmRtNet_t* p = _cmRtNetHandleToPtr(h);
674
   if( p->localNode == NULL )
680
   if( p->localNode == NULL )
675
     return cmErrMsg(&p->err,kLocalNodeNetRC,"Local endpoints may not be added if a local node has not been defined.");
681
     return cmErrMsg(&p->err,kLocalNodeNetRC,"Local endpoints may not be added if a local node has not been defined.");
676
 
682
 
677
-  if((rc = _cmRtNetCreateEndpoint(p, p->localNode,endPtLabel,endPtId )) == kOkNetRC )
683
+  if((rc = _cmRtNetCreateEndpoint(p, p->localNode,rtSubIdx,endPtLabel,endPtId )) == kOkNetRC )
678
     p->localNode->endPtCnt += 1;
684
     p->localNode->endPtCnt += 1;
679
 
685
 
680
   return rc;
686
   return rc;
693
   cmRtNet_t* p = _cmRtNetHandleToPtr(h);
699
   cmRtNet_t* p = _cmRtNetHandleToPtr(h);
694
 
700
 
695
   // broadcast 'node' msg
701
   // broadcast 'node' msg
696
-  return _cmRtNetSendSyncMsg( p, p->localNode, kHelloSelNetId, p->localNode->label, p->localNode->endPtCnt );
702
+  return _cmRtNetSendSyncMsg( p, p->localNode, kHelloSelNetId, p->localNode->label, p->localNode->endPtCnt, cmInvalidIdx );
697
 }
703
 }
698
 
704
 
699
 cmRtNetRC_t cmRtNetReceive( cmRtNetH_t h )
705
 cmRtNetRC_t cmRtNetReceive( cmRtNetH_t h )
710
   return rc;
716
   return rc;
711
 }
717
 }
712
 
718
 
713
-cmRtNetRC_t cmRtNetEndpointHandle( cmRtNetH_t h, const cmChar_t* nodeLabel, const cmChar_t* endptLabel, cmRtNetEndptH_t* hp )
719
+cmRtNetRC_t cmRtNetEndpointHandle( cmRtNetH_t h, const cmChar_t* nodeLabel, unsigned rtSubIdx, const cmChar_t* endptLabel, cmRtNetEndptH_t* hp )
714
 {
720
 {
715
   cmRtNetRC_t     rc = kOkNetRC;
721
   cmRtNetRC_t     rc = kOkNetRC;
716
   cmRtNet_t*      p  = _cmRtNetHandleToPtr(h);
722
   cmRtNet_t*      p  = _cmRtNetHandleToPtr(h);
721
     return cmErrMsg(&p->err,kNodeNotFoundNetRC,"The node '%s' was not found.",cmStringNullGuard(nodeLabel));
727
     return cmErrMsg(&p->err,kNodeNotFoundNetRC,"The node '%s' was not found.",cmStringNullGuard(nodeLabel));
722
 
728
 
723
 
729
 
724
-  if(( ep = _cmRtNetFindNodeEnd(np, endptLabel )) == NULL )
730
+  if(( ep = _cmRtNetFindNodeEnd(np, rtSubIdx, endptLabel )) == NULL )
725
     return cmErrMsg(&p->err,kEndNotFoundNetRC,"The endpoint '%s' on '%s' on node was not found.",cmStringNullGuard(endptLabel),cmStringNullGuard(nodeLabel));
731
     return cmErrMsg(&p->err,kEndNotFoundNetRC,"The endpoint '%s' on '%s' on node was not found.",cmStringNullGuard(endptLabel),cmStringNullGuard(nodeLabel));
726
 
732
 
727
   hp->h = ep;
733
   hp->h = ep;
737
  
743
  
738
   assert( ep != NULL );
744
   assert( ep != NULL );
739
   
745
   
740
-  unsigned dN = sizeof(cmRtSysMsgHdr_t) + msgByteCnt; 
746
+  unsigned dN = sizeof(cmRtNetMsg_t) + msgByteCnt; 
741
   char data[ dN ];
747
   char data[ dN ];
742
 
748
 
743
-  cmRtSysMsgHdr_t* hdr = (cmRtSysMsgHdr_t*)data;
744
-  hdr->rtSubIdx     = ep->id;
745
-  hdr->selId        = kMsgSelRtId;
749
+  cmRtNetMsg_t* r = (cmRtNetMsg_t*)data;
750
+  r->hdr.rtSubIdx     = ep->rtSubIdx;
751
+  r->hdr.selId        = kMsgSelRtId;
752
+  r->endptId          = ep->id;
746
   memcpy(data+sizeof(cmRtSysMsgHdr_t),msg,msgByteCnt);
753
   memcpy(data+sizeof(cmRtSysMsgHdr_t),msg,msgByteCnt);
747
   
754
   
748
   if( cmUdpSendTo(p->udpH, data, dN, &ep->np->sockaddr ) != kOkUdpRC )
755
   if( cmUdpSendTo(p->udpH, data, dN, &ep->np->sockaddr ) != kOkUdpRC )
751
   return rc;
758
   return rc;
752
 }
759
 }
753
 
760
 
754
-cmRtNetRC_t cmRtNetSendByLabels( cmRtNetH_t h, const cmChar_t* nodeLabel, const cmChar_t* endptLabel, const void* msg, unsigned msgByteCnt )
761
+cmRtNetRC_t cmRtNetSendByLabels( cmRtNetH_t h, const cmChar_t* nodeLabel, unsigned rtSubIdx, const cmChar_t* endptLabel, const void* msg, unsigned msgByteCnt )
755
 {
762
 {
756
   cmRtNetRC_t     rc  = kOkNetRC;
763
   cmRtNetRC_t     rc  = kOkNetRC;
757
   cmRtNetEndptH_t epH = cmRtNetEndptNullHandle;
764
   cmRtNetEndptH_t epH = cmRtNetEndptNullHandle;
758
 
765
 
759
-  if((rc = cmRtNetEndpointHandle(h,nodeLabel,endptLabel,&epH)) != kOkNetRC )
766
+  if((rc = cmRtNetEndpointHandle(h,nodeLabel,rtSubIdx,endptLabel,&epH)) != kOkNetRC )
760
     return rc;
767
     return rc;
761
 
768
 
762
   return cmRtNetSend(h,epH,msg,msgByteCnt);
769
   return cmRtNetSend(h,epH,msg,msgByteCnt);
827
 {
834
 {
828
   //_cmRtNetTest_t* p = (_cmRtNetTest_t*)cbArg;
835
   //_cmRtNetTest_t* p = (_cmRtNetTest_t*)cbArg;
829
   
836
   
830
-  cmRtSysMsgHdr_t* hdr = (cmRtSysMsgHdr_t*)data;
831
-  unsigned i = *(unsigned*)(data + sizeof(cmRtSysMsgHdr_t));
832
-  printf("%i %i\n",hdr->rtSubIdx,i);
837
+  cmRtNetMsg_t* r = (cmRtNetMsg_t*)data;
838
+  unsigned      i = *(unsigned*)(data + sizeof(cmRtNetMsg_t));
839
+  printf("rtSubIdx:%i endptId:%i %i\n",r->hdr.rtSubIdx,r->endptId,i);
833
 
840
 
834
 }
841
 }
835
 
842
 
852
 {
859
 {
853
   char            c;
860
   char            c;
854
   _cmRtNetTest_t  t;
861
   _cmRtNetTest_t  t;
855
-  cmUdpPort_t     port = 5876;
856
-  _cmRtNetTest_t* p    = &t;
857
-  cmRtNetRC_t     rc   = kOkNetRC;
858
-  const cmChar_t* localHostStr   = mstrFl  ? "master"    : "slave";
859
-  const cmChar_t* localEndpStr   = mstrFl  ? "master_ep" : "slave_ep";
860
-  const cmChar_t* remoteHostStr  = !mstrFl ? "master"    : "slave";
861
-  const cmChar_t* remoteEndpStr  = !mstrFl ? "master_ep" : "slave_ep";
862
-  const cmChar_t* bcastAddr      = "192.168.15.255";
863
-
862
+  const unsigned  rtSubIdx      = 0;
863
+  cmUdpPort_t     port          = 5876;
864
+  _cmRtNetTest_t* p             = &t;
865
+  cmRtNetRC_t     rc            = kOkNetRC;
866
+  const cmChar_t* localHostStr  = mstrFl  ? "master"    : "slave";
867
+  const cmChar_t* localEndpStr  = mstrFl  ? "master_ep" : "slave_ep";
868
+  const cmChar_t* remoteHostStr = !mstrFl ? "master"    : "slave";
869
+  const cmChar_t* remoteEndpStr = !mstrFl ? "master_ep" : "slave_ep";
870
+  const cmChar_t* bcastAddr     = "192.168.15.255";
871
+  
864
   memset(&t,0,sizeof(t));
872
   memset(&t,0,sizeof(t));
865
 
873
 
866
   if( cmThreadCreate(&p->thH,_cmRtNetTestThreadFunc,p,&ctx->rpt) != kOkThRC )
874
   if( cmThreadCreate(&p->thH,_cmRtNetTestThreadFunc,p,&ctx->rpt) != kOkThRC )
874
   if((rc = cmRtNetInitialize(p->netH, bcastAddr, localHostStr, NULL, port )) != kOkNetRC)
882
   if((rc = cmRtNetInitialize(p->netH, bcastAddr, localHostStr, NULL, port )) != kOkNetRC)
875
     goto errLabel;
883
     goto errLabel;
876
 
884
 
877
-  if((rc = cmRtNetRegisterEndPoint(p->netH,localEndpStr, 0 )) != kOkNetRC )
885
+  if((rc = cmRtNetRegisterEndPoint(p->netH,rtSubIdx,localEndpStr, 0 )) != kOkNetRC )
878
     goto errLabel;
886
     goto errLabel;
879
   
887
   
880
   if( cmThreadPause(p->thH,0) != kOkThRC )
888
   if( cmThreadPause(p->thH,0) != kOkThRC )
896
 
904
 
897
       case 't':
905
       case 't':
898
         {
906
         {
899
-          if( cmRtNetSendByLabels(p->netH, remoteHostStr, remoteEndpStr, &p->msgVal, sizeof(p->msgVal)) == kOkNetRC )
907
+          if( cmRtNetSendByLabels(p->netH, remoteHostStr, rtSubIdx, remoteEndpStr, &p->msgVal, sizeof(p->msgVal)) == kOkNetRC )
900
             p->msgVal += 1;
908
             p->msgVal += 1;
901
 
909
 
902
         }        
910
         }        

+ 3
- 3
cmRtNet.h View File

55
   // cmRtNetInitialize().
55
   // cmRtNetInitialize().
56
   // Remote nodes will be able to send messages to these endpoints by
56
   // Remote nodes will be able to send messages to these endpoints by
57
   // referring to (nodeLabel/endPtLabel)
57
   // referring to (nodeLabel/endPtLabel)
58
-  cmRtNetRC_t cmRtNetRegisterEndPoint( cmRtNetH_t h, const cmChar_t* endPtLabel, unsigned endPtId );
58
+  cmRtNetRC_t cmRtNetRegisterEndPoint( cmRtNetH_t h, unsigned rtSubIdx, const cmChar_t* endPtLabel, unsigned endPtId );
59
 
59
 
60
   // Delete all nodes and endpoints.
60
   // Delete all nodes and endpoints.
61
   cmRtNetRC_t cmRtNetFinalize( cmRtNetH_t h );
61
   cmRtNetRC_t cmRtNetFinalize( cmRtNetH_t h );
69
   cmRtNetRC_t cmRtNetReceive( cmRtNetH_t h );
69
   cmRtNetRC_t cmRtNetReceive( cmRtNetH_t h );
70
 
70
 
71
   // Get an end point handle for use with cmRtNetSend.
71
   // Get an end point handle for use with cmRtNetSend.
72
-  cmRtNetRC_t cmRtNetEndpointHandle( cmRtNetH_t h, const cmChar_t* nodeLabel, const cmChar_t* endptLabel, cmRtNetEndptH_t* hp );
72
+  cmRtNetRC_t cmRtNetEndpointHandle( cmRtNetH_t h, const cmChar_t* nodeLabel, unsigned rtSubIdx, const cmChar_t* endptLabel, cmRtNetEndptH_t* hp );
73
 
73
 
74
   // Send a message to a remote endpoint.
74
   // Send a message to a remote endpoint.
75
   cmRtNetRC_t cmRtNetSend( cmRtNetH_t h, cmRtNetEndptH_t epH, const void* msg, unsigned msgByteCnt );
75
   cmRtNetRC_t cmRtNetSend( cmRtNetH_t h, cmRtNetEndptH_t epH, const void* msg, unsigned msgByteCnt );
76
 
76
 
77
   // Send a message to a remote endpoint. This function is a composite
77
   // Send a message to a remote endpoint. This function is a composite
78
   // of cmRtNetEndpointHandle() and cmRtNetSend().
78
   // of cmRtNetEndpointHandle() and cmRtNetSend().
79
-  cmRtNetRC_t cmRtNetSendByLabels( cmRtNetH_t h, const cmChar_t* nodeLabel, const cmChar_t* endptLabel, const void* msg, unsigned msgByteCnt );
79
+  cmRtNetRC_t cmRtNetSendByLabels( cmRtNetH_t h, const cmChar_t* nodeLabel, unsigned rtSubIdx, const cmChar_t* endptLabel, const void* msg, unsigned msgByteCnt );
80
 
80
 
81
   // Enable/disable synchronization protocol reporting.
81
   // Enable/disable synchronization protocol reporting.
82
   // Return the previous state of the report sync. flag.
82
   // Return the previous state of the report sync. flag.

+ 7
- 0
cmRtSysMsg.h View File

95
     // cmMidiMsg msgArray[msgCnt]
95
     // cmMidiMsg msgArray[msgCnt]
96
   } cmRtSysMidi_t;
96
   } cmRtSysMidi_t;
97
 
97
 
98
+  typedef struct
99
+  {
100
+    cmRtSysMsgHdr_t hdr;
101
+    unsigned        endptId;
102
+    // char msg[ msgByteCnt ]
103
+  } cmRtNetMsg_t;
104
+
98
 #ifdef __cplusplus
105
 #ifdef __cplusplus
99
 }
106
 }
100
 #endif
107
 #endif

Loading…
Cancel
Save