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,7 +29,7 @@ typedef enum
29 29
   kDisableCbCmdId
30 30
 } kRtCmdId_t;
31 31
 
32
-cmRtSysH_t cmRtSysNullHandle = { NULL };
32
+cmRtSysH_t cmRtSysNullHandle = cmSTATIC_NULL_HANDLE;
33 33
 
34 34
 struct cmRt_str;
35 35
 
@@ -961,7 +961,7 @@ cmRtRC_t cmRtSysCfg( cmRtSysH_t h, const cmRtSysSubSys_t* ss, unsigned rtSubIdx
961 961
   for(j=0; j<ss->endptCnt; ++j)
962 962
   {
963 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 966
       rc = _cmRtError(p,kNetErrRtRC,"Network end point allocation failed on label:%s id:%i.",cmStringNullGuard(ep->label),ep->id);
967 967
       goto errLabel;
@@ -1280,6 +1280,23 @@ cmRtRC_t cmRtSysNetReport( cmRtSysH_t h )
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,7 +322,7 @@ extern "C" {
322 322
   bool     cmRtSysNetIsInitialized( cmRtSysH_t h );
323 323
   cmRtRC_t cmRtSysNetDoSync( cmRtSysH_t h );
324 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 328
 #ifdef __cplusplus

+ 1
- 0
cmUiRtSysMstr.c View File

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

Loading…
Cancel
Save