
Name: |
long sr_getboardcnt(class_namep, boardcntp) | |
Inputs: |
char *class_namep |
|
|
int *boardcntp |
|
Returns: |
0 if success |
|
|
-1 if failure |
|
Includes: |
srllib.h |
|
Type: |
SRL Parameter | |
The sr_getboardcnt( ) function retrieves the number of boards of a particular type. Use this function prior to starting an application in order to determine the amount of available resources. Once returned, the application can use technology-specific attribute functions to determine the number of devices (or subdevices) on the board, as well as other particular attributes of the board. Valid defines for class name are:
DEV_CLASS_VOICE |
|
DEV_CLASS_DTI |
|
DEV_CLASS_MSI |
|
This function returns the number of boards about which an application needs knowledge. In the case of voice, the number of four-channel boards is returned. Standard names are applied as shown below:
DEV_CLASS_VOICE |
dxxxB?C? |
DEV_CLASS_DTI |
dtiB?T? |
DEV_CLASS_MSI |
msiB?C? |
The ?s above represent board or channel numbers (incremental, starting with 1).
Parameter |
Description |
class_namep |
Pointer to class name |
boardcntp |
Pointer where to return count of boards of this class |
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
long chdev[MAXDEVS];
long evt_handle;
main( ... )
{
char channel_name[12], board_name[12];
int brd_handle;
int brd, ch, devcnt = 0;
int numvoxbrds = 0;
if ( sr_getboardcnt(DEV_CLASS_VOICE, &numvoxbrds) == -1) {
/* error retrieving voice boards */
}
for (brd = 1; brd <= numvoxbrds; brd++) {
/* build the board name and open the board device to get number of channels */
sprintf(board_name, "dxxxB%d",brd);
if ( (brd_handle = dx_open(board_name, 0)) == -1) {
/* Board open error */
}
for (ch = 1; ch <= ATDV_SUBDEVS(brd_handle); ch++) {
sprintf(channel_name, "%sC%d", board_name, ch);
if ( (chdev[devcnt++] = dx_open(channel_name, 0)) == -1) {
/* Channel open error */
}
} /* End of channel for loop */
dx_close(brd_handle);
} /* End of board loop */
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation