Browse Source

cmRtSys.h/c:Changes to reflect new cmRtNet API.

master
kpl 11 years ago
parent
commit
d8e7f5ff22
2 changed files with 10 additions and 12 deletions
  1. 5
    9
      cmRtSys.c
  2. 5
    3
      cmRtSys.h

+ 5
- 9
cmRtSys.c View File

@@ -634,7 +634,7 @@ cmRtRC_t _cmRtSysEnable( cmRt_t* p, bool enableFl )
634 634
     {
635 635
       _cmRtCfg_t* cp = p->ssArray + i;
636 636
       if( cmRtNetIsValid(cp->netH) )
637
-        if( cmRtNetBeginSyncMode(cp->netH) != kOkNetRC )
637
+        if( cmRtNetDoSync(cp->netH) != kOkNetRC )
638 638
           rc = cmErrMsg(&p->err,kNetErrRtRC,"Network Mgr. failed on entering sync mode.");
639 639
     }
640 640
   
@@ -944,16 +944,12 @@ cmRtRC_t cmRtSysCfg( cmRtSysH_t h, const cmRtSysSubSys_t* ss, unsigned rtSubIdx
944 944
     goto errLabel;
945 945
   }
946 946
     
947
-  // register the local and remote notes
948
-  for(j=0; j<ss->netNodeCnt; ++j)
947
+  if( cmRtNetInitialize( cp->netH, ss->bcastAddr, ss->localNodeLabel, ss->localIpAddr, ss->localIpPort) != kOkNetRC )
949 948
   {
950
-    cmRtSysNetNode_t* nn = ss->netNodeArray + j;
951
-    if( cmRtNetRegisterLocalNode( cp->netH, nn->label, nn->ipAddr, nn->ipPort) != kOkNetRC )
952
-    {
953
-      rc = _cmRtError(p,kNetErrRtRC,"Network node allocation failed on label:%s addr:%s port:%i.",cmStringNullGuard(nn->label),cmStringNullGuard(nn->ipAddr),nn->ipPort);
954
-      goto errLabel;
955
-    }
949
+    rc = _cmRtError(p,kNetErrRtRC,"Network node initialization failed on label:%s addr:%s port:%i.",cmStringNullGuard(ss->localNodeLabel),cmStringNullGuard(ss->localIpAddr),ss->localIpPort);
950
+    goto errLabel;
956 951
   }
952
+  
957 953
 
958 954
   // register the local endpoints
959 955
   for(j=0; j<ss->endptCnt; ++j)

+ 5
- 3
cmRtSys.h View File

@@ -165,9 +165,11 @@ extern "C" {
165 165
   {
166 166
     cmRtSysArgs_t      args;              // Audio device configuration
167 167
     cmRtCallback_t     cbFunc;            // DSP system entry point function.
168
-    void*              cbDataPtr;         // Host provided data for the DSP system callback.   
169
-    cmRtSysNetNode_t*  netNodeArray;      // One node must be the local node.
170
-    unsigned           netNodeCnt;        // Count of network nodes or 0 to not use network
168
+    void*              cbDataPtr;         // Host provided data for the DSP system callback.
169
+    const cmChar_t*    bcastAddr;         // Network broadcast address.
170
+    const cmChar_t*    localNodeLabel;    // Network local node address.
171
+    const cmChar_t*    localIpAddr;       // Network local IP address (default:NULL to use any available address)
172
+    cmUdpPort_t        localIpPort;       // Network local socket port address
171 173
     cmRtSysNetEndpt_t* endptArray;        // Local end points
172 174
     unsigned           endptCnt;          // Count of local endpoints.
173 175
   } cmRtSysSubSys_t;

Loading…
Cancel
Save