PREV TOC HOME INDEX NEXT


NCM_DetectBoardsEx( )


Description | Cautions | Example | /Error Codes | See Also

Name:

NCMRetCode NCM_DetectBoardsEx( pdetectInfo, pdetectResult )

Inputs:

NCM_DETECTION_INFO *pdetectInfo
  • pointer to a detection info structure
NCM_DETECTION_RESULT *pdetectResult
  • pointer to detection result structure

Returns:

NCM_SUCCESS if success NCM error code if failure

Includes:

NCMApi.h

Mode:

synchronous

Description

The NCM_DetectBoardsEx( ) function initiates auto -detection. This function initiates a process that detects any auto-detectable Intel® Dialogic boards installed on the system. For more information about auto-detection, see Section 2.6.1, Auto Detection.

The function parameters are defined as follows:

Parameter

Description

pdetectInfo Pointer to a NCM_DETECTION_INFO data structure. The NCM_DETECTION_INFO structure contains the structure size and two callback function pointers. (See Cautions below).
pdetectResult Pointer to a NCM_DETECTION_RESULT structure. The NCM_DETECTION_RESULT structure contains the detection results, including total number of boards detected. It also contains the details of each detection result (NCM_DETECTION_DETAIL), such as each detector's return code, return message and number of boards each detector detected.

Cautions

All auto-detectable Intel® Dialogic devices in the system must be detected using either the NCM_DetectBoards( ) function or the NCM_DetectBoardsEx( ) function before the NCM_StartDlgSrv( ) function can be used to start the Intel® Dialogic System Service. Refer to Section 2.6.1, Auto Detection for information about auto-detectable Intel® Dialogic devices.

The pdetectInfo pointer points to a NCM_DETECTION_INFO structure which contains the structure size and the following two callback function pointers:

For further details on data structure format, see Section 3.2, Structures for Extended Functions.

Example

#include "NCMApi.h" 
int CallBackFunc( UINT uipercent, const char *message )
{
     printf ("%d percent complete \n Status message: %s \n", uipercent, message); return TRUE;
} 
int GetPCDFile (NCMFIleInfo *fileList, int numFiles, NCMDevInfo devInfo,
int *index)
{
 //if necessary, print out the devInfo, it contains information about the device
 //for (int i=0; I<numFiles; I ++)
 //displays file index and file name

   printf ("index %d, file name = %s\n", i, fileList [i]);

   printf ("please select file index");

   scanf ("%d", index);
   return *index;
} 
bool DetectBoardsEx ( )
{
NCMRetCode ncmRc = NCM_SUCCESS;
NCM_DETECTION_INFO detectionInfo;
NCM_DETECTION_RESULT detectionResult;
detectionInfo.structSize = sizeof (NCM_DETECTION_INFO);
detectionInfo.callbackFcn = (NCM_CALLBACK_FCN*) CallBackFunc;
detectioninfo.pcdFileSelectionFcn = (NCM_PCDFILE_SELECTION_FCN*) GetPCDFile;
ncmRc = NCM_DetectBoardsEx (detectionInfo, detectionResult);
if (ncmRc ! = NCM_SUCCESS)
{
    NCMErrorMsg * pncmErrorMsg = NULL;
    ncmRc = NCM_GetErrorMsg (ncmRc, & pncmErrorMsg);
    if (ncmRc == NCM_SUCCESS)
    printf ("NCM_DetectBoardsEx ( ) returns error: %s \n", pncmErrorMsg -> name);
else
{
    printf ("NCM_DetectBoardsEx ( ) returns unknown error \n";
    NCM_Dealloc (pncmErrorMsg);
    return false;
}
else
{
    printf (NCM_DetectBoardsEx ( ) success, detected %d boards \n",
    detectionResult.totalDetectedBoards);
    return true;
}
}
} 

/Error Codes

Equate

Returned When

NCME_GENERAL a problem occurred retrieving the data
NCME_BRD_DETECT auto detect fails
NCME_DETECTOR_FCN_NOT_FOUND there was an error getting the detector function
NCME_DETECTOR_LIB_NOT_FOUND there was an error loading the detector library
NCME_SP invalid state transition
NCME_CTBB_DEVICE_DETECTED error configuring the TDM Bus
NCME_PCD_SELECTION Error, no PCD callback function with DM3 boards
NCME_REG_CALLBK callback function cannot be registered with initialization process

See Also


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated January, 2003