From d8e7f5ff22b70ca23d9cd84242a149066980de17 Mon Sep 17 00:00:00 2001 From: kpl Date: Sun, 28 Apr 2013 15:21:08 -0700 Subject: [PATCH] cmRtSys.h/c:Changes to reflect new cmRtNet API. --- cmRtSys.c | 14 +++++--------- cmRtSys.h | 8 +++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/cmRtSys.c b/cmRtSys.c index 660a848..348f484 100644 --- a/cmRtSys.c +++ b/cmRtSys.c @@ -634,7 +634,7 @@ cmRtRC_t _cmRtSysEnable( cmRt_t* p, bool enableFl ) { _cmRtCfg_t* cp = p->ssArray + i; if( cmRtNetIsValid(cp->netH) ) - if( cmRtNetBeginSyncMode(cp->netH) != kOkNetRC ) + if( cmRtNetDoSync(cp->netH) != kOkNetRC ) rc = cmErrMsg(&p->err,kNetErrRtRC,"Network Mgr. failed on entering sync mode."); } @@ -944,16 +944,12 @@ cmRtRC_t cmRtSysCfg( cmRtSysH_t h, const cmRtSysSubSys_t* ss, unsigned rtSubIdx goto errLabel; } - // register the local and remote notes - for(j=0; jnetNodeCnt; ++j) + if( cmRtNetInitialize( cp->netH, ss->bcastAddr, ss->localNodeLabel, ss->localIpAddr, ss->localIpPort) != kOkNetRC ) { - cmRtSysNetNode_t* nn = ss->netNodeArray + j; - if( cmRtNetRegisterLocalNode( cp->netH, nn->label, nn->ipAddr, nn->ipPort) != kOkNetRC ) - { - rc = _cmRtError(p,kNetErrRtRC,"Network node allocation failed on label:%s addr:%s port:%i.",cmStringNullGuard(nn->label),cmStringNullGuard(nn->ipAddr),nn->ipPort); - goto errLabel; - } + rc = _cmRtError(p,kNetErrRtRC,"Network node initialization failed on label:%s addr:%s port:%i.",cmStringNullGuard(ss->localNodeLabel),cmStringNullGuard(ss->localIpAddr),ss->localIpPort); + goto errLabel; } + // register the local endpoints for(j=0; jendptCnt; ++j) diff --git a/cmRtSys.h b/cmRtSys.h index bcebd7c..2c09c40 100644 --- a/cmRtSys.h +++ b/cmRtSys.h @@ -165,9 +165,11 @@ extern "C" { { cmRtSysArgs_t args; // Audio device configuration cmRtCallback_t cbFunc; // DSP system entry point function. - void* cbDataPtr; // Host provided data for the DSP system callback. - cmRtSysNetNode_t* netNodeArray; // One node must be the local node. - unsigned netNodeCnt; // Count of network nodes or 0 to not use network + void* cbDataPtr; // Host provided data for the DSP system callback. + const cmChar_t* bcastAddr; // Network broadcast address. + const cmChar_t* localNodeLabel; // Network local node address. + const cmChar_t* localIpAddr; // Network local IP address (default:NULL to use any available address) + cmUdpPort_t localIpPort; // Network local socket port address cmRtSysNetEndpt_t* endptArray; // Local end points unsigned endptCnt; // Count of local endpoints. } cmRtSysSubSys_t;