botsense/bsProxy/bsProxyMod.c
BsModIter_T *ModCbIterNext(BsModIter_T *pIter)
{
  BsVConnHnd_T    hndVConn;
  BsProxyVConn_T *pVConn;
  bool_t          bHasMatch = false;

  if( pIter == NULL )
  {
    return NULL;
  }

  for(hndVConn=pIter->m_hndVConn+1;
      (pIter!=NULL) && (hndVConn<BSPROXY_VCONN_NUMOF);
      ++hndVConn)
  {
    if( (pVConn = VConnAcquire(hndVConn)) != NULL )
    {
      switch( pIter->m_eOver )
      {
        case BsModIterOverDevUri:
          if( !strcmp(pVConn->m_pThCtl->m_sDevUri, pIter->m_sDevUri) )
          {
            pIter->m_hndVConn = hndVConn;
            delete(pIter->m_sModUri);
            pIter->m_sModUri = new_strdup(pVConn->m_pModIF->m_sModUri);
            pIter->m_rd = pVConn->m_rd;
            bHasMatch = true;
          }
          break;
        case BsModIterOverModUri:
          if( !strcmp(pVConn->m_pModIF->m_sModUri, pIter->m_sModUri) )
          {
            pIter->m_hndVConn = hndVConn;
            delete(pIter->m_sDevUri);
            pIter->m_sDevUri = new_strdup(pVConn->m_pThCtl->m_sDevUri);
            pIter->m_rd = pVConn->m_rd;
            bHasMatch = true;
          }
          break;
        case BsModIterOverVConn:
            pIter->m_hndVConn = hndVConn;
            delete(pIter->m_sDevUri);
            pIter->m_sDevUri = new_strdup(pVConn->m_pThCtl->m_sDevUri);
            delete(pIter->m_sModUri);
            pIter->m_sModUri = new_strdup(pVConn->m_pModIF->m_sModUri);
            pIter->m_rd = pVConn->m_rd;
            bHasMatch = true;
          break;
        default:
          ModCbIterDelete(pIter);
          pIter = NULL;
          break;
      }
      VConnRelease(hndVConn);
    }
  }

  if( !bHasMatch )
  {
    ModCbIterDelete(pIter);
    pIter = NULL;
  }

  return pIter;
}
/*!
 * \brief Get the next set of information given the iterator state.
 *
 * If a virtual connection match is found, an iterator data is updated.
 *
 * If no match is found, the iterator is auto-deleted.
 *
 * \param pIter     Initialized, allocated iterator.
 *
 * \return On success, returns the pointer to the iterator.\n
 * On failure, NULL is returned.
 */
\brief Get the next set of information given the iterator state.
If a virtual connection match is found, an iterator data is updated.

If no match is found, the iterator is auto-deleted.

\param pIter     Initialized, allocated iterator.

\return On success, returns the pointer to the iterator.\n
On failure, NULL is returned.
\ brief Get the next set of information given the iterator state . If a virtual connection match is found an iterator data is updated . If no match is found the iterator is auto - deleted . \ param pIter Initialized allocated iterator . \ return On success returns the pointer to the iterator . \ n On failure NULL is returned .
BsModIter_T *ModCbIterNext(BsModIter_T *pIter)
{
  BsVConnHnd_T    hndVConn;
  BsProxyVConn_T *pVConn;
  bool_t          bHasMatch = false;
  if( pIter == NULL )
  {
    return NULL;
  }
  for(hndVConn=pIter->m_hndVConn+1;
      (pIter!=NULL) && (hndVConn<BSPROXY_VCONN_NUMOF);
      ++hndVConn)
  {
    if( (pVConn = VConnAcquire(hndVConn)) != NULL )
    {
      switch( pIter->m_eOver )
      {
        case BsModIterOverDevUri:
          if( !strcmp(pVConn->m_pThCtl->m_sDevUri, pIter->m_sDevUri) )
          {
            pIter->m_hndVConn = hndVConn;
            delete(pIter->m_sModUri);
            pIter->m_sModUri = new_strdup(pVConn->m_pModIF->m_sModUri);
            pIter->m_rd = pVConn->m_rd;
            bHasMatch = true;
          }
          break;
        case BsModIterOverModUri:
          if( !strcmp(pVConn->m_pModIF->m_sModUri, pIter->m_sModUri) )
          {
            pIter->m_hndVConn = hndVConn;
            delete(pIter->m_sDevUri);
            pIter->m_sDevUri = new_strdup(pVConn->m_pThCtl->m_sDevUri);
            pIter->m_rd = pVConn->m_rd;
            bHasMatch = true;
          }
          break;
        case BsModIterOverVConn:
            pIter->m_hndVConn = hndVConn;
            delete(pIter->m_sDevUri);
            pIter->m_sDevUri = new_strdup(pVConn->m_pThCtl->m_sDevUri);
            delete(pIter->m_sModUri);
            pIter->m_sModUri = new_strdup(pVConn->m_pModIF->m_sModUri);
            pIter->m_rd = pVConn->m_rd;
            bHasMatch = true;
          break;
        default:
          ModCbIterDelete(pIter);
          pIter = NULL;
          break;
      }
      VConnRelease(hndVConn);
    }
  }
  if( !bHasMatch )
  {
    ModCbIterDelete(pIter);
    pIter = NULL;
  }
  return pIter;
}
BsModIter_T * ModCbIterNext ( BsModIter_T * pIter ) { BsVConnHnd_T hndVConn ; BsProxyVConn_T * pVConn ; bool_t bHasMatch = false ; if ( pIter == NULL ) { return NULL ; } for ( hndVConn = pIter -> m_hndVConn + 1 ; ( pIter != NULL ) && ( hndVConn < BSPROXY_VCONN_NUMOF ) ; ++ hndVConn ) { if ( ( pVConn = VConnAcquire ( hndVConn ) ) != NULL ) { switch ( pIter -> m_eOver ) { case BsModIterOverDevUri : if ( ! strcmp ( pVConn -> m_pThCtl -> m_sDevUri , pIter -> m_sDevUri ) ) { pIter -> m_hndVConn = hndVConn ; delete ( pIter -> m_sModUri ) ; pIter -> m_sModUri = new_strdup ( pVConn -> m_pModIF -> m_sModUri ) ; pIter -> m_rd = pVConn -> m_rd ; bHasMatch = true ; } break ; case BsModIterOverModUri : if ( ! strcmp ( pVConn -> m_pModIF -> m_sModUri , pIter -> m_sModUri ) ) { pIter -> m_hndVConn = hndVConn ; delete ( pIter -> m_sDevUri ) ; pIter -> m_sDevUri = new_strdup ( pVConn -> m_pThCtl -> m_sDevUri ) ; pIter -> m_rd = pVConn -> m_rd ; bHasMatch = true ; } break ; case BsModIterOverVConn : pIter -> m_hndVConn = hndVConn ; delete ( pIter -> m_sDevUri ) ; pIter -> m_sDevUri = new_strdup ( pVConn -> m_pThCtl -> m_sDevUri ) ; delete ( pIter -> m_sModUri ) ; pIter -> m_sModUri = new_strdup ( pVConn -> m_pModIF -> m_sModUri ) ; pIter -> m_rd = pVConn -> m_rd ; bHasMatch = true ; break ; default : ModCbIterDelete ( pIter ) ; pIter = NULL ; break ; } VConnRelease ( hndVConn ) ; } } if ( ! bHasMatch ) { ModCbIterDelete ( pIter ) ; pIter = NULL ; } return pIter ; }
\brief Get the next set of information given the iterator state.
\ brief Get the next set of information given the iterator state .