Browse Source

cmRtNet.h/c: More changes to cmRtNetTest().

master
kevin 11 years ago
parent
commit
19ec97b2b4
2 changed files with 9 additions and 8 deletions
  1. 8
    7
      cmRtNet.c
  2. 1
    1
      cmRtNet.h

+ 8
- 7
cmRtNet.c View File

@@ -759,6 +759,7 @@ void   cmRtNetReport( cmRtNetH_t h )
759 759
 
760 760
 
761 761
 //==========================================================================
762
+#include "cmThread.h"
762 763
 
763 764
 typedef struct
764 765
 {
@@ -768,7 +769,7 @@ typedef struct
768 769
 
769 770
 void _cmRtNetTestRecv( void* cbArg, const char* data, unsigned dataByteCnt, const struct sockaddr_in* fromAddr )
770 771
 {
771
-  _cmRtNetTest_t* p = (_cmrtNetTest_t*)cbArg;
772
+  _cmRtNetTest_t* p = (_cmRtNetTest_t*)cbArg;
772 773
 
773 774
   if( cmRtNetIsSyncModeMsg(data,dataByteCnt))
774 775
     cmRtNetSyncModeRecv(p->netH,data,dataByteCnt,fromAddr);
@@ -778,7 +779,7 @@ void _cmRtNetTestRecv( void* cbArg, const char* data, unsigned dataByteCnt, cons
778 779
 
779 780
 bool _cmRtNetTestThreadFunc(void* param)
780 781
 {
781
-  _cmrtNetTest_t* p = (_cmRtNetTest_t*)param;
782
+  _cmRtNetTest_t* p = (_cmRtNetTest_t*)param;
782 783
 
783 784
   
784 785
   if( cmRtNetIsValid(p->netH) && cmRtNetIsInSyncMode(p->netH) )
@@ -787,7 +788,7 @@ bool _cmRtNetTestThreadFunc(void* param)
787 788
   return true;
788 789
 }
789 790
 
790
-void    cmRtNetTest( cmCtx_t* ctx, bool mstrFl )
791
+void  cmRtNetTest( cmCtx_t* ctx, bool mstrFl )
791 792
 {
792 793
   char c;
793 794
   _cmRtNetTest_t t;
@@ -799,7 +800,7 @@ void    cmRtNetTest( cmCtx_t* ctx, bool mstrFl )
799 800
   if( cmThreadCreate(&p->thH,_cmRtNetTestThreadFunc,p,&ctx->rpt) != kOkThRC )
800 801
     goto errLabel;
801 802
 
802
-  if((rc = cmRtNetAlloc(ctx,&p->netH,p)) != kOkNetRC )
803
+  if((rc = cmRtNetAlloc(ctx,&p->netH,_cmRtNetTestRecv,p)) != kOkNetRC )
803 804
     goto errLabel;
804 805
 
805 806
   if((rc = cmRtNetCreateNode(p->netH, "local", NULL, port )) != kOkNetRC)
@@ -807,10 +808,10 @@ void    cmRtNetTest( cmCtx_t* ctx, bool mstrFl )
807 808
 
808 809
   if( mstrFl )
809 810
   {
810
-    if((rc = cmRtNetCreate(p->netH,"whirl", "192.168.15.109", port )) != kOkNetRC )
811
+    if((rc = cmRtNetCreateNode(p->netH,"whirl", "192.168.15.109", port )) != kOkNetRC )
811 812
       goto errLabel;
812 813
 
813
-    if((rc = cmRtNetEndPoint(p->netH,"thunk_ep0", 0 )) != kOkNetRC )
814
+    if((rc = cmRtNetRegisterEndPoint(p->netH,"thunk_ep0", 0 )) != kOkNetRC )
814 815
       goto errLabel;
815 816
 
816 817
     if(( rc = cmRtNetBeginSyncMode(p->netH)) != kOkNetRC )
@@ -819,7 +820,7 @@ void    cmRtNetTest( cmCtx_t* ctx, bool mstrFl )
819 820
   }
820 821
   else
821 822
   {
822
-    if((rc = cmRtNetEndPoint(p->netH,"whirl_ep0", 0 )) != kOkNetRC )
823
+    if((rc = cmRtNetRegisterEndPoint(p->netH,"whirl_ep0", 0 )) != kOkNetRC )
823 824
       goto errLabel;
824 825
   }
825 826
   

+ 1
- 1
cmRtNet.h View File

@@ -87,7 +87,7 @@ extern "C" {
87 87
 
88 88
   void      cmRtNetReport( cmRtNetH_t h );
89 89
     
90
-  void      cmRtNetTest( cmCtx_t* ctx );
90
+  void      cmRtNetTest( cmCtx_t* ctx, bool mstrFl );
91 91
 
92 92
   /*
93 93
     Master:

Loading…
Cancel
Save