Browse Source

cmRtSys.h/c,cmUiRTSysMstr.c:Allow access to cmRtNetH_t via cmRtSys.

master
kpl 11 years ago
parent
commit
32125efcf5
3 changed files with 21 additions and 3 deletions
  1. 19
    2
      cmRtSys.c
  2. 1
    1
      cmRtSys.h
  3. 1
    0
      cmUiRtSysMstr.c

+ 19
- 2
cmRtSys.c View File

29
   kDisableCbCmdId
29
   kDisableCbCmdId
30
 } kRtCmdId_t;
30
 } kRtCmdId_t;
31
 
31
 
32
-cmRtSysH_t cmRtSysNullHandle = { NULL };
32
+cmRtSysH_t cmRtSysNullHandle = cmSTATIC_NULL_HANDLE;
33
 
33
 
34
 struct cmRt_str;
34
 struct cmRt_str;
35
 
35
 
961
   for(j=0; j<ss->endptCnt; ++j)
961
   for(j=0; j<ss->endptCnt; ++j)
962
   {
962
   {
963
     cmRtSysNetEndpt_t* ep = ss->endptArray + j;
963
     cmRtSysNetEndpt_t* ep = ss->endptArray + j;
964
-    if( cmRtNetRegisterEndPoint( cp->netH, ep->label, ep->id ) != kOkNetRC )
964
+    if( cmRtNetRegisterEndPoint( cp->netH, cp->ctx.rtSubIdx, ep->label, ep->id ) != kOkNetRC )
965
     {
965
     {
966
       rc = _cmRtError(p,kNetErrRtRC,"Network end point allocation failed on label:%s id:%i.",cmStringNullGuard(ep->label),ep->id);
966
       rc = _cmRtError(p,kNetErrRtRC,"Network end point allocation failed on label:%s id:%i.",cmStringNullGuard(ep->label),ep->id);
967
       goto errLabel;
967
       goto errLabel;
1280
   
1280
   
1281
 }
1281
 }
1282
 
1282
 
1283
+cmRtRC_t cmRtSysNetGetHandle( cmRtSysH_t h, unsigned rtSubIdx, cmRtNetH_t* hp )
1284
+{
1285
+  cmRtRC_t rc = kOkRtRC;
1286
+  cmRt_t*  p  = _cmRtHandleToPtr(h);
1287
+
1288
+  assert( rtSubIdx < p->ssCnt );
1289
+
1290
+  if( rtSubIdx < p->ssCnt )
1291
+  {
1292
+    *hp = p->ssArray[rtSubIdx].netH;
1293
+    return rc;
1294
+  }   
1295
+
1296
+  return cmErrMsg(&p->err,kInvalidArgRtRC,"The rtSubIdx %i is out of range %i.",rtSubIdx,p->ssCnt);
1297
+}
1298
+
1299
+
1283
 
1300
 
1284
 //===========================================================================================================================
1301
 //===========================================================================================================================
1285
 //
1302
 //

+ 1
- 1
cmRtSys.h View File

322
   bool     cmRtSysNetIsInitialized( cmRtSysH_t h );
322
   bool     cmRtSysNetIsInitialized( cmRtSysH_t h );
323
   cmRtRC_t cmRtSysNetDoSync( cmRtSysH_t h );
323
   cmRtRC_t cmRtSysNetDoSync( cmRtSysH_t h );
324
   cmRtRC_t cmRtSysNetReport( cmRtSysH_t h );
324
   cmRtRC_t cmRtSysNetReport( cmRtSysH_t h );
325
-
325
+  cmRtRC_t cmRtSysNetGetHandle( cmRtSysH_t h, unsigned rtSubIdx, cmRtNetH_t* hp );
326
 
326
 
327
 
327
 
328
 #ifdef __cplusplus
328
 #ifdef __cplusplus

+ 1
- 0
cmUiRtSysMstr.c View File

9
 #include "cmThread.h"
9
 #include "cmThread.h"
10
 #include "cmUdpPort.h"
10
 #include "cmUdpPort.h"
11
 #include "cmRtSysMsg.h"
11
 #include "cmRtSysMsg.h"
12
+#include "cmRtNet.h"
12
 #include "cmRtSys.h"
13
 #include "cmRtSys.h"
13
 #include "cmUiDrvr.h"
14
 #include "cmUiDrvr.h"
14
 #include "cmUi.h"
15
 #include "cmUi.h"

Loading…
Cancel
Save