Obtains information about a board.
AG
CG
DWORD adiGetBoardInfo ( CTAHD ctahd, unsigned board, unsigned size, ADI_BOARD_INFO *boardinfo)
|
Argument |
Description |
|
ctahd |
Context handle returned by ctaCreateContext or ctaAttachContext. |
|
board |
Board number as specified in the board keyword file. |
|
size |
Size of boardinfo structure. |
|
boardinfo |
Pointer to the ADI_BOARD_INFO structure, as shown: typedef struct |
|
Return value |
Description |
|
SUCCESS |
|
|
CTAERR_BAD_ARGUMENT |
boardinfo pointer is NULL. |
|
CTAERR_BAD_SIZE |
size is smaller than the size of DWORD. |
|
CTAERR_INVALID_CTAHD |
Context handle is invalid. |
|
CTAERR_SVR_COMM |
Server communication error. |
Use adiGetBoardInfo to retrieve hardware configuration data for the specified board. The board argument identifies a particular board. This identifier must correlate to a board ID in the board keyword file. Refer to the board installation and developer's manual for more information.
Note: If an analog board is populated with a mixture of line interface types, the type of the lowest numbered interface is reported.
AG 4040 and AG 4040C boards are software compatible with AG 4000 and AG 4000C boards. When retrieving board information on AG 4040 or AG 4040C boards, adiGetBoardInfo reports the ADI board type as one of the AG 4000 or AG 4000C board types, for example, ADI_BOARDTYPE_AG4000_4T. The AG 4040 or AG 4040C trunk type, either T1 or E1, is configured in the board keyword file. If the trunk type is not specified, adiGetBoardInfo reports the ADI board type as one of the T1 variants.
The ctahd argument is used to access the context on which the ADI service was opened. The ADI service can be opened in driver-only mode if desired. In this case, no actual board resources are reserved. Set the board field in the MVIP_ADDR structure passed to ctaOpenServices to ADI_AG_DRIVER_ONLY. This function also works with a context that has the ADI service opened on actual MVIP streams and timeslots.
The size argument indicates how much memory to write at boardinfo address. The ADI service stores the actual number of bytes written in the ADI_BOARD_INFO size field.
void myShowBoardType( CTAHD ctahd, unsigned board )
{
ADI_BOARD_INFO boardinfo;
char *type;
unsigned b_ports;
int ret;
ret = adiGetBoardInfo( ctahd, board, sizeof boardinfo, &boardinfo );
if( ret == SUCCESS )
{
switch( boardinfo.boardtype )
case ADI_BOARDTYPE_QX2000 : type="QX 2000";b_ports=4;break;
case ADI_BOARDTYPE_AG2000: type="AG 2000"; b_ports= 8;break;
case ADI_BOARDTYPE_AG4000_4T:type="AG 4000 4T"; b_ports=96;break;
case ADI_BOARDTYPE_AG4000_4E:type="AG 4000 4E"; b_ports=120;break;
case ADI_BOARDTYPE_CG6000C_QUAD:type="CG6000C_QUAD";b_ports=120;break;
default:
case ADI_BOARDTYPE_UNKNOWN : type="Unknown"; b_ports=0; break;
}
printf( "board:%2d at addr:%4x is an %-7s with %3d ports.\n",
board, boardinfo.ioaddr, type, b_ports );
}
else if( ret == CTAERR_INVALID_BOARD )
printf( "There is no board # %d.\n", board );
else
/* unexpected error */
printf( "Error %x getting board # %d information.\n", ret, board );
}